]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[rt46602] Adjust rpzrecurse for dynamic port usage
authorOndřej Surý <ondrej@sury.org>
Wed, 18 Oct 2017 12:56:26 +0000 (14:56 +0200)
committerEvan Hunt <each@isc.org>
Sun, 25 Feb 2018 03:28:26 +0000 (19:28 -0800)
Resolve conflict in run.sh during cherry-pick from an experimental branch.

(cherry picked from commit 2a435708e4a99651a800a01f4f990459d4144414)
(cherry picked from commit c5aa6ed87bb879192f36a1fc2700921d51554ed6)

bin/tests/system/Makefile.in
bin/tests/system/conf.sh.win32
bin/tests/system/getopts.sh
bin/tests/system/rpzrecurse/.gitignore
bin/tests/system/rpzrecurse/ns1/named.conf.in [moved from bin/tests/system/rpzrecurse/ns1/named.conf with 96% similarity]
bin/tests/system/rpzrecurse/ns2/named.conf.header.in [moved from bin/tests/system/rpzrecurse/ns2/named.conf.header with 90% similarity]
bin/tests/system/rpzrecurse/setup.sh
bin/tests/system/rpzrecurse/tests.sh
bin/tests/system/run.sh

index e9c85f37ad10ea79e045cde2d68385653fd8d8d5..ac9980a1b2a1657ccb405bf3604b0d9eaed488e9 100644 (file)
@@ -52,16 +52,14 @@ feature-test@EXEEXT@: feature-test.@O@
 
 check: test
 
-TESTS = allow_query serve-stale
+TESTS = allow_query serve-stale rpzrecurse
 
 test: subdirs $(TESTS)
        if test -f ./runall.sh; then $(SHELL) ./runall.sh; fi
 
-serve-stale:
-       $(SHELL) ./run.sh -p 5304 -c 9954 $@
-
-allow_query:
-       $(SHELL) ./run.sh -p 5305 -c 9955 $@
+$(TESTS):
+       PORT=$$((32767+$$RANDOM)); \
+       $(SHELL) ./run.sh -p $$(($$PORT)) -c $$(($$PORT+1)) $@
 
 testclean clean distclean::
        if test -f ./cleanall.sh; then sh ./cleanall.sh; fi
index 9c6dcd2bcb6e428d0cec5499e3ca553d7bbb8880..ff8bcf3384b09298b6ea73e705bd3a6259651cb8 100644 (file)
@@ -88,10 +88,12 @@ KRB5_CONFIG=NUL
 # The "stress" test is not run by default since it creates enough
 # load on the machine to make it unusable to other users.
 # v6synth
-SUBDIRS="acl additional addzone allow_query autosign builtin cacheclean case
-        catz checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@
-        database digdelv dlv dlvauto dlz dlzexternal dname dns64 dnssec
-        @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa ednscompliance emptyzones
+SUBDIRS="acl additional addzone autosign builtin
+        cacheclean case
+        checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@
+        database digdelv dlv dlvauto dlz dlzexternal
+        dns64 dnssec @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa
+        ednscompliance emptyzones
         fetchlimit filter-aaaa formerr forward geoip glue gost inline ixfr
         @KEYMGR@ legacy limits logfileconfig lwresd masterfile masterformat
         metadata mkeys names notify nslookup nsupdate nzd2nzf pending
index cd8d5b0e14394c6b8d44bcb2061e5a49fe55f29b..af61ae281b6bed2f9d3a1c96e9f90a8e201e1345 100644 (file)
@@ -10,7 +10,7 @@
 port=5300
 controlport=9953
 
-while getopts "p:c:" flag; do
+while getopts ":p:c:" flag; do
     case "$flag" in
        p) port=$OPTARG ;;
        c) controlport=$OPTARG ;;
@@ -19,5 +19,6 @@ while getopts "p:c:" flag; do
     esac
 done
 shift $(($OPTIND - 1))
+OPTIND=1
 
 SEDPORTS="sed -e s/@PORT@/${port}/g -e s/@CONTROLPORT@/${controlport}/g"
