Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

How to "Smoke Test" the new technology agent controller

Download the agntctrl and sdk packages for each given system, create subdirectories for holding the release packages, and unzip them there.

There is some debate about whether to overlay the runtime and sdk packages or keep them separate. My fear with overlaying is that you're likely to miss any error in either package if it is masked by the other. Therefore, I put the agntctrl package in <ac> and the sdk package in <sdk>.


Set up environment variables.

  1. cd <ac>/lib; export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
  2. cd <ac>/bin; export PATH=`pwd`:$PATH
  3. export PATH=<path to the correct Java bin>:$PATH

Note that "the correct Java" is something to think carefully about! It's an important factor to document to ensure thorough testing.

Note that if you're running 32-bit apps on a 64-bit system, you're in for a rough ride separating out the two environments!


Set up your <ac>/config/serviceconfig.xml file

It's empty on delivery, so configure by running ./SetConfig.sh (you are still in the <ac>/bin directory, right?). You can accept defaults for all values (unless you know you want to test security, or remotely from another system, etc.).


Edit the <ac>/agents/*/agent.xml files.

Remove all ".\" prefixes and ".exe" suffixes from all launchinfo lines.


Make sure an AC is not running already:

  1. ps aex | grep -i server
  2. ls -last /tmp/IBMRAC (clean it out if stuff is there)
  3. ipcs (to see if there are unattached shmids! if so, su to root and ipcrm the shmids)


Start the agent controller.

It's important to use the ACStart.sh script now.


Check the AC for minimal functionality: run "./SampleClient"

Here's a sample output... YMMV [in what ways can it vary and still be considered successful?]:

Connected to the Agent Controller on "localhost" at port number 10006

The Time Collector Agent ID: 103

Established a data channel with the agent.

Sending 5 Hello messages over data channel to TimeCollector ...

Start the TimeCollector ...


Stop the TimeCollector ...

Incoming data: Hello from Time Collector Agent - Count 0

Incoming data: Hello from Time Collector Agent - Count 1

Incoming data: Hello from Time Collector Agent - Count 2

Incoming data: Hello from Time Collector Agent - Count 3

Incoming data: Hello from Time Collector Agent - Count 4

Incoming data: Hello from Time Collector Agent - Count 5

Incoming data: Hello from Time Collector Agent - Count 6

Incoming data: Hello from Time Collector Agent - Count 7

Incoming data: Hello from Time Collector Agent - Count 8

Incoming data: Hello from Time Collector Agent - Count 9

All finished
Press any key to exit...

Now we're ready to actually use the SDK package to do the three C++ smoke tests.

For each of the sample test directories ConsoleTestClient (and its helper directory SimpleAppl), SampleClient (and its helper directory TimeCollector), and MyFileTransferClient,

  1. cd <to the directory>
  2. make -f *.make
  3. Run each.

(I'm assuming that the samples under the Compatibility directory are not a part of the smoke testing!)

Note that they're copied into the <sdk>/bin directory upon successful compilation.

Also note that if the <sdk> and the <ac> are different directories, and you started the AC without having <sdk>/bin on the PATH, you'll need to copy (at least) the SimpleAppl executable over to <ac>/bin before running the ConsoleTestClient. This is because "./" is interpreted in the ac.launch("./SimpleAppl") statement as relative to the AC launch, not the ConsoleTestClient itself.

Also note that unless you explicitly execute the SampleClient you compiled and explicitly make sure the TimeCollector the AC sees is the one you compiled (by replacing the one in <ac>/bin with the one you compiled), you're not really testing your ability to build and run the SDK code.

Finally note that you will need to have a file called "/tmp/big_simple.txt" pre-existent before running the MyFileTransferClient test; subsequent to execution you should find that "/tmp/big_local.txt" is identical to the original file.

Here's some sample output from a ConsoleTestClient run:

Connected to the Agent Controller on "localhost" at port number 10006

Preparing to launch app:"./SimpleAppl"
Incoming data: SimpleWAait fpoprl  fhians starteid.
Expect 3 msgs from stdout, 1 msg from stderr, and 1 msg echoed back from stdin.


sIncoming data: SimpleApp stdohued messatg messe, thean Prgee 0.s
SimpleApp stdout message 1.
SimpleApp stdout message 2.


Incoming data: SimpleApp reading from stdin...


Incoming data: SimpleApp stderr message.


Incoming data: SimpleApp read stdin: This is console input to SimpleAppl.


s any key to exit...
Incoming data: SimpleAppl is finished.

Due to the intermixing of outputs from the test itself and the executable it spawns, you can see a wide variety in test outputs.


Having completed the C++ side of the tests, we turn our attention to the Java side.

  1. For Java, we need the "execution framework", which is included as a part of the standard TPTP runtime. Thus we download a TPTP runtime package, and extract out just the org.eclipse.tptp.platform.execution files from the downloaded zip file (that is the beginning of the name... there will probably be version info appended).
  2. cd <to the location of the downloaded files>/src
  3. javac -classpath ../tptpcore.jar org/eclipse/tptp/platform/execution/samples/SampleClient.java
  4. java -classpath ../tptpcore.jar org/eclipse/tptp/platform/execution/samples/SampleClient

Output should look something like:

Connecting to Host localhost
Connecting to AC..
Connected to localhost at port number 10006






The Data received from TimeCollector - Hello from Time Collector Agent - Count 0
The Data received from TimeCollector - Hello from Time Collector Agent - Count 1
The Data received from TimeCollector - Hello from Time Collector Agent - Count 2
The Data received from TimeCollector - Hello from Time Collector Agent - Count 3
The Data received from TimeCollector - Hello from Time Collector Agent - Count 4
The Data received from TimeCollector - Hello from Time Collector Agent - Count 5
The Data received from TimeCollector - Hello from Time Collector Agent - Count 6
The Data received from TimeCollector - Hello from Time Collector Agent - Count 7
The Data received from TimeCollector - Hello from Time Collector Agent - Count 8
The Data received from TimeCollector - Hello from Time Collector Agent - Count 9
The Data received from TimeCollector - Hello from Time Collector Agent - Count 10
The Data received from TimeCollector - Hello from Time Collector Agent - Count 11
The Data received from TimeCollector - Hello from Time Collector Agent - Count 12
The Data received from TimeCollector - Hello from Time Collector Agent - Count 13
The Data received from TimeCollector - Hello from Time Collector Agent - Count 14
The Data received from TimeCollector - Hello from Time Collector Agent - Count 15
The Data received from TimeCollector - Hello from Time Collector Agent - Count 16
The Data received from TimeCollector - Hello from Time Collector Agent - Count 17
Data Processor Waiting for Data Called



Now follow the above steps for TPTPProcess.java as well.

Before following the above steps for the SampleFileTransferAC.java test, you'll need to "condition" the test as follows for Linux smoke testing:

  • Change all "C:" to "/tmp"
  • Change all "\\" to "/"

You'll also need to make sure you have all "the right files" in place prior to running the test. That includes

  • /tmp/big_simple.txt -- ASCII file exact multiple of 512 bytes
  • /tmp/temp/test.zip -- binary file; I use a zip file
  • /tmp/small.txt -- ASCII file less than a block in size
  • /tmp/empty.foo -- an empty file
  • Optionally, you can hava a /tmp/temp/test2.zip file
    1. With it there, you're testing deleteFile of a file
    2. With it not there, you're testing the case of trying to delete a missing file (also a valid test case!)

When the test is completed, make sure that in /tmp:

  • big_simple.txt, big_dupe1.txt, and big_dupe2.txt are all identical files
  • temp/test.zip is identical to put_dupe3.zip
  • <TT>small.txt and put_dupe4.txt are identical
  • put_dupe5.foo is empty
  • there is no temp/test2.zip file

Note that the SempleFileTransferAC test loops forever after it does its thing; you'll have to Control-C out of it after the deleteFile is done.


Clean up.

Shut down the agent controller by running "./ACStop.sh".

If you want to make sure shared memory is cleaned up, you might find this useful: for i in `ipcs -m | cut -f 2 -d" "`; do ipcrm shm $i; done


Check in your results.

Back to the top