ports 7900 through 7999). If not specified, the test will
have ports 5000 to 5099 available to it.
- -r The "runall" flag. This is related to cleaning up after
- the tests (see "Maintenance Notes" below). If specified,
- it prevents a copy of the test's output listing from being
- deleted when the directory is cleaned up after the test
- completes. (The test's output listing comprises messages
- produced by the test during its execution; it does not
- include the output files produced by utilities such as
- "dig" or "rndc", nor any logging output from named itself.)
- It is usually only used when "run.sh" is being called
- during a run of the entire test suite. Note that if "-n"
- is specified on the "run.sh" command line, the test output
- is retained even if this option is omitted.
-
Arguments are:
test-name Mandatory. The name of the test, which is the name of the
Deletion of files produced by an individual test can be done with the command:
- sh clean.sh [-r] <test-name>
-
-The optional flag is:
-
- -r The "runall" flag. This is related to cleaning up after
- the tests (see "Maintenance Notes" below). If specified,
- it prevents a copy of the test's output listing from being
- deleted when the directory is cleaned after the test
- completes.
+ sh clean.sh <test-name>
Deletion of the files produced by the set of tests (e.g. after the execution
of "runall.sh") can be deleted by the command:
when "make check" is run, and contains a target for each test of the form:
<test-name>:
- @$(SHELL) run.sh -r -p <baseport> <test-name>
+ @$(SHELL) run.sh -p <baseport> <test-name>
The <baseport> is unique and the values of <baseport> for each test are
separated by at least 100 ports.
3. "test.output.*" files are deleted when the test suite ends. At this point,
the file "testsummary.sh" is called which concatenates all the "test.output.*"
files into a single "systests.output" file before deleting them.
-
-A complication arises with the "test.output" file however:
-
-1. "clean.sh" is called by "run.sh" if the test ends successfully. For
-this reason, "clean.sh" cannot delete "test.output" as, if the test is
-being run as part of a test suite, the file must be retained.
-
-2. If the deletion of "test.output" were to be solely the responsibility of
-"testsummary.sh", should a test suite terminate abnormally, cleaning up a test
-directory with "sh clean.sh <test-directory>" would leave the file present.
-
-3. An additional step could be added to "cleanall.sh" (which calls the
-system's "clean.sh" for each test) to remove the "test.output" file. However,
-although the file would be deleted should all test directories be cleaned,
-it would still mean that running "clean.sh" on a particular test directory
-could leave the file present.
-
-To get round this, the system's "clean.sh" script takes an optional flag, "-r"
-(the "runall" flag). When the test suite is run, each invocation of "run.sh"
-is passed the runall flag. In turn, "run.sh" passes the flag to "clean.sh",
-which causes that script not to delete the "tests.output" file. In other
-words, when the system's "clean.sh" is invoked standalone on a test directory
-(or as part of a run of "cleanall.sh"), it will delete the "test.output" if it
-is present. When invoked during a run of the entire test suite, it won't.
export SYSTEMTESTTOP
-# See if the "-r" flag is present. This will usually be set when all the tests
-# are run (e.g. from "runall.sh") and tells the script not to delete the
-# test.output file created by run.sh. This is because the script running all
-# the tests will call "testsummary.sh", which will concatenate all test output
-# files into a single systests.output.
-
-runall=0
-
-while getopts "r" flag; do
- case $flag in
- r) runall=1 ;;
- esac
-done
-shift `expr $OPTIND - 1`
-
if [ $# -eq 0 ]; then
- echo "usage: $0 [-r] test-directory" >&2
+ echo "usage: $0 test-directory" >&2
exit 1
fi
systest=$1
shift
-if [ $runall -eq 0 ]; then
- rm -f $systest/test.output
-fi
-
if [ -f $systest/clean.sh ]; then
( cd $systest && $SHELL clean.sh "$@" )
else