Public:Installing the Perl Interoperability Test Suite

From wiki.opentravel.org

Jump to: navigation, search

Contents

[edit] Unix/Linux

This document describes the installation of the Perl Interoperability Test Tool on Unix/Linux servers. This is the environment that the tool was developed on.

NOTE - This document is not complete. If you want to begin playing around with the Test Suite, you should communicate with sadkins _at_ therubicongroup.com.

If you want to install on a Microsoft Windows server go here.

[edit] Install Perl

Most Linux/Unix systems come with Perl installed. Type "perl --version" to find which version it is. Any perl greater than Version 5.6.1 should work. Let us know if it doesn't.

If you need to download and install Perl, go here.

[edit] Install Apache

If you only want to use the test client, you do not need to install a web server such as Apache. However, the full Interoperability Test Tool includes both a client and a server. This server (currently) needs a web server in order to function. Download and install Apache from here.

[edit] Install Xerces

The Interoperability Test Tool uses XML::Xerces, a Perl module which is an interface to Xerces-C from the Apache Foundation.

Here are some links for Xerces-C and XML::Xerces.

To install the software, start by installing Xerces-C.

So here are some commands that will download and install the Xerces-C software.

su -
cd /usr/local/src
wget -O tar/xerces-c-current.tar.gz http://www.apache.org/dist/xml/xerces-c/xerces-c-current.tar.gz
tar xvzf tar/xerces-c-current.tar.gz
cd xerces-c-src_2_7_0
export XERCESCROOT=/usr/local/src/xerces-c-src_2_7_0
cd $XERCESCROOT
cd src/xercesc
./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread
make
make install

This installs Xerces-C into the "/usr/local" path.

Then install XML::Xerces from CPAN. A variety of environment variables need to be set in order for this to be successful as described below.

export XERCESCROOT=/usr/local/src/xerces-c-src_2_7_0
export XERCES_CONFIG=/usr/local/src/xerces-c-src_2_7_0/src/xercesc/config.status
export XERCES_LIB=/usr/local/lib
export XERCES_INCLUDE=/usr/local/include
perl -MCPAN -e shell
cpan> install XML::Xerces
cpan> exit

NOTE: I have verified that these instructions work. Spadkins 10:15, 18 April 2007 (CDT)

[edit] Install Prerequisite Perl Modules

After you have ensured that you have Perl installed, you need to install a number of other Perl modules from CPAN. The following commands are to install the packages which are necessary in order for any of Business-Travel-OTA to run. Generally, you need to have "root" access to install new perl modules.

 > perl -MCPAN -e shell
 cpan> install Date::Parse
 cpan> install Date::Format
 cpan> install YAML
 cpan> install App::Options
 cpan> install XML::Simple
 cpan> install XML::XPath
 cpan> exit

If you find additional dependencies which are not a part of the standard Perl distribution, please add them here.

HTML documentation for these modules is available here.

[edit] Install Business-Travel-OTA and Prerequisites

There are two ways to install the Interoperability Test Tool.

Because the software is changing rapidly through its alpha and beta stages, it is recommended that you install the software directly from the Subversion source code repository.

As the software stabilizes, it will be possible to use the more straightforward installation from CPAN, described as the second option.

[edit] Install Subversion

Most Linux/Unix distributions come with subversion (svn) installed. If not, download software from the following websites. Subversion uses (and depends on) BerkeleyDB from Sleepycat (now owned by Oracle), so you may have to donwload and install that too.

When I last installed, I was using subversion-1.1.4.tar.gz and db-4.2.52.tar.gz in /usr/local/src/tar. With those versions of software in those locations, the following commands worked to compile and install the software.

cd /usr/local/src
rm -rf db-4.2.52
tar xvzf tar/db-4.2.52.tar.gz
cd db-4.2.52/build_unix
../dist/configure
make
make install
cd /usr/local/src
rm -rf subversion-1.1.4
tar xvzf tar/subversion-1.1.4.tar.gz
cd subversion-1.1.4
./configure --prefix=/usr/local --with-ssl
make
make install

[edit] Install from Subversion Source Repository

Exit from "root" access to the ordinary user level.

When we install the rest of the software, we need to have a $PREFIX variable defined which is the home directory of the software. Let's assume that is your HOME directory.

export PREFIX=$HOME
cd $PREFIX
mkdir src bin etc lib cgi-bin htdocs
cd $PREFIX/src
svn co https://svn.perl.org/modules/p5ee/trunk/ p5ee
svn co https://svn.sourceforge.net/svnroot/ota-tools/ ota-tools

When checking out the code from the Subversion repository, you may get a message such as this. In that case choose "p". If that does not work, use the capital "P" instead.

Error validating server certificate for 'https://svn.perl.org:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: svn.perl.org
 - Valid: from Aug  7 06:21:11 2006 GMT until Aug  6 06:21:11 2009 GMT
 - Issuer: Certificate Authority, Develooper, Los Angeles, CA, US
 - Fingerprint: bb:ef:cd:ba:ea:d5:01:35:ee:ad:bd:94:64:f9:40:ab:ea:fa:65:d4
