Overview of the VxWorks System Testing Agent Specifics

__________

Target   :    Tornado/VxWorks

Compiler :    C/C++ Compiler

 

Building the Agent

A Makefile is provided in '<RationalTestRealTimeInstallDir>/targets/stAgent/VxWorks'. This Makefile may need some settings. The macro 'AGT_CUSTOM' must be defined when compiling source code for the Agent. This means that the compiler option '-DAGT_CUSTOM' must exist. 

Refer to the Test RealTime User Guide to compile and link an application. As with the Makefile, the macro 'AGT_CUSTOM' must be defined when compiling source code for the Agent. This means that the compiler option '-DAGT_CUSTOM' must exist. 

The '<RationalTestRealTimeInstallDir>/targets/stAgent/VxWorks' sub-folder contains the configuration files for the Agent. These files are 'agtconf.c' and 'agtconf.h' and can be modified for specific options.

 

Executing

Use System Testing with VxWorks in a multi-threaded environment. In the System Testing Test Compiler settings of a System Testing node, use the 'Heap' Virtual Tester Memory Allocation Method, enable the generation of a Virtual Tester as a Thread, choose 'Tmain' for example as an Entry function name, and Do not share user-defined Virtual Tester static global variables.

You must declare to the Agent all functions (entry points) that you wish to use during the execution of one or several virtual testers. These declarations are made in a function table called 'AgtTasks' declared in the file glob.h file located in '<RationalTestRealTimeInstallDir>/targets/stAgent/VxWorks'. If needed create a new file following this example: 

Example

  #include "glob.h"

  void myFunc1() { printf("Hello World!\n"); }
  extern void myFunc2(int param1, char param2);

  void initGen(AGT_ENTRY_POINT virtualTesterMain)
  {
        strcpy(AgtTasks[0].f_name,"Tmain");
        AgtTasks[0].f_pointer=virtualTesterMain;
        strcpy(AgtTasks[1].f_name,"myFunc1");
        AgtTasks[1].f_pointer=myFunc1;
        strcpy(AgtTasks[2].f_name,"myFunc2");
        AgtTasks[2].f_pointer=myFunc2;
  }

The function 'initGen()' is used to load the required entry points in the function table 'AgtTasks' and should be called within the vxWorks environment before executing a Supervisor script. If you want to add a function of a module to be loaded on the target, you must write the prototype of this function (preceeded by 'extern') and follow the example. Note that at least one field of the 'AgtTasks' array must contain the virtual tester(s) entry point. This function 'initGen()' is an example, you can use any user-made function as long as the 'AgtTasks' array is filled.

For a System Testing entry point, two mandatory parameters have to be added. A name for the result file (-RIO=<rio_name>.rio) and a selected instance (-INSTANCE=<instance_name>). By default, the tasks are launched with priority 100, options 0 and stack size 16000. You can change these values by specifying '-PRIORITY=x', '-OPTIONS=y' or '-STACKSIZE=z'.

Example

  EXECUTE target : myFunc1 100 0 64000  
  EXECUTE target : Tmain -RIO=/workDir/script_A.rio -INSTANCE=A
  EXECUTE target : Tmain -RIO=/workDir/script_B.rio -INSTANCE=B

First, load the System Testing Agent, the virtual testers and any modules you need on the target. Then, fill the 'AgtTasks' array as described above. The instruction would be 'initGen(Tmain)' in our example. Finally, you must spawn the Agent task using the instruction 'sp(atsagtd, xxx)' where 'xxx' is the port number to connect with the Agent (e.g. 10000).

 

Known restrictions

You have to use instances within a test script. Every test script must contain the instructions 'DECLARE_INSTANCE <instance_name>' and 'INSTANCE <instance_name>:'/'END INSTANCE' even if you have only one System Testing simulator.

When launching a System Testing simulator in a supervision script, a .rio file name must be specified. Depending on the VxWorks kernel built, this .rio file name sometimes need to contain an absolute path to your working directory and this file should already exist. If not, create an empty file.