]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Address race in dnssec system test. 'clear signing records' can fail
authorMark Andrews <marka@isc.org>
Tue, 19 May 2020 00:09:51 +0000 (10:09 +1000)
committerMark Andrews <marka@isc.org>
Tue, 19 May 2020 03:50:51 +0000 (13:50 +1000)
as the update triggers by the rndc command to clear the signing records
may not have completed by the time the subsequent rndc command to test
that the records have been removed is commenced.  Loop several times to
prevent false negative.

(cherry picked from commit 353018c0e5a428c8314c103267fcfd18213e9e39)

bin/tests/system/dnssec/tests.sh

index 101b0b6f6fb1ad637eb80f8e42d76339c8ba018f..20aff6fcfe4455026c5824f3f00e719e700b289a 100644 (file)
@@ -2670,13 +2670,16 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 echo_i "clear signing records ($n)"
-$RNDCCMD 10.53.0.3 signing -clear all update-nsec3.example > /dev/null || ret=1
-sleep 1
-$RNDCCMD 10.53.0.3 signing -list update-nsec3.example 2>&1 > signing.out
-grep "No signing records found" signing.out > /dev/null 2>&1 || {
-        ret=1
-        sed 's/^/ns3 /' signing.out | cat_i
+$RNDCCMD 10.53.0.3 signing -clear all update-nsec3.example > /dev/null 2>&1 || ret=1
+check_no_signing_record_found() {
+  $RNDCCMD 10.53.0.3 signing -list update-nsec3.example > signing.out 2>&1
+  grep -q "No signing records found" signing.out || {
+    sed 's/^/ns3 /' signing.out | cat_i
+    return 1
+  }
+  return 0
 }
+retry_quiet 5 check_no_signing_record_found || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`