index 6154e068775a047fadfba2738b4934d2ff055330..ed45f426ce1098bd9c106bb36470089582a38445 100644 (file)
@@ -1,2 +1,11 @@
-/rpz
-/rpz.o
+/ns1/named.conf
+/ns2/named.conf.header
+/ns2/named.conf
+/ns3/named.conf
+/ns4/named.conf
+/ans5/ans.pl
+/ans5/ans.pid
+/dnsrps-slave.conf
+/dnsrps.conf
+/dnsrpzd.conf
+session.key
similarity index 96%
rename from bin/tests/system/rpzrecurse/ns1/named.conf
rename to bin/tests/system/rpzrecurse/ns1/named.conf.in
index 6fa82e92cd5fdaad471b27efa79d64ce49551067..4747f2bd90e59fefb5e0b57ef409049aab2c081d 100644 (file)
@@ -18,7 +18,8 @@ options {
        query-source address 10.53.0.1;
        notify-source 10.53.0.1;
        transfer-source 10.53.0.1;
-       port 5300;
+       port @PORT@;
+       session-keyfile "session.key";
        pid-file "named.pid";
        listen-on { 10.53.0.1; };
        listen-on-v6 { none; };
similarity index 90%
rename from bin/tests/system/rpzrecurse/ns2/named.conf.header
rename to bin/tests/system/rpzrecurse/ns2/named.conf.header.in
index 4988b9854af4cea146c593beee81b3e2f925b402..0710d328840ff17533152280e59b42496c47ee9a 100644 (file)
@@ -20,7 +20,8 @@ options {
        query-source address 10.53.0.2;
        notify-source 10.53.0.2;
        transfer-source 10.53.0.2;
-       port 5300;
+       port @PORT@;
+       session-keyfile "session.key";
        pid-file "named.pid";
        listen-on { 10.53.0.2; };
        listen-on-v6 { none; };
@@ -34,6 +35,5 @@ key rndc_key {
 };
 
 controls {
-       inet 10.53.0.2 port 9953 allow { any; } keys { rndc_key; };
+       inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
-
index 3a34348e6f7976e9abe8b5947602a733bcbdb1dd..8d78fdfb33a012a1de029e17f2e95a3aa6b08180 100644 (file)
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
-perl testgen.pl
+. ../getopts.sh
+
+USAGE="$0: [-xD]"
+DEBUG=
+while getopts "xD" c; do
+    case $c in
+       x) set -x; DEBUG=-x;;
+        D) TEST_DNSRPS="-D";;
+       N) NOCLEAN=set;;
+       *) echo "$USAGE" 1>&2; exit 1;;
+    esac
+done
+shift `expr $OPTIND - 1 || true`
+if test "$#" -ne 0; then
+    echo "$USAGE" 1>&2
+    exit 1
+fi
+
+[ ${NOCLEAN:-unset} = unset ] && $SHELL clean.sh $DEBUG
+
+$PERL testgen.pl
+$SEDPORTS < ns1/named.conf.in > ns1/named.conf
+echo "${port}" > ns1/named.port
+$SEDPORTS < ns2/named.conf.header.in > ns2/named.conf.header
+echo "${port}" > ns2/named.port
 cp -f ns2/named.default.conf ns2/named.conf
index 12d2e4eec42399aba27b786623d5bf6793c701d9..41d8ef6b0d6061f4a77d140a8098740fb9cfcf77 100644 (file)
@@ -20,16 +20,18 @@ SYSTEMTESTTOP=..
 status=0
 t=0
 
+RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
+
 # $1 = test name (such as 1a, 1b, etc. for which named.$1.conf exists)
 run_server() {
     TESTNAME=$1
 
-    echo "I:stopping resolver"
+    echo_i "stopping resolver"
     $PERL $SYSTEMTESTTOP/stop.pl . ns2
 
     sleep 1
 
-    echo "I:starting resolver using named.$TESTNAME.conf"
+    echo_i "starting resolver using named.$TESTNAME.conf"
     cp -f ns2/named.$TESTNAME.conf ns2/named.conf
     $PERL $SYSTEMTESTTOP/start.pl --noclean --restart . ns2
 }
@@ -39,7 +41,7 @@ run_query() {
     LINE=$2
 
     NAME=`sed -n -e "$LINE,"'$p' ns2/$TESTNAME.queries | head -n 1`
-    $DIG $DIGOPTS $NAME a @10.53.0.2 -p 5300 -b 127.0.0.1 > dig.out.${t}
+    $DIG $DIGOPTS $NAME a @10.53.0.2 -p ${PORT} -b 127.0.0.1 > dig.out.${t}
     grep "status: SERVFAIL" dig.out.${t} > /dev/null 2>&1 && return 1
     return 0
 }
