]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not rely on default dig options in system tests
authorMichał Kępień <michal@isc.org>
Wed, 3 Apr 2019 10:57:33 +0000 (12:57 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 3 Apr 2019 11:00:23 +0000 (13:00 +0200)
Some system tests assume dig's default setings are in effect.  While
these defaults may only be silently overridden (because of specific
options set in /etc/resolv.conf) for BIND releases using liblwres for
parsing /etc/resolv.conf (i.e. BIND 9.11 and older), it is arguably
prudent to make sure that tests relying on specific +timeout and +tries
settings specify these explicitly in their dig invocations, in order to
prevent test failures from being triggered by any potential changes to
current defaults.

(cherry picked from commit b6cce0fb8bd0bd9a70488c183a41c4f43c0eee2f)

bin/tests/system/legacy/tests.sh
bin/tests/system/resolver/tests.sh
bin/tests/system/rpzrecurse/tests.sh

index ea12ca04671f4ff65d6af142aba507c23b1c113a..c93a0dc75d1cc575b608973a2671188d4bd99809 100755 (executable)
@@ -12,7 +12,7 @@
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
-DIGOPTS="-p ${PORT}"
+DIGOPTS="-p ${PORT} +tries=3 +time=5"
 
 status=0
 n=0
index 4c40c7262d34e71d2c38c79d50d23df47cebc2f0..525130c9d36481c16b54371e01109515aea0f918 100755 (executable)
@@ -762,7 +762,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 > dig.ns5.out.${n} || ret=1
+$DIG $DIGOPTS @10.53.0.5 truncated.no-questions. a +tries=3 +time=5 > 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
@@ -772,7 +772,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 > dig.ns5.out.${n} || ret=1
+$DIG $DIGOPTS @10.53.0.5 not-truncated.no-questions. a +tries=3 +time=5 > 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 eec817659db3d97a0537389ff5de316e08d7763d..92b06efbbc0572e2388d43c729b30ff8cabfa598 100644 (file)
@@ -181,7 +181,7 @@ $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.
 sleep 1
 t=`expr $t + 1`
 echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} &
 sleep 1
 echo_i "removing the NSDNAME policy"
 cp ns2/db.6c.00.policy.local ns2/db.6a.00.policy.local
@@ -225,7 +225,7 @@ $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.
 sleep 1
 t=`expr $t + 1`
 echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})"
-$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A > dig.out.${t} &
+$DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} &
 sleep 1
 echo_i "removing the policy zone"
 cp ns2/named.default.conf ns2/named.conf