]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait for 'rpz: policy: reload done' to signalled before proceeding.
authorMark Andrews <marka@isc.org>
Fri, 25 Sep 2020 07:42:41 +0000 (17:42 +1000)
committerMark Andrews <marka@isc.org>
Sun, 27 Sep 2020 23:14:21 +0000 (09:14 +1000)
RPZ rules cannot be fully relied upon until the summary RPZ database is
updated after an "rndc reload".  Wait until the relevant message is
logged after an "rndc reload" to prevent false positives in the
"rpzrecurse" system test caused by the RPZ rules not yet being in effect
by the time ns3 is queried.

bin/tests/system/rpzrecurse/tests.sh

index ee79f3fe7c6e10d093426c894d15cd525c09c7ce..320ee08314b912ec4a956a77266e2a8e3c9b43e3 100644 (file)
@@ -513,7 +513,9 @@ for mode in native dnsrps; do
 
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
   copy_setports ns3/named2.conf.in ns3/named.conf
+  nextpart ns3/named.run > /dev/null
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
+  wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1
 
   echo_i "timing 'nsip-wait-recurse no'"
   t3=`$PERL -e 'print time()."\n";'`
@@ -529,7 +531,9 @@ for mode in native dnsrps; do
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
   # restore original named.conf
   copy_setports ns3/named1.conf.in ns3/named.conf
+  nextpart ns3/named.run > /dev/null
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
+  wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1
 
   t=`expr $t + 1`
   echo_i "checking 'nsdname-wait-recurse no' is faster than 'nsdname-wait-recurse yes' ($t)"
@@ -544,7 +548,9 @@ for mode in native dnsrps; do
 
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
   copy_setports ns3/named3.conf.in ns3/named.conf
+  nextpart ns3/named.run > /dev/null
   $RNDC  -c ../common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload > /dev/null
+  wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1
 
   echo_i "timing 'nsdname-wait-recurse no'"
   t3=`$PERL -e 'print time()."\n";'`