@@ -52,9 +54,9 @@ expect_norecurse() {
 
     NAME=`sed -n -e "$LINE,"'$p' ns2/$TESTNAME.queries | head -n 1`
     t=`expr $t + 1`
-    echo "I:testing $NAME doesn't recurse (${t})"
+    echo_i "testing $NAME doesn't recurse (${t})"
     run_query $TESTNAME $LINE || {
-        echo "I:test ${t} failed"
+        echo_i "test ${t} failed"
         status=1
     }
 }
@@ -67,26 +69,26 @@ expect_recurse() {
 
     NAME=`sed -n -e "$LINE,"'$p' ns2/$TESTNAME.queries | head -n 1`
     t=`expr $t + 1`
-    echo "I:testing $NAME recurses (${t})"
+    echo_i "testing $NAME recurses (${t})"
     run_query $TESTNAME $LINE && {
-        echo "I:test ${t} failed"
+        echo_i "test ${t} failed"
         status=1
     }
 }
 
 t=`expr $t + 1`
-echo "I:testing that l1.l0 exists without RPZ (${t})"
-$DIG $DIGOPTS l1.l0 ns @10.53.0.2 -p 5300 > dig.out.${t}
+echo_i "testing that l1.l0 exists without RPZ (${t})"
+$DIG $DIGOPTS l1.l0 ns @10.53.0.2 -p ${PORT} > dig.out.${t}
 grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
 t=`expr $t + 1`
-echo "I:testing that l2.l1.l0 returns SERVFAIL without RPZ (${t})"
-$DIG $DIGOPTS l2.l1.l0 ns @10.53.0.2 -p 5300 > dig.out.${t}
+echo_i "testing that l2.l1.l0 returns SERVFAIL without RPZ (${t})"
+$DIG $DIGOPTS l2.l1.l0 ns @10.53.0.2 -p ${PORT} > dig.out.${t}
 grep "status: SERVFAIL" dig.out.${t} > /dev/null 2>&1 || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
@@ -139,7 +141,7 @@ for n in $testlist; do
     run_server 4$n
     ni=$1
     t=`expr $t + 1`
-    echo "I:testing that ${ni} of 33 queries skip recursion (${t})"
+    echo_i "testing that ${ni} of 33 queries skip recursion (${t})"
     c=0
     for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
             17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
@@ -149,7 +151,7 @@ for n in $testlist; do
     done
     skipped=`expr 33 - $c`
     if [ $skipped != $ni ]; then
-       echo "I:test $t failed (actual=$skipped, expected=$ni)"
+       echo_i "test $t failed (actual=$skipped, expected=$ni)"
        status=1
     fi
     shift
@@ -165,14 +167,14 @@ expect_recurse 5a 5
 expect_recurse 5a 6
 
 # Group 6
-echo "I:check recursive behavior consistency during policy update races"
+echo_i "check recursive behavior consistency during policy update races"
 run_server 6a
 sleep 1
 t=`expr $t + 1`
-echo "I:running dig to cache CNAME record (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p 5300 www.test.example.org CNAME > dig.out.${t}
+echo_i "running dig to cache CNAME record (${t})"
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t}
 sleep 1
-echo "I:suspending authority server"
+echo_i "suspending authority server"
 if [ "$CYGWIN" ]; then
     WINPID=`cat ns1/named.pid`
     PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
@@ -180,20 +182,20 @@ else
     PID=`cat ns1/named.pid`
 fi
 kill -TSTP $PID
-echo "I:adding an NSDNAME policy"
+echo_i "adding an NSDNAME policy"
 cp ns2/db.6a.00.policy.local ns2/saved.policy.local
 cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
+$RNDCCMD 10.53.0.2 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
 sleep 1
 t=`expr $t + 1`
-echo "I:running dig to follow CNAME (blocks, so runs in the background) (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p 5300 www.test.example.org A > dig.out.${t} &
+echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
 sleep 1
-echo "I:removing the NSDNAME policy"
+echo_i "removing the NSDNAME policy"
 cp ns2/db.6c.00.policy.local ns2/db.6a.00.policy.local
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
+$RNDCCMD 10.53.0.2 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
 sleep 1
-echo "I:resuming authority server"
+echo_i "resuming authority server"
 if [ "$CYGWIN" ]; then
     WINPID=`cat ns1/named.pid`
     PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
@@ -207,19 +209,19 @@ for n in 1 2 3 4 5 6 7 8 9; do
     grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break
 done
 grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
-echo "I:check recursive behavior consistency during policy removal races"
+echo_i "check recursive behavior consistency during policy removal races"
 cp ns2/saved.policy.local ns2/db.6a.00.policy.local
 run_server 6a
 sleep 1
 t=`expr $t + 1`
