]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Improve forensics for the querylog section of rndc system test
authorMark Andrews <marka@isc.org>
Thu, 7 Apr 2022 07:14:54 +0000 (17:14 +1000)
committerMark Andrews <marka@isc.org>
Mon, 2 May 2022 14:19:37 +0000 (00:19 +1000)
The dig commands appear to be failing unexpectedly on some platforms
when rate limiting kicks in and the response is dropped.  Correct
behaviour should be for dig to retry the query.  Set +qr and capture
stdout and stderr of each of the dig commands involved.

(cherry picked from commit 614cf5a0302fbd396f3e6f7947c19f0586cb0c14)

bin/tests/system/rndc/tests.sh

index fa8bf88a0c349c487c2ac2e67d5b6b60cc260adc..b40b50ed6b5cff75ec6be9b0dd767515bf8e6ec2 100644 (file)
@@ -456,22 +456,22 @@ ret=0
 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf querylog on >/dev/null 2>&1 || ret=1
 grep "query logging is now on" ns4/named.run > /dev/null || ret=1
 # query for builtin and check if query was logged (without +subnet)
-$DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo12345.bind > /dev/null || ret=1
+$DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo12345.bind +qr > dig.out.1.test$n 2>&1 || ret=1
 grep "query: foo12345.bind CH TXT.*(.*)$" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (with +subnet=127.0.0.1)
-$DIG +subnet=127.0.0.1 @10.53.0.4 -p ${PORT} -c ch -t txt foo12346.bind > /dev/null || ret=1
+$DIG +subnet=127.0.0.1 @10.53.0.4 -p ${PORT} -c ch -t txt foo12346.bind +qr > dig.out.2.test$n 2>&1 || ret=1
 grep "query: foo12346.bind CH TXT.*\[ECS 127\.0\.0\.1\/32\/0]" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (with +subnet=127.0.0.1/24)
-$DIG +subnet=127.0.0.1/24 @10.53.0.4 -p ${PORT} -c ch -t txt foo12347.bind > /dev/null || ret=1
+$DIG +subnet=127.0.0.1/24 @10.53.0.4 -p ${PORT} -c ch -t txt foo12347.bind +qr > dig.out.3.test$n 2>&1 || ret=1
 grep "query: foo12347.bind CH TXT.*\[ECS 127\.0\.0\.0\/24\/0]" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (with +subnet=::1)
-$DIG +subnet=::1 @10.53.0.4 -p ${PORT} -c ch -t txt foo12348.bind > /dev/null || ret=1
+$DIG +subnet=::1 @10.53.0.4 -p ${PORT} -c ch -t txt foo12348.bind +qr > dig.out.4.test$n 2>&1 || ret=1
 grep "query: foo12348.bind CH TXT.*\[ECS \:\:1\/128\/0]" ns4/named.run > /dev/null || ret=1
 # toggle query logging and check again
 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf querylog > /dev/null 2>&1 || ret=1
 grep "query logging is now off" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (without +subnet)
-$DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo9876.bind > /dev/null || ret=1
+$DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo9876.bind +qr > dig.out.5.test$n 2>&1 || ret=1
 grep "query: foo9876.bind CH TXT.*(.*)$" ns4/named.run > /dev/null && ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`