]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[rt46602] Modify some test files to cope with the "-p" flag
authorStephen Morris <stephen@isc.org>
Fri, 24 Nov 2017 12:24:09 +0000 (12:24 +0000)
committerEvan Hunt <each@isc.org>
Sun, 25 Feb 2018 03:52:16 +0000 (19:52 -0800)
(cherry picked from commit 517d990bd495ef2fcfe66726c0e68cacfe2bbb90)
(cherry picked from commit b01b553d72d65e031cb1ff315ca4a41147d06076)

bin/tests/system/rpz/setup.sh
bin/tests/system/rpz/tests.sh
bin/tests/system/rrl/tests.sh

index 084a088e279695ba1cdb56605ce538c7333172ef..8b2341a41eeba0bcc8871dfc4a380488b0765f0d 100644 (file)
@@ -18,6 +18,7 @@ set -e
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 QPERF=`$SHELL qperf.sh`
 
index a5c25b2c80c2485baa630b49c3c3a5072e9df36d..01ef2b675cd0592b2e1e576aabd7713302deb560 100644 (file)
@@ -19,6 +19,7 @@
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 ns=10.53.0
 ns1=$ns.1              # root, defining the others
@@ -58,6 +59,48 @@ 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 -p $port -- -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 1500b0966d716bf6c77b4c5eb29ffced77ed513f..8984b296985f1cb0c83c020a1d69ae39aaa7e378 100644 (file)
@@ -17,6 +17,7 @@
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 #set -x