Optional flags are:
- -p <number> Sets the range of ports used by the test. A block of 10
+ -p <number> Sets the range of ports used by the test. A block of 100
ports is available for each test, the number given to the
"-p" switch being the number of the start of that block
(e.g. "-p 7900" will mean that the test is able to use
- ports 7900 through 7909). If not specified, the test will
- use ports 5300 to 5309.
+ ports 7900 through 7999). If not specified, the test will
+ have ports 5000 to 5099 available to it.
+
-n Noclean - do not remove the output files if the test
completes successfully. By default, files created by the
test are deleted if it passes; they are not deleted if the
test fails.
+
-k Keep servers running after the test completes. Each test
usually starts a number of nameservers, either instances
of the "named" being tested, or custom servers (written in
at the end of the test, so that additional queries can be
sent by hand. To stop the servers afterwards, use the
command "sh stop.sh <test-name>".
+
-d <arg> Arguments to the "date" command used to produce the
start and end time of the tests. For example, the
switch
When running all the tests, the output is sent to the file systests.output
(in the bin/tests/system) directory.
-The "numproc" option specifies the maximum number of tests that can run
-simultaneously. The default is 1, which means that all of the tests run
-sequentially. If greater than 1, up to "numproc" tests will run simultaneously.
-(Each will use a unique set of ports, so there is no danger of them interfering
-with one another.)
+The "numproc" option specifies the maximum number of tests that can run in
+parallel. The default is 1, which means that all of the tests run
+sequentially. If greater than 1, up to "numproc" tests will run simultaneously,
+new tests being started as tests finish. Each test will get a unique set of
+ports, so there is no danger of tests interfering with one another.
+
+It is also possible to run the test suites from two installations of BIND on
+the same machine at the same time. To to this:
+
+1. Each installation must have its own directory tree. The system tests create
+temporary configuration files in the test directories, so separate directory
+trees are required to avoid interference between the same test running in the
+different installations.
+
+2. For one of the test suites, the starting port number must be specified by
+setting the environment variable STARTPORT before starting the test suite.
+Each test suite comprises about 100 tests, each being allocated a set of 100
+ports. The port ranges are allocated in sequence, so each test suite requires
+about 10,000 ports to itself. By default, the port allocation starts at 5,000.
+So the following set of commands:
+
+ cd <installation-1>/bin/tests/system
+ sh run.sh 4
+ cd <installation-2>/bin/tests/system
+ STARTPORT=20000 sh run.sh 4
+
+... will start the test suite for installation-1 using the default base port
+of 5,000, so the test suite will use ports 5,000 through 15,000 (or there
+abouts). The use of "STARTPORT=20000" to prefix the run of the test suite for
+installation-2 will mean the test suite uses ports 20,000 through 30,000 or so.
Parallel running will reduce the total time taken to run the BIND system tests,
but will mean that the output from all the tests will be mixed up with one
* If there is some other problem (e.g. prerequistie software is available
but is not properly configured), a status code of 255 should be returned.
-prereq.sh will be invoked using the '-p <baseport> -- "$@"' form described in
-the previous section.
-
-
setup.sh
---
This is responsible for setting up the configuration files used in the test.
---
The inverse of "setup.sh", this is invoked by the framework to clean up the
test directory. It should delete all files that have been created by the test
-during its run (including the "named.port" files mentioned earlier).
+during its run.
Adding a Test to the System Test Suite
@$(SHELL) run.sh -p <baseport> <test-name>
The <baseport> is unique and the values of <baseport> for each test are
-separated by at least 10 ports.
+separated by at least 100 ports.
Valgrind
*) exit 1 ;;
esac
done
-shift $(($OPTIND - 1))
+shift `expr $OPTIND - 1`
OPTIND=1
test $# -gt 0 || { echo "usage: $0 [-k|-n|-p <PORT>] test-directory" >&2; exit 1; }
test -d $test || { echofail "$0: $test: no such test" >&2; exit 1; }
-# Define the number of ports allocated for this test, and the lowest and
-# highest valid values for the "-p" option. The lowest valid value is one more
-# than the highest privileged port (1024). As the number specifies the lowest
-# port number in a block of ports, the highest valid value is such that the
-# highest port number in that block is 65535.
+# Define the number of ports allocated for each test, and the lowest and
+# highest valid values for the "-p" option.
#
-# N.B. It is assumed that the number of ports is >= 10.
-numport=10
+# The lowest valid value is one more than the highest privileged port number
+# (1024).
+#
+# The highest valid value is calculated by noting that the value passed on the
+# command line is the lowest port number in a block of "numports" consecutive
+# ports and that the highest valid port number is 65,535.
+numport=100
minvalid=`expr 1024 + 1`
maxvalid=`expr 65535 - $numport + 1`
echofail "Must specify a numeric value for the port"
exit 1
elif [ $baseport -lt $minvalid -o $baseport -gt $maxvalid ]; then
- echofail "The port must be in the range $minvalid to $maxvalid" >&2
+ echofail "Tte specified port must be in the range $minvalid to $maxvalid" >&2
exit 1
fi
-# Name the first 10 ports in the set: the query port, the control port and
-# eight extra ports. Since the lowest numbered port (specified in the command
-# line) will usually be a multiple of 10, the names are chosen so that the
-# number of EXTRAPORTn is "n".
+# Name the first 10 ports in the set (it is assumed that each test has access
+# to ten or more ports): the query port, the control port and eight extra
+# ports. Since the lowest numbered port (specified in the command line)
+# will usually be a multiple of 10, the names are chosen so that if this is
+# true, the last digit of EXTRAPORTn is "n".
export PORT=$baseport
export EXTRAPORT1=`expr $baseport + 1`
export EXTRAPORT2=`expr $baseport + 2`