You must first define the Test Contract because the test harness will rely on it. This is absolutely essential. The Test Contract is the agreement between test input/output and the test harness. Test Automators must follow the rules. Perl is preferred for tests, but as long as the Test Contract's rules are followed, the programming language you use for tests is unimportant (although you should have a very good reason for your choice).
The harness will be designed to run from the command line and will eventually run from cron nightly and per checkin. All the forensic data produced by the run will be plain text, so it can be viewed and parsed at the command line with grep and viewed in a browser.
Here are the requirements for the test harness script:
- Take a software configuration file as an argument to specify the software versions for the test.
- Take a testbed configuration file as an argument specifying the testbed on which to execute the tests.
- Take a batch file listing the test scripts to be run as an argument, with timeouts for each.
- Create a unique run ID
- Create a unique directory named after the run ID to contain run logs.
- Reboot hosts, install the software, and configure the testbed before running batch of scripts.
- Create a detailed log file containing all test output.
- Copy the batch file and testbed configuration file to the run directory.
- Create a meta data file listing the software version, hosts, and log locations.
- Start memory measurements at the beginning of the run.
- Capture standard out and standard error from each test execution to the detailed log.
- Timestamp the start and end time of each test script in the detailed log.
- Timestamp the start and end time of the entire batch run.
- Cleanup the testbed between each test script.
- Check for configuration issues between each test script.
- Create a summary log detailing the start/end time, duration, exact command executed, and results for each test.
- Run a triage script at the end of the run to look for problems with the testbed (eg cores, configuration disruption, reboots, memory leaks, etc...).
- Email results to concerned parties.