]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fixups after merge of branch 'rt46602-v9_11' into 'v9_11'
authorStephen Morris <stephen@isc.org>
Thu, 22 Feb 2018 15:41:04 +0000 (15:41 +0000)
committerStephen Morris <stephen@isc.org>
Thu, 22 Feb 2018 15:41:04 +0000 (15:41 +0000)
CHANGES
bin/tests/system/Makefile.in
bin/tests/system/conf.sh.in
bin/tests/system/conf.sh.win32
bin/tests/system/rpz/tests.sh
bin/tests/system/rpzrecurse/clean.sh
bin/tests/system/rpzrecurse/setup.sh
bin/tests/system/rpzrecurse/tests.sh
bin/tests/system/serve-stale/.gitignore [deleted file]

diff --git a/CHANGES b/CHANGES
index 6ef1ef5c5434a00c0a907c0fe867d930a67e054f..c6643ffd9f50f92a5b072958f178fedb4aa2b8ee 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,9 +3,6 @@
 4895.  [test]          Allow some system tests to run in parallel.
                        [RT #46602]
 
-4894.  [bug]           named could crash while rolling a dnstap output file.
-                       [RT #46942]
-
 4893.  [bug]           Address various issues reported by cppcheck. [GL #51]
 
 4892.  [bug]           named could leak memory when "rndc reload" was invoked
index e071076f65329d834de015c4d79c5db5a20556c2..9f621d1c39961712a5029ec73c2f234c1f0955ed 100644 (file)
@@ -46,7 +46,7 @@ feature-test@EXEEXT@: feature-test.@O@
 # Define the tests that can be run in parallel.  This should be identical to
 # the definition of PARALLELDIRS in conf.sh.
 
-PARALLEL = allow_query catz rpzrecurse serve-stale
+PARALLEL = allow_query catz rpzrecurse
 
 # Produce intermediate makefile that assigns unique port numbers to each
 # parallel test.  The start port number of 5,000 is arbitrary - it must just
index 1693210dc704cd7943ddea3e74e2e88d7859fbc3..c0c0b225ba1f5afad8b07a6ed82bcd2ea7aa85ef 100644 (file)
@@ -76,27 +76,25 @@ KRB5_CONFIG=/dev/null
 #
 # List of tests that use ports 5300 and 9953.  For this reason, these must
 # be run sequentially.
-SEQUENTIALDIRS="acl additional addzone auth autosign builtin \
-       cacheclean case cds chain \
-       checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@ \
-       database digdelv dlv dlz dlzexternal \
+SEQUENTIALDIRS="acl additional addzone autosign builtin \
+       cacheclean case chain checkconf @CHECKDS@ checknames checkzone \
+    cookie @COVERAGE@ database digdelv dlv dlz dlzexternal \
        dns64 dnssec @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa \
-       emptyzones fetchlimit filter-aaaa formerr geoip glue gost \
-       inline integrity ixfr keepalive @KEYMGR@ legacy limits \
-       logfileconfig masterfile masterformat metadata mkeys \
-       names notify nslookup nsupdate nzd2nzf padding pending \
-       pipelined @PKCS11_TEST@ reclimit redirect resolver rndc \
-       rpz rrchecker rrl rrsetorder rsabigexponent \
-       runtime sfcache smartsign sortlist spf staticstub \
-       statistics statschannel stub synthfromdnssec tcp tkey tools \
-       tsig tsiggss unknown upforwd verify views wildcard xfer \
-       xferquota zero zonechecks"
+       ednscompliance emptyzones fetchlimit filter-aaaa formerr \
+    forward geoip glue gost inline integrity ixfr @KEYMGR@ \
+    legacy limits logfileconfig lwresd masterfile masterformat \
+    metadata mkeys names notify nslookup nsupdate nzd2nzf \
+    pending @PKCS11_TEST@ pipelined reclimit redirect resolver \
+    rndc rpz rrchecker rrl rrsetorder rsabigexponent \
+       runtime sfcache smartsign sortlist spf staticstub statistics \
+    statschannel stub tcp tkey tsig tsiggss unknown upforwd \
+    verify views wildcard xfer xferquota zero zonechecks"
 
 # List of tests that use unique ports (other than 5300 and 9953). These
 # tests can be run in parallel.
 #
 # This symbol must be kept in step with the PARALLEL macro in Makefile.in
-PARALLELDIRS="allow_query catz rpzrecurse serve-stale"
+PARALLELDIRS="allow_query catz rpzrecurse"
 
 SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
 
index 8489112c7568b1b3323a3b5a9fb8b4ee23276db4..933514101532530d5b74c577dfd12987ca14bf96 100644 (file)
@@ -89,29 +89,28 @@ KRB5_CONFIG=NUL
 SEQUENTIALDIRS="acl additional addzone autosign builtin \
         cacheclean case \
         checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@ \
-        database digdelv dlv dlvauto dlz dlzexternal dname \
+        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 \
-        keepalive @KEYMGR@ legacy limits logfileconfig masterfile \
-        masterformat metadata mkeys names notify nslookup nsupdate \
-        nzd2nzf padding pending pipelined @PKCS11_TEST@ reclimit \
-        redirect resolver rndc rpz rrchecker rrl \
-        rrsetorder rsabigexponent runtime sfcache smartsign sortlist \
-        spf staticstub statistics statschannel stub tcp tkey tsig \
-        tsiggss unknown upforwd verify views wildcard xfer xferquota \
-        zero zonechecks"
+        @KEYMGR@ legacy limits logfileconfig lwresd masterfile masterformat \
+        metadata mkeys names notify nslookup nsupdate nzd2nzf pending \
+        @PKCS11_TEST@ pipelined reclimit redirect resolver rndc rpz \
+        rrchecker rrl rrsetorder rsabigexponent runtime sfcache \
+        smartsign sortlist spf staticstub statistics statschannel stub tcp \
+        tkey tsig tsiggss unknown upforwd verify views wildcard xfer \
+        xferquota zero zonechecks"
 
 # List of tests that use unique ports (other than 5300 and 9953). These
 # tests can be run in parallel.
 #
 # This symbol must be kept in step with the PARALLEL macro in Makefile.in
-PARALLELDIRS="allow_query catz rpzrecurse serve-stale"
+PARALLELDIRS="allow_query catz rpzrecurse"
 
 SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
 
 # missing: chain integrity
-# extra: dname ednscompliance forward 
+# extra: dname ednscompliance forward
 
 #Things that are different on Windows
 KILL="/bin/kill -f"
@@ -121,7 +120,7 @@ DOS2UNIX=dos2unix
 TP=
 
 # Configure is launched from native environment, but tests are run in Cygwin -
-# so any detection is unreliable. 
+# so any detection is unreliable.
 SHELL="/bin/bash -o igncr"
 CURL=/usr/bin/curl
 XMLLINT=/usr/bin/xmllint
index 04e68e8d073cedbae7b24bc1d19b9daa73373ebe..9112b3230a6630884888ccaf5a8140faa2f34aab 100644 (file)
@@ -50,48 +50,6 @@ comment () {
 
 RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p 9953 -s"
 
-# Run the tests twice, first without DNSRPS and then with if it is available
-if [ -z "$DNSRPS_TEST_MODE" ]; then
-    if [ -e dnsrps-only ]; then
-        echo "I:'dnsrps-only' found: skipping native RPZ sub-test"
-    else
-        echo "I:running native RPZ sub-test"
-       $SHELL ./$0 -D1 $ARGS || status=1
-    fi
-
-    if [ -e dnsrps-off ]; then
-       echo "I:'dnsrps-off' found: skipping DNSRPS sub-test"
-    else
-       echo "I:attempting to configure servers with DNSRPS..."
-       $PERL $SYSTEMTESTTOP/stop.pl .
-       $SHELL ./setup.sh -D $DEBUG
-       sed -n 's/^## /I:/p' dnsrps.conf
-       if grep '^#fail' dnsrps.conf >/dev/null; then
-           echo "I:exit status: 1"
-           exit 1
-       fi
-       if test -z "`grep '^#skip' dnsrps.conf`"; then
-           echo "I:running DNSRPS sub-test"
-           $PERL $SYSTEMTESTTOP/start.pl --noclean --restart .
-           $SHELL ./$0 $ARGS -D2 || status=1
-        else
-            echo "I:DNSRPS sub-test skipped"
-       fi
-    fi
-
-    echo "I:exit status: $status"
-    exit $status
-fi
-
-if test -x $DNSRPSCMD; then
-    # speed up the many delays for dnsrpzd by waiting only 0.1 seconds
-    WAIT_CMD="$DNSRPSCMD -w 0.1"
-    TEN_SECS=100
-else
-    WAIT_CMD="sleep 1"
-    TEN_SECS=10
-fi
-
 digcmd () {
     if test "$1" = TCP; then
        shift
index 790722bdfabfa28bc23630adbb1db1c65a73765a..297d2c04114413afe261939b3fc79cc5d7de54f3 100644 (file)
@@ -21,7 +21,8 @@ rm -f ns2/named.conf.header
 
 rm -f ns3/named2.conf
 
-rm -f ans4/ans.pl
+rm -f ans*/*.run
+rm -f ans5/ans.pl
 
 rm -f dnsrps*.conf dnsrpzd*
 rm -f ns*/session.key
index c3d648f88c00b7feb490433f3b0b48420408c7b6..074361413d121d52d4961db2f351f363d75e0719 100644 (file)
@@ -14,7 +14,6 @@ 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
@@ -41,25 +40,3 @@ copy_setports ns3/named2.conf.in ns3/named2.conf
 copy_setports ns4/named.conf.in ns4/named.conf
 
 copy_setports ans5/ans.pl.in ans5/ans.pl
-
-# decide whether to test DNSRPS
-$SHELL ../rpz/ckdnsrps.sh $TEST_DNSRPS $DEBUG
-test -z "`grep 'dnsrps-enable yes' dnsrps.conf`" && TEST_DNSRPS=
-
-CWD=`pwd`
-cat <<EOF >dnsrpzd.conf
-PID-FILE $CWD/dnsrpzd.pid;
-
-include $CWD/dnsrpzd-license-cur.conf
-
-zone "policy" { type master; file "`pwd`/ns3/policy.db"; };
-EOF
-sed -n -e 's/^ *//' -e "/zone.*.*master/s@file \"@&$CWD/ns2/@p" ns2/*.conf \
-    >>dnsrpzd.conf
-
-# Run dnsrpzd to get the license and prime the static policy zones
-if test -n "$TEST_DNSRPS"; then
-    DNSRPZD="`../rpz/dnsrps -p`"
-    "$DNSRPZD" -D./dnsrpzd.rpzf -S./dnsrpzd.sock -C./dnsrpzd.conf \
-               -w 0 -dddd -L stdout >./dnsrpzd.run 2>&1
-fi
index b0ba801b289738ae6b43b8c8899bde7265829d44..c6ec7455fda754f5ef0771db78c54ae3b6cd7948 100644 (file)
@@ -12,30 +12,6 @@ SYSTEMTESTTOP=..
 status=0
 t=0
 
-DEBUG=
-DNSRPS_TEST_MODE=      # "" to test with and then without DNSRPS
-ARGS=
-
-USAGE="$0: [-xS] [-D {1,2}]"
-while getopts "xSD:" c; do
-    case $c in
-       x) set -x; DEBUG=-x; ARGS="$ARGS -x";;
-       D) DNSRPS_TEST_MODE="$OPTARG";;         # with or without DNSRPS
-       *) 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
-# really quit on control-C
-trap 'exit 1' 1 2 15
-
-
-DNSRPSCMD=../rpz/dnsrps
-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
@@ -48,7 +24,6 @@ run_server() {
     echo_i "starting resolver using named.$TESTNAME.conf"
     cp -f ns2/named.$TESTNAME.conf ns2/named.conf
     $PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} . ns2
-    sleep 3
 }
 
 run_query() {
@@ -70,10 +45,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})"
-    add_test_marker 10.53.0.2
     run_query $TESTNAME $LINE || {
-       echo_i "test ${t} failed"
-       status=1
+        echo_i "test ${t} failed"
+        status=1
     }
 }
 
@@ -86,72 +60,24 @@ expect_recurse() {
     NAME=`sed -n -e "$LINE,"'$p' ns2/$TESTNAME.queries | head -n 1`
     t=`expr $t + 1`
     echo_i "testing $NAME recurses (${t})"
-    add_test_marker 10.53.0.2
     run_query $TESTNAME $LINE && {
-       echo_i "test ${t} failed"
-       status=1
+        echo_i "test ${t} failed"
+        status=1
     }
 }
 
-add_test_marker() {
-    for ns in $@
-    do
-       $RNDCCMD $ns null ---- test ${t} ----
-    done
-}
-
-case "$DNSRPS_TEST_MODE" in
-''|native|dnsrps);;
-*)
-  echo "bad test mode'${DNSRPS_TEST_MODE}' should be 'native' or 'dnsrps'"
-  exit 1
-  ;;
-esac
-
-for mode in ${DNSRPS_TEST_MODE:-native dnsrps}
-do
-  status=0
-  case $mode in
-  native)
-    if [ ${DNSRPS_TEST_MODE:-unset} = unset -a -e dnsrps-only ] ; then
-     echo_i "'dnsrps-only' found: skipping native RPZ sub-test"
-     continue
-    fi
-    ;;
-  dnsrps)
-    if [ ${DNSRPS_TEST_MODE:-unset} = unset -a -e dnsrps-off ] ; then
-      echo_i "'dnsrps-off' found: skipping DNSRPS sub-test"
-      continue
-    fi
-    if grep '^#skip' dnsrps.conf > /dev/null ; then
-      echo_i "DNSRPS sub-test skipped"
-      continue
-    fi
-    $SHELL ./setup.sh -N -D $DEBUG
-    $RNDCCMD 10.53.0.2 reload
-    $RNDCCMD 10.53.0.3 reload
-    $RNDCCMD 10.53.0.2 flush
-    $RNDCCMD 10.53.0.3 flush
-    ;;
-  esac
-
-  # show whether and why DNSRPS is enabled or disabled
-  sed -n 's/^## /I:/p' dnsrps.conf
-
-  t=`expr $t + 1`
-  echo_i "testing that l1.l0 exists without RPZ (${t})"
-  add_test_marker 10.53.0.2
-  $DIG $DIGOPTS l1.l0 ns @10.53.0.2 -p ${PORT} > dig.out.${t}
-  grep "status: NOERROR" dig.out.${t} > /dev/null 2>&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 ${PORT} > dig.out.${t}
+grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || {
     echo_i "test ${t} failed"
     status=1
 }
 
-  t=`expr $t + 1`
-  echo_i "testing that l2.l1.l0 returns SERVFAIL without RPZ (${t})"
-  add_test_marker 10.53.0.2
-  $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 || {
+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 ${PORT} > dig.out.${t}
+grep "status: SERVFAIL" dig.out.${t} > /dev/null 2>&1 || {
     echo_i "test ${t} failed"
     status=1
 }
@@ -206,7 +132,6 @@ for n in $testlist; do
     ni=$1
     t=`expr $t + 1`
     echo_i "testing that ${ni} of 33 queries skip recursion (${t})"
-    add_test_marker 10.53.0.2
     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
@@ -216,305 +141,246 @@ for n in $testlist; do
     done
     skipped=`expr 33 - $c`
     if [ $skipped != $ni ]; then
-      echo_i "test $t failed (actual=$skipped, expected=$ni)"
-      status=1
+       echo_i "test $t failed (actual=$skipped, expected=$ni)"
+       status=1
     fi
     shift
-  done
-
-  # Group 5
-  run_server 5a
-  expect_norecurse 5a 1
-  expect_norecurse 5a 2
-  expect_recurse 5a 3
-  expect_recurse 5a 4
-  expect_recurse 5a 5
-  expect_recurse 5a 6
-
-  if [ ! "$CYGWIN" -o -n "$PSSUSPEND" ]
-  then
-    # Group 6
-    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})"
-    add_test_marker 10.53.0.1 10.53.0.2
-    $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t}
-    sleep 1
-    echo_i "suspending authority server"
+done
+
+# Group 5
+run_server 5a
+expect_norecurse 5a 1
+expect_norecurse 5a 2
+expect_recurse 5a 3
+expect_recurse 5a 4
+expect_recurse 5a 5
+expect_recurse 5a 6
+
+# Group 6
+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 ${PORT} www.test.example.org CNAME > dig.out.${t}
+sleep 1
+echo_i "suspending authority server"
+if [ "$CYGWIN" ]; then
+    WINPID=`cat ns1/named.pid`
+    PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
+else
     PID=`cat ns1/named.pid`
-    if [ "$CYGWIN" ]
-    then
-      $PSSUSPEND $PID
-    else
-      $KILL -STOP $PID
-    fi
-    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 ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
-    test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid`
-    sleep 1
-    t=`expr $t + 1`
-    echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
-    add_test_marker 10.53.0.2
-    $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
-    sleep 1
-    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 ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
-    test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid`
-    sleep 1
-    echo_i "resuming authority server"
+fi
+kill -TSTP $PID
+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 ${CONTROLPORT} 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 ${PORT} www.test.example.org A > dig.out.${t} &
+sleep 1
+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 ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
+sleep 1
+echo_i "resuming authority server"
+if [ "$CYGWIN" ]; then
+    WINPID=`cat ns1/named.pid`
+    PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
+else
     PID=`cat ns1/named.pid`
-    if [ "$CYGWIN" ]
-    then
-      $PSSUSPEND -r $PID
-    else
-      $KILL -CONT $PID
-    fi
-    add_test_marker 10.53.0.1
-    for n in 1 2 3 4 5 6 7 8 9
-    do
-      sleep 1
-      [ -s dig.out.${t} ] || continue
-      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"
-      status=1
-    }
-
-    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})"
-    add_test_marker 10.53.0.1 10.53.0.2
-    $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t}
+fi
+kill -CONT $PID
+for n in 1 2 3 4 5 6 7 8 9; do
     sleep 1
-    echo_i "suspending authority server"
+    [ -s dig.out.${t} ] || continue
+    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"
+    status=1
+}
+
+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 ${PORT} www.test.example.org CNAME > dig.out.${t}
+sleep 1
+echo_i "suspending authority server"
+if [ "$CYGWIN" ]; then
+    WINPID=`cat ns1/named.pid`
+    PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
+else
     PID=`cat ns1/named.pid`
-    if [ "$CYGWIN" ]
-    then
-      $PSSUSPEND $PID
-    else
-      $KILL -STOP $PID
-    fi
-    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 ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/I:ns2 /'
-    test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid`
-    sleep 1
-    t=`expr $t + 1`
-    echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
-    add_test_marker 10.53.0.2
-    $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
-    sleep 1
-    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 ${CONTROLPORT} reconfig 2>&1 | sed 's/^/I:ns2 /'
-    test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid`
-    sleep 1
-    echo_i "resuming authority server"
+fi
+kill -TSTP $PID
+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 ${CONTROLPORT} 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 ${PORT} www.test.example.org A > dig.out.${t} &
+sleep 1
+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 ${CONTROLPORT} reconfig 2>&1 | sed 's/^/I:ns2 /'
+sleep 1
+echo_i "resuming authority server"
+if [ "$CYGWIN" ]; then
+    WINPID=`cat ns1/named.pid`
+    PID=`ps | sed 's/^..//' | awk '$4 == '$WINPID | awk '{print $1}'`
+else
     PID=`cat ns1/named.pid`
-    if [ "$CYGWIN" ]
-    then
-      $PSSUSPEND -r $PID
-    else
-      $KILL -CONT $PID
-    fi
-    add_test_marker 10.53.0.1
-    for n in 1 2 3 4 5 6 7 8 9; do
-      sleep 1
-      [ -s dig.out.${t} ] || continue
-      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"
-      status=1
-    }
-  fi
-
-  # Check CLIENT-IP behavior
-  t=`expr $t + 1`
-  echo_i "testing CLIENT-IP behavior (${t})"
-  add_test_marker 10.53.0.2
-  run_server clientip
-  $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 || {
+fi
+kill -CONT $PID
+for n in 1 2 3 4 5 6 7 8 9; do
+    sleep 1
+    [ -s dig.out.${t} ] || continue
+    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"
+     status=1
+}
+
+# Check CLIENT-IP behavior
+t=`expr $t + 1`
+echo_i "testing CLIENT-IP behavior (${t})"
+run_server clientip
+$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"
     status=1
-  }
-  grep "^l2.l1.l0.[    ]*[0-9]*[       ]*IN[   ]*A[    ]*10.53.0.2" dig.out.${t} > /dev/null 2>&1 || {
+}
+grep "^l2.l1.l0.[      ]*[0-9]*[       ]*IN[   ]*A[    ]*10.53.0.2" dig.out.${t} > /dev/null 2>&1 || {
     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})"
-  add_test_marker 10.53.0.2
-  run_server clientip2
-  $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 || {
+}
+
+# Check CLIENT-IP behavior #2
+t=`expr $t + 1`
+echo_i "testing CLIENT-IP behavior #2 (${t})"
+run_server clientip2
+$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"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-  grep "^l2.l1.l0.[    ]*[0-9]*[       ]*IN[   ]*A[    ]*10.53.0.1" dig.out.${t}.3 > /dev/null 2>&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"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-
-  # Check RPZ log clause
-  t=`expr $t + 1`
-  echo_i "testing RPZ log clause (${t})"
-  add_test_marker 10.53.0.2
-  run_server log
-  cur=`awk 'BEGIN {l=0} /^/ {l++} END { print l }' ns2/named.run`
-  $DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.4 > dig.out.${t}
-  $DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.3 >> dig.out.${t}
-  $DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.2 >> dig.out.${t}
-  sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.4.0.53.10.rpz-client-ip.log1" > /dev/null && {
+}
+
+# Check RPZ log clause
+t=`expr $t + 1`
+echo_i "testing RPZ log clause (${t})"
+run_server log
+cur=`awk 'BEGIN {l=0} /^/ {l++} END { print l }' ns2/named.run`
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.4 > dig.out.${t}
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.3 >> dig.out.${t}
+$DIG $DIGOPTS l2.l1.l0 a @10.53.0.2 -p ${PORT} -b 10.53.0.2 >> dig.out.${t}
+sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.4.0.53.10.rpz-client-ip.log1" > /dev/null && {
     echo_i " failed: unexpected rewrite message for policy zone log1 was logged"
     status=1
-  }
-  sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.3.0.53.10.rpz-client-ip.log2" > /dev/null || {
+}
+sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.3.0.53.10.rpz-client-ip.log2" > /dev/null || {
     echo_i " failed: expected rewrite message for policy zone log2 was not logged"
     status=1
-  }
-  sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.2.0.53.10.rpz-client-ip.log3" > /dev/null || {
+}
+sed -n "$cur,"'$p' < ns2/named.run | grep "view recursive: rpz CLIENT-IP Local-Data rewrite l2.l1.l0 via 32.2.0.53.10.rpz-client-ip.log3" > /dev/null || {
     echo_i " failed: expected rewrite message for policy zone log3 was not logged"
     status=1
 }
 
 # Check wildcard behavior
 
-  t=`expr $t + 1`
-  echo_i "testing wildcard behavior with 1 RPZ zone (${t})"
-  add_test_marker 10.53.0.2
-  run_server wildcard1
-  $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 || {
+t=`expr $t + 1`
+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 ${PORT} > dig.out.${t}.1
+grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
     echo_i "test ${t} failed"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-
-  t=`expr $t + 1`
-  echo_i "testing wildcard behavior with 2 RPZ zones (${t})"
-  add_test_marker 10.53.0.2
-  run_server wildcard2
-  $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 || {
+}
+
+t=`expr $t + 1`
+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 ${PORT} > dig.out.${t}.1
+grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
     echo_i "test ${t} failed"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-
-  t=`expr $t + 1`
-  echo_i "testing wildcard behavior with 1 RPZ zone and no non-wildcard triggers (${t})"
-  add_test_marker 10.53.0.2
-  run_server wildcard3
-  $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 || {
+}
+
+t=`expr $t + 1`
+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 ${PORT} > dig.out.${t}.1
+grep "status: NXDOMAIN" dig.out.${t}.1 > /dev/null || {
     echo_i "test ${t} failed"
     status=1
-  }
-  $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 || {
+}
+$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"
     status=1
-  }
-
-  t=`expr $t + 1`
-  echo_i "checking 'nsip-wait-recurse no' is faster than 'nsip-wait-recurse yes' ($t)"
-  add_test_marker 10.53.0.2
-  echo_i "timing 'nsip-wait-recurse yes' (default)"
-  ret=0
-  t1=`$PERL -e 'print time()."\n";'`
-  $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.yes.$t
-  t2=`$PERL -e 'print time()."\n";'`
-  p1=`expr $t2 - $t1`
-  echo_i "elasped time $p1 seconds"
-
-  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
-  cp -f ns3/named2.conf ns3/named.conf
-  $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
-
-  echo_i "timing 'nsip-wait-recurse no'"
-  t3=`$PERL -e 'print time()."\n";'`
-  $DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.no.$t
-  t4=`$PERL -e 'print time()."\n";'`
-  p2=`expr $t4 - $t3`
-  echo_i "elasped time $p2 seconds"
-
-  if test $p1 -le $p2; then ret=1; fi
-  if test $ret != 0; then echo_i "failed"; fi
-  status=`expr $status + $ret`
-
-  [ $status -ne 0 ] && pf=fail || pf=pass
-  case $mode in
-  native)
-    native=$status
-    echo_i "status (native RPZ sub-test): $status ($pf)";;
-  dnsrps)
-    dnsrps=$status
-    echo_i "status (DNSRPS sub-test): $status ($pf)";;
-  *) echo_i "invalid test mode";;
-  esac
-done
-status=`expr ${native:-0} + ${dnsrps:-0}`
+}
 
 t=`expr $t + 1`
-echo "I:checking 'nsip-wait-recurse no' is faster than 'nsip-wait-recurse yes' ($t)"
-echo "I:timing 'nsip-wait-recurse yes' (default)"
+echo_i "checking 'nsip-wait-recurse no' is faster than 'nsip-wait-recurse yes' ($t)"
+echo_i "timing 'nsip-wait-recurse yes' (default)"
 ret=0
 t1=`$PERL -e 'print time()."\n";'`
-$DIG -p 5300 @10.53.0.3 foo.child.example.tld a > dig.out.yes.$t
+$DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.yes.$t
 t2=`$PERL -e 'print time()."\n";'`
 p1=`expr $t2 - $t1`
-echo "I:elasped time $p1 seconds"
+echo_i "elasped time $p1 seconds"
 
-$RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush
+$RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
 cp -f ns3/named2.conf ns3/named.conf
-$RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reload > /dev/null
+$RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
 
-echo "I:timing 'nsip-wait-recurse no'"
+echo_i "timing 'nsip-wait-recurse no'"
 t3=`$PERL -e 'print time()."\n";'`
-$DIG -p 5300 @10.53.0.3 foo.child.example.tld a > dig.out.no.$t
+$DIG -p ${PORT} @10.53.0.3 foo.child.example.tld a > dig.out.no.$t
 t4=`$PERL -e 'print time()."\n";'`
 p2=`expr $t4 - $t3`
-echo "I:elasped time $p2 seconds"
+echo_i "elasped time $p2 seconds"
 
 if test $p1 -le $p2; then ret=1; fi
-if test $ret != 0; then echo "I:failed"; fi
+if test $ret != 0; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
-echo "I:exit status: $status"
+echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
diff --git a/bin/tests/system/serve-stale/.gitignore b/bin/tests/system/serve-stale/.gitignore
deleted file mode 100644 (file)
index 3d3bc7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/ans2/ans.pid
-/ans2/ans.pl
-/ns1/named.conf
-/ns3/named.conf
-/ns3/root.bk