]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
wait longer for dynamic zone to be transfered
authorMark Andrews <marka@isc.org>
Fri, 13 Dec 2019 04:58:39 +0000 (15:58 +1100)
committerMark Andrews <marka@isc.org>
Tue, 28 Jan 2020 04:38:38 +0000 (04:38 +0000)
bin/tests/system/case/tests.sh

index 1f5634dacaacfcc423f24be5d2e1bd993585355c..afacc607e95ed04faf175437ddfafbe7db92b2f4 100644 (file)
@@ -14,6 +14,12 @@ SYSTEMTESTTOP=..
 
 DIGOPTS="+tcp +nosea +nostat +noquest +nocomm +nocmd -p ${PORT}"
 
+wait_for_serial() (
+    $DIG $DIGOPTS "@$1" "$2" SOA > "$4"
+    serial=$(awk '$4 == "SOA" { print $7 }' "$4")
+    [ "$3" -eq "${serial:--1}" ]
+)
+
 status=0
 n=0
 
@@ -91,11 +97,13 @@ digcomp dig.ns1.test$n postupdate.good || ret=1
 test $ret -eq 0 || echo_i "failed"
 status=`expr $status + $ret`
 
-for i in 1 2 3 4 5 6 7 8 9
-do
-       $DIG $DIGOPTS soa dynamic @10.53.0.2 | grep 2000042408 > /dev/null && break
-       sleep 1
-done
+n=`expr $n + 1`
+ret=0
+echo_i "wait for zone to transfer ($n)"
+retry_quiet 20 wait_for_serial 10.53.0.2 dynamic 2000042408 dig.ns2.test$n || ret=1
+
+test $ret -eq 0 || echo_i "failed"
+status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "check SOA owner case is transfered to slave ($n)"
@@ -121,11 +129,13 @@ digcomp dig.ns1.test$n postns1.good || ret=1
 test $ret -eq 0 || echo_i "failed"
 status=`expr $status + $ret`
 
-for i in 1 2 3 4 5 6 7 8 9
-do
-       $DIG $DIGOPTS soa dynamic @10.53.0.2 | grep 2000042409 > /dev/null && break
-       sleep 1
-done
+n=`expr $n + 1`
+ret=0
+echo_i "wait for zone to transfer ($n)"
+retry_quiet 20 wait_for_serial 10.53.0.2 dynamic 2000042409 dig.ns2.test$n || ret=1
+
+test $ret -eq 0 || echo_i "failed"
+status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "check A owner case is transfered to slave ($n)"