TE Config Files Basics
Running RCF
Remote Control Facility (RCF) configuration file specifies the list of Test Agents to run with a a set of parameters associated with them. For the detailed information on how to write Remote Control Facility (RCF) configuration file please refer to RCF Configuration File section.
More likely you will already have some Remote Control Facility (RCF) configuration file or you will need to do your own version of configuration file based on existing one.
First thing that you need to take into account while writing Remote Control Facility (RCF) configuration file is the how and where you are going to organize testing process.
Suppose you need to test some communication API between two end-points (for example it could be Socket API) and you have the following network topology:
You would like to test communication between end point pairs:
BSD and Windows;
BSD and Linux;
Windows and Linux.
The API to be tested is the same on all platforms, which means we can use the same test suite for each pair. The only thing specific for our test set-up is where to run Test Agent that supports interface to be tested (assume we exported interface to be tested via TAPI: Remote Procedure Calls (RPC)).
For testing BSD vs Windows configuration we should use the following set-up:
In this scenario Remote Control Facility (RCF) configuration file would look like:
<?xml version="1.0"?> <rcf> <ta name="Agt_A" type="bsd" rcflib="rcfunix"> <conf name="host">gollum</conf> <conf name="port">5000</conf> <conf name="sudo"/> </ta> <ta name="Agt_B" type="win" rcflib="rcfunix"> <conf name="host">aule</conf> <conf name="port">5000</conf> <conf name="sudo"/> </ta> </rcf>
Please note that we use the same RCF UNIX Communication Library, but different Test Agent types.
For testing BSD vs Linux configuration we should use the following set-up:
In this scenario Remote Control Facility (RCF) configuration file would look like:
<?xml version="1.0"?> <rcf> <ta name="Agt_A" type="bsd" rcflib="rcfunix"> <conf name="host">gollum</conf> <conf name="port">5000</conf> <conf name="sudo"/> </ta> <ta name="Agt_B" type="linux" rcflib="rcfunix"> <conf name="port">5000</conf> <conf name="sudo"/> </ta> </rcf>
Note that we can avoid specifying host name for Test Agent Agt_B, because it runs on the same host as Test Engine.
Similar set-up would be for testing Windows vs Linux set-up.
Now we have Remote Control Facility (RCF) configuration files ready and we can run TE with Remote Control Facility (RCF).
Our project tree has the following structure:
${PRJ_ROOT}
+-- conf_ipv6
+-- builder.conf.ipv6_demo
+-- rcf.conf.bsd_win
+-- rcf.conf.bsd_linux
+-- rcf.conf.linux_win
To start TE with Remote Control Facility (RCF), but still without Configurator and Tester, run:
${TE_BASE}/dispatcher.sh --conf-dir=conf_ipv6 --conf-builder=builder.conf.ipv6_demo --conf-rcf=rcf.conf.bsd_win --no-cs --no-tester
If you have some problems with copying Test Agent images to set-up hosts or if you have problems with connection to these Agents you should first check that you are able to enter these hosts without password prompt (read RCF UNIX Communication Library for more information).
Anyway when dispatcher.sh script finishes you can check results in text log file build/log.txt.
Running Logger
Logger configuration file depends on Remote Control Facility (RCF) configuration file in case we need to specify log polling intervals on per Test Agent basis, but in most cases logger configuration file specifies common polling interval to use for accessing all Test Agents.
For more information on Logger configuration file read Configuration File.
More often Logger configuration file is the same for different test set-ups, so preferably if its name is logger.conf, because Dispatcher uses this file name as the default Logger configuration file.
Running Configurator
To run Configurator you need to prepare a configuration file whose name is passed to dispatcher.sh script. For the details on Configurator configuration file read Configurator Configuration File section.
Assuming our Configurator configuration file is split into two parts we would have the following directory tree structure:
${PRJ_ROOT}
+-- conf_ipv6
+-- builder.conf.ipv6_demo
+-- rcf.conf.bsd_win
+-- rcf.conf.bsd_linux
+-- rcf.conf.linux_win
+-- logger.conf
+-- cs.conf.common
+-- cs.conf.bsd_win
+-- cs.conf.bsd_linux
+-- cs.conf.linux_win
Where cs.conf.bsd_win file can look as following:
<?xml version="1.0"?>
<history>
<xi:include href="cs.conf.common" parse="xml"
xmlns:xi="http://www.w3.org/2003/XInclude"/>
<!-- BSD vs Win specific objects and instances descriptions -->
To start TE with Remote Control Facility (RCF), Configurator, but without Tester, run:
${TE_BASE}/dispatcher.sh --conf-dir=conf_ipv6 --conf-builder=builder.conf.ipv6_demo --conf-rcf=rcf.conf.bsd_win --conf-cs=cs.conf.bsd_win --no-tester
Running Tester
Running Tester requires some test suite to be availabe.
For more information on Tester configuration file read Tester Root Configuration File section.
For information on how to create a test suite read Test Suite page.
Suppose you have the following test project directory structure:
${PRJ_ROOT}
+-- conf_ipv6
| +-- builder.conf.ipv6_demo
| +-- rcf.conf.bsd_win
| +-- rcf.conf.bsd_linux
| +-- rcf.conf.linux_win
| +-- logger.conf
| +-- cs.conf.common
| +-- cs.conf.bsd_win
| +-- cs.conf.bsd_linux
| +-- cs.conf.linux_win
| +-- tester.conf
+-- suite-src
+-- configure.ac
+-- Makefile.am
+-- package.xml
+-- prologue.c
+-- test1.c
+-- test2.c
+-- pkg1
| +-- package.xml
| +-- test3.c
| +-- test4.c
+-- pkg2
+-- package.xml
+-- test5.c
+-- test6.c
The content of ${PRJ_ROOT}/conf_ipv6/tester.conf is:
<?xml version="1.0"?> <tester_cfg version="1.0"> <maintainer mailto="te-maint@oktetlabs.ru"/> <description>Minimal test suite</description> <suite name="test-suite" src="${PRJ_ROOT}/suite-src"/> <run> <package name="test-suite"/> </run> </tester_cfg>
Before we run TE with Tester we need to make sure test suite tree has configure script in the top level directory and Makefile.in files in all subdirectories. These files can be generated with autoreconf utility run in test suite top level directory.
If we need to (re-)build test suite sources at Tester start-up we should run Dispatcher as:
${TE_BASE}/dispatcher.sh --conf-dir=conf_ipv6 --conf-builder=builder.conf.ipv6_demo --conf-rcf=rcf.conf.bsd_win --conf-cs=cs.conf.bsd_win --tester-conf=tester.conf
This command will build TE, build test suites specified in tester.conf file and run all tests according to Tester configuration file and test package description files.
If you need to run the particular test from a test suite (say test6) you can run:
${TE_BASE}/dispatcher.sh --conf-dir=conf_ipv6 --conf-builder=builder.conf.ipv6_demo --conf-rcf=rcf.conf.bsd_win --conf-cs=cs.conf.bsd_win --no-builder --tester-no-build --tester-run=test-suite/pkg2/test6
Please note that we do not specify Tester configuration file, because Dispatcher uses tester.conf as the default name of Tester configuration file.
Also note that we ask Dispatcher to skip building TE (no-builder option) and skip building test suite (assuming we already built it, it is possible to specify tester-no-build option).
For more information on Dispatcher options related to Tester please read Dispatcher Command Line Options.
Logging results
During TE run time a number of log messages generated from different components of TE. All messages are gathered by Logger and put into a binary file that by default has tmp_raw_log name and put under a directory where dispatcher.sh run.
You can specify the location and name of binary raw log file exporting TE_LOG_RAW environment variable:
TE_LOG_RAW=/tmp/my_raw_log ${TE_BASE}/dispatcher.sh --conf-dir=conf
Alternatively you may put raw log file under a particular directory, then you should specify log-dir option:
${TE_BASE}/dispatcher.sh --conf-dir=conf --log-dir=log
In this case raw log file will be saved to ${PRJ_ROOT}/log/tmp_raw_log file.
By default Dispatcher will generate log report in plain text format (with the help of RGT tool). By default plain text log is put under run directory with name log.txt.
If you want HTML-based multi-page structured log you should pass log-html option to Dispatcher specifying directory name where to output log in HTML format:
${TE_BASE}/dispatcher.sh --conf-dir=conf --log-html=html-out
As the result HTML based log report can be found under ${PRJ_ROOT}/html-out directory (open index.html file in a browser).
For more information on log related options of Dispatcher read Dispatcher Command Line Options section.