]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove 45 second sleeps from notify system test (#41248)
authorMukund Sivaraman <muks@isc.org>
Tue, 2 Feb 2016 04:16:43 +0000 (09:46 +0530)
committerMukund Sivaraman <muks@isc.org>
Tue, 2 Feb 2016 04:16:57 +0000 (09:46 +0530)
No CHANGES entry required.

bin/tests/system/notify/tests.sh

index 7693fdff242e26eae2d88eee464df343c949adf1..c4342b892e873aea97ad8fa2b70f78f82cda9fc1 100644 (file)
@@ -67,12 +67,18 @@ awk '$1 > 5 { exit(1) }' log.out || ret=1
 [ $ret = 0 ] || echo "I:failed"
 status=`expr $ret + $status`
 
-echo "I:reloading with example2 using HUP and waiting 45 seconds"
+echo "I:reloading with example2 using HUP and waiting up to 45 seconds"
 sleep 1 # make sure filesystem time stamp is newer for reload.
 rm -f ns2/example.db
 cp -f ns2/example2.db ns2/example.db
 kill -HUP `cat ns2/named.pid`
-sleep 45
+try=0
+while test $try -lt 45
+do
+    sleep 1
+    grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 2$' ns3/named.run > /dev/null && break
+    try=`expr $try + 1`
+done
 
 n=`expr $n + 1`
 echo "I:checking notify message was logged ($n)"
@@ -107,7 +113,7 @@ $PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
 [ $ret = 0 ] || echo "I:failed"
 status=`expr $ret + $status`
 
-echo "I:stopping master and restarting with example4 then waiting 45 seconds"
+echo "I:stopping master and restarting with example4 then waiting up to 45 seconds"
 $PERL $SYSTEMTESTTOP/stop.pl . ns2
 
 rm -f ns2/example.db
@@ -115,7 +121,13 @@ cp -f ns2/example4.db ns2/example.db
 
 $PERL $SYSTEMTESTTOP/start.pl --noclean --restart . ns2
 
-sleep 45
+try=0
+while test $try -lt 45
+do
+    sleep 1
+    grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 4$' ns3/named.run > /dev/null && break
+    try=`expr $try + 1`
+done
 
 n=`expr $n + 1`
 echo "I:checking notify message was logged ($n)"