]> 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 17:22:30 +0000 (09:22 -0800)
(cherry picked from commit 517d990bd495ef2fcfe66726c0e68cacfe2bbb90)
(cherry picked from commit b01b553d72d65e031cb1ff315ca4a41147d06076)
(cherry picked from commit ca76477b369a0f4a5e3fe31ccd0ef514a9cd840f)

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

index 65a468a1853f0cf41987153296eba4dab1a6646c..246417427daf29a221c359d453c58fb2ef5abbf6 100644 (file)
@@ -18,6 +18,7 @@ set -e
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 QPERF=`$SHELL qperf.sh`
 
index aff0c25f519c09ce1620ff999a805f415ceeb922..ba1861f600a90fe3f7af94ed92815eca04f91619 100644 (file)
@@ -19,6 +19,7 @@
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 ns=10.53.0
 ns1=$ns.1              # root, defining the others
@@ -57,6 +58,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 () {
     # Default to +noauth and @$ns3
     # Also default to -bX where X is the @value so that OS X will choose
index 49f71ea56248ceaa51672176cb7a9756b43df533..c2ac2b21daab451794169600e0443cc388ca50c2 100644 (file)
@@ -17,6 +17,7 @@
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
+. $SYSTEMTESTTOP/getopts.sh
 
 #set -x