(R)eject, accept (t)emporarily or accept (p)ermanently? p
svn: PROPFIND request failed on '/modules/p5ee/trunk'
svn: PROPFIND of '/modules/p5ee/trunk': Server certificate verification failed: issuer is not trusted (https://svn.perl.org)

After checking out the software, install it into the target software area ($PREFIX).

cd $PREFIX/src/p5ee/App-Context
perl Makefile.PL PREFIX=$PREFIX
make
make install
cd $PREFIX/src/ota-tools/perl/XML-Toolset
perl Makefile.PL PREFIX=$PREFIX
make
make install
cd $PREFIX/src/ota-tools/perl/Business-Travel-OTA
perl Makefile.PL PREFIX=$PREFIX
make
make install

Your $PREFIX variable should always be set when you run the software, so you might want to set it in your .profile file.

[edit] Install from Published CPAN Distribution

An alternative to installing from the Subversion source code repository (currently not recommended) is to install from the distributions published on CPAN.

When we install App::Context, we have to have a $PREFIX variable defined which is the home directory of the software.

For this approach to installation, it is the directory in which your Perl is installed. If Perl is /usr/bin/perl, then PREFIX=/usr. If Perl is /usr/local/bin/perl, then PREFIX=/usr/local.

 > su -
 > export PREFIX=/usr

Then we install the Interoperability Test Suite and some of its immediate dependencies. (If the CPAN shell complains about other dependencies not yet being installed, please install them and retry. Then update this document.)

 > perl -MCPAN -e shell
 cpan> install App::Context
 cpan> install XML::Toolset
 cpan> install Business::Travel::OTA
 cpan> quit

[edit] Validate the Test Client Installation

Execute the test client by simply typing "otaclient".

otaclient

If you get this message,

> otaclient
None of the listed backends (Xerces, MSXML, LibXML, XMLDOM) are available

It means that XML::Xerces was not installed properly. Go back to that section and try to get that right.

If you get this message, then the client is installed properly, and it is waiting for you to configure tests.

WARNING: Couldn't find file [default.tests] in 'dirs' list:
   /usr/rubicon/spadkins/share/ota/tests
   /usr/rubicon/spadkins/share/ota/scenario
   /usr/rubicon/spadkins/share/ota/xml
========================================================================
Test Client:      Business::Travel::OTA Version 0.90
Test Date/Time:   2007-04-18 14:45:48 -0400
Server:           default
========================================================================
Totals:             0.0% Success (1 Failures on 1 Tests)
------------------------------------------------------------------------
Use Case:         100.0% Success (0 Failures on 0 Tests)
Scenario:         100.0% Success (0 Failures on 0 Tests)
Usage Profile:    100.0% Success (0 Failures on 0 Tests)
File:               0.0% Success (1 Failures on 1 Tests)
========================================================================
ERROR: Unknown error
       Text:
       File:
       Line:
========================================================================

[edit] Finalize the Test Server Installation

Your software installation process should have installed a program called "otaserver" to $PREFIX/cgi-bin/otaserver. In order to enable this server to respond to HTTP requests, you need to find where your Apache cgi-bin directory is and make a symbolic link to your cgi-bin directory. Suppose your Apache software is installed in /usr/local/apache and the cgi-bin directory is /usr/local/apache/cgi-bin.

From here on, for this documentation, suppose that your name is "joe" and your $PREFIX is /home/joe. (You should make adjustments to the configuration instructions depending on whether your name is not joe and your $PREFIX is not /home/joe.)

Then the following commands might do the job.

su
ln -s /home/joe/cgi-bin /usr/local/apache/cgi-bin/joe

You should be able to test this "otaserver" configuration by invoking the server through the http://localhost/cgi-bin/joe/otaserver URL. You can do this from a browser. Alternatively, if you have the command-line Perl web client ("GET") installed, you can test it this way.

# GET http://localhost/cgi-bin/spadkins/otaserver
<?xml version="1.0" encoding="UTF-8"?>
<OTA_PingRS
    xmlns="http://www.opentravel.org/OTA/2003/05"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 C:/OTA/2003B/20021031/OTA_PingRS.xsd"
    TimeStamp="2002-12-03T11:09:49-05:00"
    Target="Production"
    Version="1.0"
    SequenceNmbr="1" >
  <Success/>
  <EchoData>Hello</EchoData>
</OTA_PingRS>

The "otaserver" replied with an OTA_PingRS message. This verifies that your test server is minimally set up.

[edit] Configure the Tool

Edit the $PREFIX/etc/app/app.conf file and add the following sections.

[otaclient]
prefix           = /home/joe
server_url       = http://localhost/cgi-bin/joe/otaserver
transport_class  = Business::Travel::OTA::Transport::HTTP
conf_file        = ${prefix}/etc/app/ota.pl
verbose          = 0
[otaserver]
prefix           = /home/joe
transport_class  = Business::Travel::OTA::Transport::HTTP
conf_file        = ${prefix}/etc/app/ota.pl
verbose          = 0

Edit the $PREFIX/etc/app/ota.pl file and add the following text. This is actually a deeply nested perl data structure, but you can treat it like a configuration file.

  • It defines one RemoteServer named "test" which is also the "default".
  • The "test" RemoteServer uses the "http" transport protocol to exchange messages.
  • The "test" RemoteServer is located at the URL, "http://localhost/cgi-bin/joe/otaserver"
$conf = {
  RemoteServer => {
    default => {
      alias => "test",
    },
    test => {
      transport => "http",
      transport_values => {
        server_url => "http://localhost/cgi-bin/joe/otaserver",
      },
      partner => "general",
    },
  },
  Partner => {
    general => {
    },
  },
  Transport => {
    default => {
      class => "Business::Travel::OTA::Transport::HTTP",
    },
    http => {
      class => "Business::Travel::OTA::Transport::HTTP",
    },
    soap => {
      class => "Business::Travel::OTA::Transport::SOAP",
    },
    local => {
      class => "Business::Travel::OTA::Transport::Local",
    },
  },
};

[edit] Run the Tool

Personal tools