-echo "I:running dig to cache CNAME record (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p 5300 www.test.example.org CNAME > dig.out.${t}
+echo_i "running dig to cache CNAME record (${t})"
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t}
 sleep 1
-echo "I:suspending authority server"
+echo_i "suspending authority server"
 if [ "$CYGWIN" ]; then
     WINPID=`cat ns1/named.pid`
     PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
@@ -227,19 +229,19 @@ else
     PID=`cat ns1/named.pid`
 fi
 kill -TSTP $PID
-echo "I:adding an NSDNAME policy"
+echo_i "adding an NSDNAME policy"
 cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
+$RNDCCMD 10.53.0.2 reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
 sleep 1
 t=`expr $t + 1`
-echo "I:running dig to follow CNAME (blocks, so runs in the background) (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p 5300 www.test.example.org A > dig.out.${t} &
+echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
 sleep 1
-echo "I:removing the policy zone"
+echo_i "removing the policy zone"
 cp ns2/named.default.conf ns2/named.conf
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig 2>&1 | sed 's/^/I:ns2 /'
+$RNDCCMD 10.53.0.2 reconfig 2>&1 | sed 's/^/I:ns2 /'
 sleep 1
-echo "I:resuming authority server"
+echo_i "resuming authority server"
 if [ "$CYGWIN" ]; then
     WINPID=`cat ns1/named.pid`
     PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
@@ -253,96 +255,96 @@ for n in 1 2 3 4 5 6 7 8 9; do
     grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break
 done
 grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || {
-     echo "I:test ${t} failed"
+     echo_i "test ${t} failed"
      status=1
 }
 
 # Check CLIENT-IP behavior
 t=`expr $t + 1`
-echo "I:testing CLIENT-IP behavior (${t})"
+echo_i "testing CLIENT-IP behavior (${t})"
 run_server clientip
-$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p 5300 -b 10.53.0.4 > dig.out.${t}
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.4 > dig.out.${t}
 grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || {
-    echo "I:test $t failed: query failed"
+    echo_i "test $t failed: query failed"
     status=1
 }
 grep "^l2.l1.l0.[[:space:]]*[0-9]*[[:space:]]*IN[[:space:]]*A[[:space:]]*10.53.0.2" dig.out.${t} > /dev/null 2>&1 || {
-    echo "I:test $t failed: didn't get expected answer"
+    echo_i "test $t failed: didn't get expected answer"
     status=1
 }
 
 # Check CLIENT-IP behavior #2
 t=`expr $t + 1`
-echo "I:testing CLIENT-IP behavior #2 (${t})"
+echo_i "testing CLIENT-IP behavior #2 (${t})"
 run_server clientip2
-$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p 5300 -b 10.53.0.1 > dig.out.${t}.1
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.1 > dig.out.${t}.1
 grep "status: SERVFAIL" dig.out.${t}.1 > /dev/null 2>&1 || {
-    echo "I:test $t failed: query failed"
+    echo_i "test $t failed: query failed"
     status=1
 }
-$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p 5300 -b 10.53.0.2 > dig.out.${t}.2
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.2 > dig.out.${t}.2
 grep "status: NXDOMAIN" dig.out.${t}.2 > /dev/null 2>&1 || {
-    echo "I:test $t failed: query failed"
+    echo_i "test $t failed: query failed"
     status=1
 }
-$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p 5300 -b 10.53.0.3 > dig.out.${t}.3
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.3 > dig.out.${t}.3
 grep "status: NOERROR" dig.out.${t}.3 > /dev/null 2>&1 || {
-    echo "I:test $t failed: query failed"
+    echo_i "test $t failed: query failed"
     status=1
 }
 grep "^l2.l1.l0.[      ]*[0-9]*[       ]*IN[   ]*A[    ]*10.53.0.1" dig.out.${t}.3 > /dev/null 2>&1 || {
-    echo "I:test $t failed: didn't get expected answer"
+    echo_i "test $t failed: didn't get expected answer"
     status=1
 }
-$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p 5300 -b 10.53.0.4 > dig.out.${t}.4
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.4 > dig.out.${t}.4
 grep "status: SERVFAIL" dig.out.${t}.4 > /dev/null 2>&1 || {
-    echo "I:test $t failed: query failed"
+    echo_i "test $t failed: query failed"
     status=1
 }
 
 # Check wildcard behavior
 
 t=`expr $t + 1`
-echo "I:testing wildcard behavior with 1 RPZ zone (${t})"
+echo_i "testing wildcard behavior with 1 RPZ zone (${t})"
 run_server wildcard1
