===
The tests can be run individually using the following command:
- sh run.sh [flags] <test-name>
+ sh run.sh [flags] <test-name> [<test-arguments>]
e.g.
Optional flags are:
- -p <number> Sets the range of ports used by the test. If not
- specified, the test will use ports 5300 to 5309.
+ -p <number> Sets the range of ports used by the test. A block of 10
+ 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.
-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
Python or Perl) that feature test-specific behavior. The
servers are automatically started before the test is run
and stopped after it ends. This flag leaves them running
- at the end of the test.
+ 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
-d "+%Y-%m-%d:%h:%M:%s"
- would cause the "S" and "E" messages (see below) to have the
- date looking like "2017-11-23:16:06:32" instead of the
+ would cause the "S" and "E" messages (see below) to have
+ the date looking like "2017-11-23:16:06:32" instead of the
default "Thu, 23 Nov 2017 16:06:32 +0000".
+Arguments are:
+
+ test-name Mandatory. The name of the test, which is the name of the
+ subdirectory in bin/tests/system holding the test files.
+
+ test-arguments Optional arguments that are passed to each of the test's
+ scripts.
+
To run all the system tests, type either:
sh runall.sh [numproc]
(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 the test 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.)
Deletion of files produced by an individual test can be done with the
command:
- (cd testname ; sh clean.sh)
+ 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:
Port Usage
---
In order for the tests to run in parallel, each test requires a unique set of
-ports. These are specified by the "-p" option passed to "run.sh". This option
-is then passed to each of the test control scripts listed above.
+ports. These are specified by the "-p" option passed to "run.sh", which sets
+environment variables that the scripts listed above can reference.
The convention used in the system tests is that the number passed is the start
of a range of 10 ports. The test is free to use the ports as required,
although present usage is that the lowest port is used as the query port and
-the highest is used as the control port. This is reinforced by the script
-getopts.sh: if used to parse the "-p" option (see below), the script sets the
-following shell variables:
+the highest is used as the control port. This is reinforced by the environment
+variables set by run.sh. These are:
+
+ PORT Number to be used for the query port.
+ CONTROLPORT Number to be used as the RNDC control port.
+ EXTRAPORT1 - EXTRAPORT8 Eight port numbers that can be use as needed.
+
+Two other environment variables are defined:
- port Number to be used for the query port.
- controlport Number to be used as the RNDC control port.
- aport1 - aport8 Eight port numbers that the test can use as needed.
+ LOWPORT The lowest port number in the range.
+ HIGHPORT The highest port number in the range.
When running tests in paralel (i.e. giving a value of "numproc" greater than 1
in the "make" or "runall.sh" commands listed above), it is guaranteed that each
test will get a set of unique port numbers.
-In addition, the "getopts.sh" script also defines the following symbols:
-
- portlow Lowest port number in the range.
- porthigh Highest port number in the range.
-
Writing a Test
---
General
---
-Each of the four scripts will be invoked with the command
+1. Each of the four scripts will be invoked with the command
+
+ sh <script> [<arguments>]
- sh <script> -p <baseport> -- <arguments>
+Thhe optional arguments are test-specific. They are
Each script should start with the following lines:
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
- . $SYSTEMTESTTOP/getopts.sh
"conf.sh" defines a series of environment variables together with functions
-useful for the test scripts. "getopts.sh" parses the "-p" option and sets the
-shell variables listed above. (They are not combined into one script because,
-in certain instances - notably in "run.sh" - some processing is required
-between the setting of the environment variables and the parsing of the port).
-
-The "--" between the "-p <baseport>" and any other arguments is required:
-without it, any other switches passed to the script would be parsed by
-getopts.sh, which would return an error because it would not recognise them.
-getopts.sh removes the "-p <port> --" from the argument list, leaving the
-script free to do its own parsing of any additional arguments.
-
-For example, if "test.sh" is invoked as:
-
- sh tests.sh -p 12340 -- -D 1
-
-... and it includes the three lines listed above, after the execution of the
-code in getopts.sh, the following variables would be defined (with their
-associated values):
-
- port 12340
- aport1 12341
- aport2 12342
- : :
- aport8 12348
- controlport 12349
- portlow 12340
- porthigh 12349
-
- $1 -D
- $2 1
-
-Should a script need to invoke another, it should pass the base port with the
-"-p" switch and add any additional arguments after the "--", i.e. using the
-same format as listed above in the example for invoking "tests.sh"
+useful for the test scripts.
prereq.sh
software needed to run the test is available and/or whether BIND has been
configured with the appropriate options required.
- * If the software required to run the test is present and the BIND configure
- options are correct, prereq.sh should return with a status code of 0.
+ * If the software required to run the test is present and the BIND
+ configure options are correct, prereq.sh should return with a status code
+ of 0.
* If the software required to run the test is not available and/or BIND
has not been configured with the appropriate options, prereq.sh should
port numbers.
To do this, configuration files should be supplied in the form of templates
-containing tokens identifying ports. The tokens have the same name as the shell
-variables listed above, but in upper-case and prefixed and suffixed by the "@"
-symbol. For example, a fragment of a configuration file template might look
-like:
+containing tokens identifying ports. The tokens have the same name as the
+shell variables listed above, but in upper-case and prefixed and suffixed by
+the "@" symbol. For example, a fragment of a configuration file template might
+look like:
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
setup.sh should copy the template to the desired filename using the
-"copy_setports" shell function defined in "getopts.sh", i.e.
+"copy_setports" shell function defined in "conf.sh", i.e.
copy_setports ns1/named.conf.in ns1/named.conf
-This replaces the tokens @PORT@, @CONTROLPORT@, @APORT1@ through @APORT8@ with
-the contents of the shell variables listed above. setup.sh should do this for
-all configuration files required when the test starts.
-
-A second important responsibility of setup.sh is to create a file called
-named.port in each "named" nameserver directory that defines the query port for
-that server, e.g.
-
- echo $port > ns1/named.port
-
-The file is used by the framework to determine the port it should use to query
-the nameserver. In most cases, all nameservers will use the same port number
-for queries. Some tests may require a different port to be used for queries,
-which is why this task has been delegated to test-specific setup rather than be
-part of the framework.
-
+This replaces the tokens @PORT@, @CONTROLPORT@, @EXTRAPORT1@ through
+@EXTRAPORT8@ with the contents of the shell variables listed above. setup.sh
+should do this for all configuration files required when the test starts.
tests.sh
---
-This is the main test file and the contents depend on the test. The contents are
-completely up to the developer, although most test scripts have a form similar
-to the following for each test:
+This is the main test file and the contents depend on the test. The contents
+are completely up to the developer, although most test scripts have a form
+similar to the following for each test:
1. n=`expr $n + 1`
2. echo_i "prime cache nodata.example ($n)"
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
-. $SYSTEMTESTTOP/getopts.sh
-RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p $controlport -s"
+RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p $CONTROLPORT -s"
status=0
n=0
n=`expr $n + 1`
echo_i "checking that dom1.example is not served by master ($n)"
ret=0
-$DIG soa dom1.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom1.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom1.example is now served by master ($n)"
ret=0
-$DIG soa dom1.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom1.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain dom1.example to catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add e721433b6160b450260d4f54b3ec8bab30cb3b83.zones.catalog1.example 3600 IN PTR dom1.example.
send
END
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom1.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom1.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom1.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom1.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom1.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "removing domain dom1.example from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete e721433b6160b450260d4f54b3ec8bab30cb3b83.zones.catalog1.example
send
END
n=`expr $n + 1`
echo_i "checking that dom1.example is not served by slave ($n)"
ret=0
-$DIG soa dom1.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom1.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "adding domains dom2.example, dom3.example and some garbage to catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 636722929740e507aaf27c502812fc395d30fb17.zones.catalog1.example 3600 IN PTR dom2.example.
update add b901f492f3ebf6c1e5b597e51766f02f0479eb03.zones.catalog1.example 3600 IN PTR dom3.example.
update add e721433b6160b450260d4f54b3ec8bab30cb3b83.zones.catalog1.example 3600 IN NS foo.bar.
echo_i "adding domain dom4.example to catalog2 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update add de26b88d855397a03f77ff1162fd055d8b419584.zones.catalog2.example 3600 IN PTR dom4.example.
send
END
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom4.example/IN' from 10.53.0.1#${aport1}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom4.example/IN' from 10.53.0.1#${EXTRAPORT1}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom4.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom4.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom4.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
n=`expr $n + 1`
echo_i "checking that dom3.example is not served by master ($n)"
ret=0
-$DIG soa dom3.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom3.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom3.example is served by master ($n)"
ret=0
-$DIG soa dom3.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom3.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom2.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null &&
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom3.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom2.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null &&
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom3.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom3.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom3.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom3.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "removing all records from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 636722929740e507aaf27c502812fc395d30fb17.zones.catalog1.example 3600 IN PTR dom2.example.
update delete b901f492f3ebf6c1e5b597e51766f02f0479eb03.zones.catalog1.example 3600 IN PTR dom3.example.
update delete e721433b6160b450260d4f54b3ec8bab30cb3b83.zones.catalog1.example 3600 IN NS foo.bar.
echo_i "removing all records from catalog2 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update delete de26b88d855397a03f77ff1162fd055d8b419584.zones.catalog2.example 3600 IN PTR dom4.example.
send
END
echo_i "adding dom5.example with a valid masters suboption (IP without TSIG) and a random label ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add somerandomlabel.zones.catalog1.example 3600 IN PTR dom5.example.
update add masters.somerandomlabel.zones.catalog1.example 3600 IN A 10.53.0.3
send
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom5.example/IN' from 10.53.0.3#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom5.example/IN' from 10.53.0.3#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom5.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom5.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom5.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "removing dom5.example ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete somerandomlabel.zones.catalog1.example 3600 IN PTR dom5.example.
update delete masters.somerandomlabel.zones.catalog1.example 3600 IN A 10.53.0.3
send
n=`expr $n + 1`
echo_i "checking that dom5.example is no longer served by slave ($n)"
ret=0
-$DIG soa dom5.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom5.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "adding dom6.example and a valid global masters option (IP without TSIG) ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add masters.catalog1.example 3600 IN A 10.53.0.3
update add masters.catalog1.example 3600 IN AAAA fd92:7065:b8e:ffff::3
update add 4346f565b4d63ddb99e5d2497ff22d04e878e8f8.zones.catalog1.example 3600 IN PTR dom6.example.
try=0
while test $try -lt 150
do
- $DIG soa dom6.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom6.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "removing dom6.example ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete masters.catalog1.example 3600 IN A 10.53.0.3
update delete masters.catalog1.example 3600 IN AAAA fd92:7065:b8e:ffff::3
update delete 4346f565b4d63ddb99e5d2497ff22d04e878e8f8.zones.catalog1.example 3600 IN PTR dom6.example.
n=`expr $n + 1`
echo_i "checking that dom6.example is no longer served by slave ($n)"
ret=0
-$DIG soa dom6.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom6.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom7.example is now served by master ($n)"
ret=0
-$DIG soa dom7.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom7.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "adding domain dom7.example to catalog1 zone with an allow-query statement ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 78833ec3c0059fd4540fee81c7eaddce088e7cd7.zones.catalog1.example 3600 IN PTR dom7.example.
update add allow-query.78833ec3c0059fd4540fee81c7eaddce088e7cd7.zones.catalog1.example 3600 IN APL 1:10.53.0.1/32 !1:10.53.0.0/30 1:0.0.0.0/0
send
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom7.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom7.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom7.example is accessible from 10.53.0.1 ($n)"
ret=0
-$DIG soa dom7.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom7.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom7.example is not accessible from 10.53.0.2 ($n)"
ret=0
-$DIG soa dom7.example -b 10.53.0.2 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom7.example -b 10.53.0.2 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom7.example is accessible from 10.53.0.5 ($n)"
ret=0
-$DIG soa dom7.example -b 10.53.0.5 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom7.example -b 10.53.0.5 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "adding dom8.example domain and global allow-query and allow-transfer ACLs ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add cba95222e308baba42417be6021026fdf20827b6.zones.catalog1.example 3600 IN PTR dom8.example
update add allow-query.catalog1.example 3600 IN APL 1:10.53.0.1/32
update add allow-transfer.catalog1.example 3600 IN APL 1:10.53.0.2/32
n=`expr $n + 1`
echo_i "checking that dom8.example is accessible from 10.53.0.1 ($n)"
ret=0
-$DIG soa dom8.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom8.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is not accessible from 10.53.0.2 ($n)"
ret=0
-$DIG soa dom8.example -b 10.53.0.2 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom8.example -b 10.53.0.2 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is not AXFR accessible from 10.53.0.1 ($n)"
ret=0
-$DIG axfr dom8.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG axfr dom8.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "Transfer failed." dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is AXFR accessible from 10.53.0.2 ($n)"
ret=0
-$DIG axfr dom8.example -b 10.53.0.2 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG axfr dom8.example -b 10.53.0.2 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep -v "Transfer failed." dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "deleting global allow-query and allow-domain ACLs ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete allow-query.catalog1.example 3600 IN APL 1:10.53.0.1/32
update delete allow-transfer.catalog1.example 3600 IN APL 1:10.53.0.2/32
send
n=`expr $n + 1`
echo_i "checking that dom8.example is accessible from 10.53.0.1 ($n)"
ret=0
-$DIG soa dom8.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom8.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is accessible from 10.53.0.2 ($n)"
ret=0
-$DIG soa dom8.example -b 10.53.0.2 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom8.example -b 10.53.0.2 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is AXFR accessible from 10.53.0.1 ($n)"
ret=0
-$DIG axfr dom8.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG axfr dom8.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep -v "Transfer failed." dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom8.example is AXFR accessible from 10.53.0.2 ($n)"
ret=0
-$DIG axfr dom8.example -b 10.53.0.2 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG axfr dom8.example -b 10.53.0.2 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep -v "Transfer failed." dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom9.example is now served by master ($n)"
ret=0
-$DIG soa dom9.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom9.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "adding domain dom9.example to catalog1 zone with a valid masters suboption (IP with TSIG) ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN PTR dom9.example.
update add label1.masters.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN A 10.53.0.1
update add label1.masters.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN TXT "tsig_key"
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom9.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom9.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom9.example is accessible on slave ($n)"
ret=0
-$DIG soa dom9.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom9.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "deleting domain dom9.example from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN PTR dom9.example.
update delete label1.masters.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN A 10.53.0.1
update delete label1.masters.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example 3600 IN TXT "tsig_key"
n=`expr $n + 1`
echo_i "checking that dom9.example is no longer accessible on slave ($n)"
ret=0
-$DIG soa dom9.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom9.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example is not served by master ($n)"
ret=0
-$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example is now served by master ($n)"
ret=0
-$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example to catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 825f48b1ce1b4cf5a041d20255a0c8e98d114858.zones.catalog1.example 3600 IN PTR this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example.
send
END
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example is served by slave ($n)"
ret=0
-$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "removing domain this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 825f48b1ce1b4cf5a041d20255a0c8e98d114858.zones.catalog1.example
send
END
n=`expr $n + 1`
echo_i "checking that this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example is not served by slave ($n)"
ret=0
-$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa this.is.a.very.very.long.long.long.domain.that.will.cause.catalog.zones.to.generate.hash.instead.of.using.regular.filename.dom10.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom11.example is not served by master ($n)"
ret=0
-$DIG soa dom11.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom11.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom11.example is now served by master ($n)"
ret=0
-$DIG soa dom11.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom11.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain dom11.example to catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 0580d70e769c86c8b951a488d8b776627f427d7a.zones.catalog1.example 3600 IN PTR dom11.example.
send
END
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom11.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom11.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom11.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom11.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom11.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
n=`expr $n + 1`
echo_i "checking that subdomain.of.dom11.example is not served by master ($n)"
ret=0
-$DIG soa subdomain.of.dom11.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa subdomain.of.dom11.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that subdomain.of.dom11.example is now served by master ($n)"
ret=0
-$DIG soa subdomain.of.dom11.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa subdomain.of.dom11.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain subdomain.of.dom11.example to catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 25557e0bdd10cb3710199bb421b776df160f241e.zones.catalog1.example 3600 IN PTR subdomain.of.dom11.example.
send
END
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'subdomain.of.dom11.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'subdomain.of.dom11.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that subdomain.of.dom11.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "removing domain dom11.example from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 0580d70e769c86c8b951a488d8b776627f427d7a.zones.catalog1.example
send
END
n=`expr $n + 1`
echo_i "checking that dom11.example is not served by slave ($n)"
ret=0
-$DIG soa dom11.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom11.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that subdomain.of.dom11.example is still served by slave ($n)"
ret=0
-$DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "removing domain subdomain.of.dom11.example from catalog1 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 25557e0bdd10cb3710199bb421b776df160f241e.zones.catalog1.example
send
END
n=`expr $n + 1`
echo_i "checking that subdomain.of.dom11.example is not served by slave ($n)"
ret=0
-$DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa subdomain.of.dom11.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom12.example is not served by master ($n)"
ret=0
-$DIG soa dom12.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom12.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom12.example is now served by master ($n)"
ret=0
-$DIG soa dom12.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom12.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain dom12.example to catalog4 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 871d51e5433543c0f6fb263c40f359fbc152c8ae.zones.catalog4.example 3600 IN PTR dom12.example.
send
END
n=`expr $n + 1`
echo_i "checking that dom12.example is not served by slave ($n)"
ret=0
-$DIG soa dom12.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom12.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom12.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom12.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom7.example is still served by slave after reconfiguration ($n)"
ret=0
-$DIG soa dom7.example -b 10.53.0.1 @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom7.example -b 10.53.0.1 @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking that dom12.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom12.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom12.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
n=`expr $n + 1`
echo_i "checking that dom12.example is not served by slave ($n)"
ret=0
-$DIG soa dom12.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG soa dom12.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "removing domain dom12.example from catalog4 zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 871d51e5433543c0f6fb263c40f359fbc152c8ae.zones.catalog4.example 3600 IN PTR dom12.example.
send
END
n=`expr $n + 1`
echo_i "checking that dom13.example is not served by master ($n)"
ret=0
-$DIG soa dom13.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom13.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom13.example is now served by master ns1 ($n)"
ret=0
-$DIG soa dom13.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom13.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom13.example is now served by master ns3 ($n)"
ret=0
-$DIG soa dom13.example @10.53.0.3 -p ${port} > dig.out.test$n
+$DIG soa dom13.example @10.53.0.3 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain dom13.example to catalog1 zone with ns1 as master ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add 8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog1.example 3600 IN PTR dom13.example.
update add masters.8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog1.example 3600 IN A 10.53.0.1
send
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom13.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom13.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom13.example is served by slave and that it's the one from ns1 ($n)"
ret=0
-$DIG a dom13.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom13.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
echo_i "Adding domain dom13.example to catalog2 zone with ns3 as master ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update add 8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog2.example 3600 IN PTR dom13.example.
update add masters.8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog2.example 3600 IN A 10.53.0.3
send
n=`expr $n + 1`
echo_i "checking that dom13.example is served by slave and that it's still the one from ns1 ($n)"
ret=0
-$DIG a dom13.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom13.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
echo_i "Deleting domain dom13.example from catalog2 ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update delete 8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog2.example 3600 IN PTR dom13.example.
update delete masters.8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog2.example 3600 IN A 10.53.0.3
send
n=`expr $n + 1`
echo_i "checking that dom13.example is served by slave and that it's still the one from ns1 ($n)"
ret=0
-$DIG a dom13.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom13.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
echo_i "Deleting domain dom13.example from catalog1 ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete 8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog1.example 3600 IN PTR dom13.example.
update delete masters.8d7989c746b3f92b3bba2479e72afd977198363f.zones.catalog1.example 3600 IN A 10.53.0.2
send
n=`expr $n + 1`
echo_i "checking that dom13.example is no longer served by slave ($n)"
ret=0
-$DIG a dom13.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom13.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom14.example is not served by master ($n)"
ret=0
-$DIG soa dom14.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom14.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom14.example is now served by master ns1 ($n)"
ret=0
-$DIG soa dom14.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom14.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom14.example is now served by master ns3 ($n)"
ret=0
-$DIG soa dom14.example @10.53.0.3 -p ${port} > dig.out.test$n
+$DIG soa dom14.example @10.53.0.3 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
while test $try -lt 45
do
sleep 1
- sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom14.example/IN' from 10.53.0.1#${port}: Transfer status: success" > /dev/null && {
+ sed -n "$cur,"'$p' < ns2/named.run | grep "transfer of 'dom14.example/IN' from 10.53.0.1#${PORT}: Transfer status: success" > /dev/null && {
ret=0
break
}
n=`expr $n + 1`
echo_i "checking that dom14.example is served by slave and that it's the one from ns1 ($n)"
ret=0
-$DIG a dom14.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom14.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
echo_i "Adding domain dom14.example to catalog2 zone with ns3 as master ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update add 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example 3600 IN PTR dom14.example.
update add masters.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example 3600 IN A 10.53.0.3
send
n=`expr $n + 1`
echo_i "checking that dom14.example is served by slave and that it's still the one from ns1 ($n)"
ret=0
-$DIG a dom14.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom14.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
echo_i "Deleting domain dom14.example from catalog2 ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.3 ${port}
+ server 10.53.0.3 ${PORT}
update delete 45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example 3600 IN PTR dom14.example.
update delete masters.45e3d45ea5f7bd01c395ccbde6ae2e750a3ee8ab.zones.catalog2.example 3600 IN A 10.53.0.3
send
n=`expr $n + 1`
echo_i "checking that dom14.example is served by slave and that it's still the one from ns1 ($n)"
ret=0
-$DIG a dom14.example @10.53.0.2 -p ${port} > dig.out.test$n
+$DIG a dom14.example @10.53.0.2 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "checking that dom15.example is not served by master ($n)"
ret=0
-$DIG soa dom15.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom15.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking that dom15.example is now served by master ns1 ($n)"
ret=0
-$DIG soa dom15.example @10.53.0.1 -p ${port} > dig.out.test$n
+$DIG soa dom15.example @10.53.0.1 -p ${PORT} > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "Adding domain dom15.example to catalog1 zone with 'dom15label1' label ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update add dom15label1.zones.catalog1.example 3600 IN PTR dom15.example.
send
END
n=`expr $n + 1`
echo_i "checking that dom15.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom15.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom15.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
echo_i "Changing label of domain dom15.example from 'dom15label1' to 'dom15label2' ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
- server 10.53.0.1 ${port}
+ server 10.53.0.1 ${PORT}
update delete dom15label1.zones.catalog1.example 3600 IN PTR dom15.example.
update add dom15label2.zones.catalog1.example 3600 IN PTR dom15.example.
send
n=`expr $n + 1`
echo_i "checking that dom15.example is served by slave ($n)"
for try in 0 1 2 3 4 5 6 7 8 9; do
- $DIG soa dom15.example @10.53.0.2 -p ${port} > dig.out.test$n
+ $DIG soa dom15.example @10.53.0.2 -p ${PORT} > dig.out.test$n
ret=0
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] && break
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
-. $SYSTEMTESTTOP/getopts.sh
-RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${controlport} -s"
+RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
status=0
n=0
#echo_i "check ans.pl server ($n)"
-#$DIG -p ${port} @10.53.0.2 example NS
-#$DIG -p ${port} @10.53.0.2 example SOA
-#$DIG -p ${port} @10.53.0.2 ns.example A
-#$DIG -p ${port} @10.53.0.2 ns.example AAAA
-#$DIG -p ${port} @10.53.0.2 txt enable
-#$DIG -p ${port} @10.53.0.2 txt disable
-#$DIG -p ${port} @10.53.0.2 ns.example AAAA
-#$DIG -p ${port} @10.53.0.2 txt enable
-#$DIG -p ${port} @10.53.0.2 ns.example AAAA
-##$DIG -p ${port} @10.53.0.2 data.example TXT
-#$DIG -p ${port} @10.53.0.2 nodata.example TXT
-#$DIG -p ${port} @10.53.0.2 nxdomain.example TXT
+#$DIG -p ${PORT} @10.53.0.2 example NS
+#$DIG -p ${PORT} @10.53.0.2 example SOA
+#$DIG -p ${PORT} @10.53.0.2 ns.example A
+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
+#$DIG -p ${PORT} @10.53.0.2 txt enable
+#$DIG -p ${PORT} @10.53.0.2 txt disable
+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
+#$DIG -p ${PORT} @10.53.0.2 txt enable
+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
+##$DIG -p ${PORT} @10.53.0.2 data.example TXT
+#$DIG -p ${PORT} @10.53.0.2 nodata.example TXT
+#$DIG -p ${PORT} @10.53.0.2 nxdomain.example TXT
n=`expr $n + 1`
echo_i "prime cache data.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "prime cache nodata.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "prime cache nxdomain.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "disable responses from authoritative server ($n)"
ret=0
-$DIG -p ${port} @10.53.0.2 txt disable > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.2 txt disable > dig.out.test$n
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale data.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nodata.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nxdomain.example ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale data.example (serve-stale off) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale nodata.example (serve-stale off) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale nxdomain.example (serve-stale off) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale data.example (serve-stale on) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nodata.example (serve-stale on) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nxdomain.example (serve-stale on) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale data.example (serve-stale no) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale nodata.example (serve-stale no) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale nxdomain.example (serve-stale no) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check stale data.example (serve-stale yes) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nodata.example (serve-stale yes) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nxdomain.example (serve-stale yes) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale data.example (serve-stale reset) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nodata.example (serve-stale reset) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check stale nxdomain.example (serve-stale reset) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "enable responses from authoritative server ($n)"
ret=0
-$DIG -p ${port} @10.53.0.2 txt enable > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.2 txt enable > dig.out.test$n
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "prime cache data.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "prime cache nodata.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "prime cache nxdomain.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "disable responses from authoritative server ($n)"
ret=0
-$DIG -p ${port} @10.53.0.2 txt disable > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.2 txt disable > dig.out.test$n
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check fail of data.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check fail of nodata.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check fail of nxdomain.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check data.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 data.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check nodata.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nodata.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
n=`expr $n + 1`
echo_i "check nxdomain.example (max-stale-ttl default) ($n)"
ret=0
-$DIG -p ${port} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi