]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
reduce timing dependencies in system tests
authorEvan Hunt <each@isc.org>
Sun, 27 Sep 2020 06:27:24 +0000 (23:27 -0700)
committerOndřej Surý <ondrej@sury.org>
Sat, 7 Nov 2020 19:49:53 +0000 (20:49 +0100)
one of the tests in the resolver system test depends on dig
getting no response to its first two query attempts, and SERVFAIL
on the third after resolution times out.

using a 5-second retry timer in dig means the SERVFAIL response
could occur while dig is discarding the second query and preparing
to send the third. in this case the server's response could be
missed.  shortening the retry interval to 4 seconds ensures that
dig has already sent the third query when the SERVFAIL response
arrives.

also, the serve-stale system test could fail due to a race in which
it timed out after waiting ten seconds for a file to be written, and
the dig timeout was just a bit longer. this is addressed by extending
the dig timeout to 11 seconds for this test.

bin/tests/system/resolver/tests.sh
bin/tests/system/serve-stale/tests.sh

index 3874361fb558f6506f41d2bca62864f1f13c4296..a958103c0a1eccf440b2a76dd94fd719aea92e56 100755 (executable)
@@ -805,7 +805,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "check that the resolver accepts a reply with empty question section with TC=1 and retries over TCP ($n)"
 ret=0
-$DIG $DIGOPTS @10.53.0.5 truncated.no-questions. a +tries=3 +time=5 > dig.ns5.out.${n} || ret=1
+$DIG $DIGOPTS @10.53.0.5 truncated.no-questions. a +tries=3 +time=4 > dig.ns5.out.${n} || ret=1
 grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
 grep "ANSWER: 1," dig.ns5.out.${n} > /dev/null || ret=1
 grep "1\.2\.3\.4" dig.ns5.out.${n} > /dev/null || ret=1
@@ -815,7 +815,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "check that the resolver rejects a reply with empty question section with TC=0 ($n)"
 ret=0
-$DIG $DIGOPTS @10.53.0.5 not-truncated.no-questions. a +tries=3 +time=5 > dig.ns5.out.${n} || ret=1
+$DIG $DIGOPTS @10.53.0.5 not-truncated.no-questions. a +tries=3 +time=4 > dig.ns5.out.${n} || ret=1
 grep "status: NOERROR" dig.ns5.out.${n} > /dev/null && ret=1
 grep "ANSWER: 1," dig.ns5.out.${n} > /dev/null && ret=1
 grep "1\.2\.3\.4" dig.ns5.out.${n} > /dev/null && ret=1
index b787c816abab2fe952bb35d67b167036ec556bc8..518396bde4a8c133015e5bac3c680d2c4bb04172 100755 (executable)
 
 RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
 
-# wait up to ten seconds to ensure that a file has been written
+# wait up to 11 seconds to ensure that a file has been written
 waitfile () {
-    for try in 0 1 2 3 4 5 6 7 8 9; do
+    for try in 0 1 2 3 4 5 6 7 8 9 10; do
         [ -s "$1" ] && break
         sleep 1
     done
 }
 
+DIG="$DIG +time=11"
+
 max_stale_ttl=$(sed -ne 's,^[[:space:]]*max-stale-ttl \([[:digit:]]*\).*,\1,p' $TOP_SRCDIR/bin/named/config.c)
 
 status=0