-$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.1
+$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.1
 grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
-$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.2
+$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.2
 grep "status: NXDOMAIN" dig.out.${t}.2 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
 t=`expr $t + 1`
-echo "I:testing wildcard behavior with 2 RPZ zones (${t})"
+echo_i "testing wildcard behavior with 2 RPZ zones (${t})"
 run_server wildcard2
-$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.1
+$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.1
 grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
-$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.2
+$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.2
 grep "status: NXDOMAIN" dig.out.${t}.2 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
 t=`expr $t + 1`
-echo "I:testing wildcard behavior with 1 RPZ zone and no non-wildcard triggers (${t})"
+echo_i "testing wildcard behavior with 1 RPZ zone and no non-wildcard triggers (${t})"
 run_server wildcard3
-$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.1
+$DIG $DIGOPTS www.test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.1
 grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
-$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p 5300 > dig.out.${t}.2
+$DIG $DIGOPTS test1.example.net a @10.53.0.2 -p ${PORT} > dig.out.${t}.2
 grep "status: NOERROR" dig.out.${t}.2 > /dev/null || {
-    echo "I:test ${t} failed"
+    echo_i "test ${t} failed"
     status=1
 }
 
-echo "I:exit status: $status"
+echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index 2306810c35e4c2c2c2d9e49f77e74d4436ced4d2..d3985266952f57cd9f313ec1b0ce09ae1da2ceda 100644 (file)
@@ -47,9 +47,6 @@ if [ "$((${controlport}+0))" -ne "${controlport}" ] || [ "${controlport}" -le 10
     echo "Specified control port '$controlport' must be numeric (1024,65535>" >&2; exit 1;
 fi
 
-echo "PORT: ${port}"
-echo "CONTROLPORT: ${controlport}"
-
 shift $(($OPTIND - 1))
 
 test $# -gt 0 || { echo "usage: $0 [-k|-n|-p <PORT>] test-directory" >&2; exit 1; }
@@ -57,11 +54,13 @@ test $# -gt 0 || { echo "usage: $0 [-k|-n|-p <PORT>] test-directory" >&2; exit 1
 test=$1
 shift
 
-test -d $test || { echo "$0: $test: no such test" >&2; exit 1; }
+test -d $test || { echofail "$0: $test: no such test" >&2; exit 1; }
 
 echoinfo "S:$test:`date $dateargs`" >&2
 echoinfo "T:$test:1:A" >&2
-echoinfo "A:System test $test" >&2
+echoinfo "A:$test:System test $test" >&2
+echoinfo "I:$test:PORT:${port}" >&2
+echoinfo "I:$test:CONTROLPORT:${controlport}" >&2
 
 if [ x${PERL:+set} = x ]
 then
@@ -72,7 +71,7 @@ then
 fi
 
 # Check for test-specific prerequisites.
-test ! -f $test/prereq.sh || ( cd $test && $SHELL prereq.sh -c "$controlport" -p "$port" "$@" )
+test ! -f $test/prereq.sh || ( cd $test && $SHELL prereq.sh -c "$controlport" -p "$port" -- "$@" )
 result=$?
 
 if [ $result -eq 0 ]; then
@@ -107,14 +106,14 @@ fi
 # Set up any dynamically generated test data
 if test -f $test/setup.sh
 then
-   ( cd $test && $SHELL setup.sh -c "$controlport" -p "$port" "$@" )
+   ( cd $test && $SHELL setup.sh -c "$controlport" -p "$port" -- "$@" )
 fi
 
 # Start name servers running
-$PERL start.pl -p $port $test || { echofail "R:$test:$FAIL"; echoinfo "E:$test:`date $dateargs`"; exit 1; }
+$PERL start.pl -p $port $test || { echofail "R:$test:FAIL"; echoinfo "E:$test:`date $dateargs`"; exit 1; }
 
 # Run the tests
-( cd $test ; $SHELL tests.sh -c "$controlport" -p "$port" "$@" )
+( cd $test ; $SHELL tests.sh -c "$controlport" -p "$port" -- "$@" )
 
 status=$?
 
@@ -141,7 +140,7 @@ else
         rm -f $SYSTEMTESTTOP/random.data
         if test -f $test/clean.sh
         then
-                       ( cd $test && $SHELL clean.sh "-p" "$port" "$@" )
+                       ( cd $test && $SHELL clean.sh "-p" "$port" -- "$@" )
         fi
         if test -d ../../../.git
         then