 |
Home | Changes | Index | Search | Go
Project Wonderland Distributed Test Harness
The Wonderland 0.5 codebase includes a new test harness designed to allow large scale automated testing of Wonderland. This page gives a brief introductory overview of the harness, which is still under active development (so expect lots of changes/updates).
Single node testing
The harness in the test/harness directory.
The harness consists of a Master which manages any number of test Slaves, when a Slave is started it registers with the master over a well known socket specified in MasterInfo?.java. The Master maintains a set of TestDirectors? which direct a test session, the TestDirector? is responsible for sending messages to the Slaves requesting that they log into the Wonderland server, move their avatar etc.
Follow these steps to run the harness
- cd core
- ant run-sgs to start the wonderland server
- cd ../test/harness
- ant run-master to start the test harness master
- ant run-slave to start a slave
- ant run-manager to start the ui manager for the harness (currently assumes its on the same machine as the master).
The current (and only) test director SimpleTestDirector? simply logs each slave onto the server, so not too exciting
Multi-node testing (THIS IS NO LONGER AVAILABLE -- IT WAS TAKEN OUT OF THE DISTRIBUTION FOR LICENSING REASONS)
The JTR (Java Test Running) distributed testing harness has been integrated into the Wonderland test harness. The
JTR project home page can be found at: http://jtrunner.sourceforge.net/JTR/The%20JTR%20Project.html. Using the
test harness lets you set up a number of "passive" nodes that accept tests to run -- in our case, Wonderland clients.
The JTR software automatically streams the necessary JAR files to each passive node: setting up a passive node is
easy and only entails unpacking the JTR software.
Setting up and Running a Passive Node
Eeach passive node that acts as a "slave" that runs a Wonderland client and accepts commands from the test
director (see description above). Note that a passive node can run more than one Wonderland client -- in fact, only
a single node can run all of the Wonderland clients!
- Download the JTR software from: https://sourceforge.net/project/showfiles.php?group_id=125536?download.
- Unpack the software distribution on each passive node (or install on a mounted filesystem)
- Copy jtr-slave-dummy.jar from test/harness/build/current/debug/lib into the lib/ directory of your JTR installation.
- That's it! No configuration of the passive node is necessary
- To start the passive node: ant passiveNode in the directory in which you installed JTR
The passive nodes by default listens on port 2000 for connections from the active JTR node directing the tests. Modify
the ant script in build.xml if you would like to change this port.
Note: Copying jtr-slave-dummy.java only needs to be done. This jar does not contain the test client, that gets
streamed across from the JTR active node.
Configuring for a Distributed Test
All of the code and ant targets to run a distributed test using JTR are in the test/harness directory. You will launch
the tests via the active node, but first you must perform some configuration.
- In test/harness/config/jtr.xml for each of your passive nodes, add an entry between the tags.
- Configure the number of concurrent Wonderland clients you want in the <instance-count> tag.
- Set the hostname and port of the test director in the tag.
Running a Distributed Test
Once you have all of your passive nodes running, you can kick off your tests as follows:
- Follow the steps outlined in the "Single node testing" above, EXCEPT the "ant run-slave" step.
- Invoke the "ant run-jtr" target in the harness/test directory.
Some Notes
A few things I have noticed:
- JTR seems to use your active node also to launch Wonderland clients. So if you ask it to launch 4 clients and have only one passive node, it will actually launch 8 clients (4 on the active node, 4 on the passive node).
- This message in both the active and passive node logs seems harmless:
[java] Property-setting error. [java] Unable to set property hostname with value localhost over instance org.jdesktop.wonderland.testharness.slave.jtr.JTRSlaveRunner@ba5a81 due to the following cause (if available): [java] null
|