Address race in dnssec system test. 'clear signing records' can fail

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 353018c0e5)
This commit is contained in:
Mark Andrews
2020-05-19 10:09:51 +10:00
parent 0172ecc1e1
commit c813b5a737

View File

@@ -2633,12 +2633,15 @@ status=$((status+ret))
echo_i "clear signing records ($n)"
{ rndccmd 10.53.0.3 signing -clear all update-nsec3.example > /dev/null; } 2>&1 || ret=1
sleep 1
{ rndccmd 10.53.0.3 signing -list update-nsec3.example > signing.out; } 2>&1
grep -q "No signing records found" signing.out || {
ret=1
sed 's/^/ns3 /' signing.out | cat_i
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=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))