harness.seq(1)

SYNOPSIS
harness.seq [-config <configfile>] [-pause <seconds>] <testfile> ...

DESCRIPTION
harness.seq is a command line test harness for packet shell scripts. Its purpose is to provide a method for a developer to run a collection of tests by providing a list of packet shell test scripts as command-line arguments. Each test is executed in sequence based on the order in which they are passed on the command line. If the -pause <seconds> option is used, the harness.seq pauses for the specified number of seconds between each test. The harness.seq prints the status of each test to stdout as each is being run.

When harness.seq is invoked, it sources the contents of files with .act, .flt, and .fcn suffixes (actions, filters, and utility functions). Next, it reads the contents of configfile if the -config option was used. The purpose and syntax of the configfile is described in the CONFIGURATION FILE section.

CONFIGURATION FILE
A configuration file contains a series of lines, with one configuration variable declared on that line. The line begins with the name of the configuration parameter. Any combination of blanks or tabs separate the parameter name from the value. The value must not contain white spaces and is terminated by white space or an end-of-line. Any subsequent text is ignored.

Each of these configuration variables is available in the global tcl array named configTable. The index into the array is the name of the variable.

WRITING TESTS FOR HARNESS AND HARNESS.SEQ
Any packet shell test can easily be used with the harness if the test is constructed to meet several requirements.

All code must be declared inside Tcl procedures.

All scripts must have a t_info procedure. It must return a short string describing the test.

All tests must have a t_req procedure which checks that all requirements for running this test have been satisfied. Normally this means checking that all configuration variables are set in configTable. Returning non-zero implies configuration is correct.

All tests must have a t_run procedure. This procedure must run the actual test. It must return an empty string if the test passes, otherwise it must return a string.

All tests must define a procedure t_cleanup which guarantees that all variables and connections which might interfere with subsequent tests is destroyed.

CHECKING CONFIGURATION
Below is a piece of sample code which demonstrates how to correctly test for a configuration variable in a t_req.
	proc t_req {
		global configTable
		foreach {i} {H1IP H2IP} {
			if {[array names configTable $i] == ""} {
				return 0
			}
		}
		return 1
	}

SEE ALSO
harness(1), psh(1), tcl(1), tk(3).