                     OpenSAF Test Infrastructure README
                     ==================================

TABLE OF CONTENTS
=================
1. INTRODUCTION
2. PRE-REQUISITES
3. CONFIGURATION
4. BUILDING of TEST INFRASTRUCTURE
5. RUNNING THE TESTs
6. TEST RESULTs

1. INTRODUCTION
---------------

This document provides an overview of the OpenSAF test infrastructure. The OpenSAF test infrastructure is implemented using the open source TETware 3.7 tool. Detailed information on TETware can be obtained from the TETware web site, http://tetworks.opengroup.org.  Test suites are available for single node API and functionality tests of the following services supported by OpenSAF: cpsv, edsv, mqsv, glsv, ifsv, srmsv, mds, mbcsv, and avsv.  The OpenSAF test infrastructure is 32-bit and 64-bit compatible and run on

   (1) OpenSAF running as 32-bit on 32-bit/64-bit machines and,
   (2) OpenSAF running as 64-bit on 64-bit machines.


2. PREREQUISITES
-----------------
(1) Download the gzipped open source TETware 3.7 tar file from http://tetworks.opengroup.org and un-tar it:

      # mkdir ${TETWARE_SRC}
      # cd ${TETWARE_SRC}
      # tar -zxvf ${DOWNLD_PATH}/tet3.7a-unsup.src.tar.gz

(2) Build TETware for the target system.  This might involve cross compilation if the target system has a different architecture from the build machine.

      # cd ${TETWARE_SRC}
      # sh configure -t inet
      # cd src
      # gmake clean
      # gmake 
      # gmake install

     If the tests are to be run on a different system, create a tar file of the bin and lib directories, then copy it over to the target system:

      # tar -cf mytetware.tar bin lib

(3) OpenSAF release 1.2.2 or above.

(4) OpenSAF system controller or payload libraries on 32-bit or 64-bit target machines.  The OpenSAF libraries are built in the ${OPENSAF_SRC}/targets/${TARGET_ARCH}/{lib,lib64} directory.  The libraries may be installed in /opt/opensaf/{controller,payload}/{lib/lib64}; see ${OPENSAF_SRC}/INSTALL. 


3. BUILDING THE TEST INFRASTRUCTURE
-----------------------------------


4. CONFIGURATION
----------------

Sets up the environment for running the OpenSAF tests.  It requires root privilege. You only need to run the process once after the installation of TETware is complete.

Execute the following steps:

# ${TET_BASE_DIR}/setup_tet_env.sh ${TET_ROOT}

TET_ROOT -- Path where TETware is installed.


5. RUNNING THE TESTs
--------------------

The OpenSAF system controller or payload node for 32-bit or 64-bit should be up and running before you run the test suites.   

(1) Log in as root to the system controller or payload node.

(2) If you wish to use values other than the defaults for the variables listed below, modify a copy of opensaf_tet_env.sh. If you wish to use another file, supply the name of the file as an argument to the run_opensaf_tests.sh command in the next step.

a) OPENSAF_ROOT -- Installation path of OpenSAF. Default value is /opt/opensaf.
b) OPENSAF_CONF -- Configuration file path of OPENSAF. Default value is /etc/opt/opensaf.
c) OPENSAF_VAR -- Log file path of OpenSAF. Default value is /var/opt/opensaf.
d) OPENSAF_TET_RESULT -- Path for saving test results. Default value is ${PWD}/result.
e) OPENSAF_TET_LOG -- Path for TETware saving log imformation. Default value is /tmp/tccdlog.
g) TET_BASE_DIR --  Path where OpenSAF tests installed. Default value is ${PWD} 

For detailed information, refer to opensaf_test_env.sh.

(3) Copy the executable file or shell script to suites directory. Modify the template files in the suites directory, which are discribed later.

(4) Execute the following steps for testing all the services: 

# ${TET_BASE_DIR}/run_opensaf_test.sh/run_opensaf_test.sh \
    [ -a service_name ] \
    [ -d ] \
    [ -e filename ] \
    [ -p platform] \
    service_name

Definitions of the Parameters:

(I) -a service_name  (OP)

Add a new test. Create a directory named "service_name". Create src, inc, and suites directories and makefile.am files in "service_name" directory. And create four template files in the suites directory: reg_xxx.scen, reg_xxx.cfg, reg_xxx.dep and xxx_env.sh. xxx represents the service name.

Tree structure of files:
    - service_name
     |- src
     |- inc
     |- suites
       |- reg_xxx.scen
       |- reg_xxx.cfg
       |- reg_xxx.dep
       |- xxx_env.sh 
     |- makefile.am
  
a) src -- Store the source files of the new test.

b) inc -- Store the header files of the new test.

c) suites -- Store the files required for running the test.

d) makefile.am -- Generate Makefile

e) reg_xxx.scen -- Template scenario file required by TETware. Detailed information about reg_xxx.scen can be obtained from "TETware user guide". 

   Default content:

       all
            :parallel:
            reg_xxx.exe
            :endparallel:

f) reg_xxx.cfg -- Template configuration file required by TETware. Detailed information about reg_xxx.cfg can be obtained from "TETware user guide". 
   
   Default content:

       TET_OUTPUT_CAPTURE=false
       TET_EXEC_IN_PLACE=false
       TET_API_COMPLIANT=true

g) reg_xxx.dep -- Indicate the test on which the current test depends. The current test name and its dependent test names are separated by a colon. If current test has more than one dependent test, the dependent tests are separated by a space.

   For example:  cur_test:test1 test2

h) xxx_env.sh -- Export the environment variables required for running the test.


(II) -d service_name  (OP)

Run the test name as "service_name" and other tests on which it depends according to the settings in reg_<service_name>.cfg. If the file reg_<service_name>.cfg does not exist, the execution stops.

  
(III) -e filename  (OP)
    
Set the environment variables required for running the test. 


(IV) -p platform  (OP)

Set the platform type. The available platforms are: linux, linux64, and solaris. Default value is linux.


(V) service_name  (MP)
    
Test name or "all". All means to run all the tests in the ${TET_BASE_DIR} directory.


6. TEST RESULTs
---------------

Test results are saved in ${OPENSAF_TET_RESULT} directory, which contains three files: xxx.jrnl, xxx.html, xxx.log. xxx represents the test module name.    

a) xxx.jrnl -- Test results generated by TETware.

b) xxx.html -- Statistic imformation obtained from xxx.jrnl. This file is in html format.

c) xxx.log -- Log information that is extracted form the file ${OPENSAF_TET_LOG} generated by TETware.
