]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle dig timing out gracefully in allow-query
authorTom Krizek <tkrizek@isc.org>
Fri, 5 Jan 2024 14:03:26 +0000 (15:03 +0100)
committerTom Krizek <tkrizek@isc.org>
Tue, 9 Jan 2024 12:43:23 +0000 (13:43 +0100)
(cherry picked from commit 0d5df1fc02527fddb8baa19cd664a4a749fa9000)

bin/tests/system/allow-query/tests.sh

index 242ac998467442bbd64d7dc84479b17b7371616f..1cb7da30e6c4d79f5c07ccef2e97a494c958ebc7 100644 (file)
@@ -599,9 +599,9 @@ status=$(expr $status + $ret)
 n=$(expr $n + 1)
 echo_i "test $n: default allow-recursion configuration"
 ret=0
-$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 a.normal.example a >dig.out.ns3.1.$n
+$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 a.normal.example a >dig.out.ns3.1.$n || ret=1
 grep 'status: NOERROR' dig.out.ns3.1.$n >/dev/null || ret=1
-$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 a.normal.example a >dig.out.ns3.2.$n
+$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 a.normal.example a >dig.out.ns3.2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns3.2.$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$(expr $status + $ret)
@@ -610,9 +610,9 @@ status=$(expr $status + $ret)
 n=$(expr $n + 1)
 echo_i "test $n: default allow-query-cache configuration"
 ret=0
-$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 ns . >dig.out.ns3.1.$n
+$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 ns . >dig.out.ns3.1.$n || ret=1
 grep 'status: NOERROR' dig.out.ns3.1.$n >/dev/null || ret=1
-$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 ns . >dig.out.ns3.2.$n
+$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 ns . >dig.out.ns3.2.$n || ret=1
 grep 'status: REFUSED' dig.out.ns3.2.$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$(expr $status + $ret)
@@ -625,11 +625,11 @@ rndc_reload ns3 10.53.0.3
 echo_i "test $n: block recursion-on, allow query-cache-on"
 ret=0
 # this should query the cache, and an answer should already be there
-$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n
+$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.1.$n >/dev/null || ret=1
 grep 'ANSWER: 1' dig.out.ns3.1.$n >/dev/null || ret=1
 # this should require recursion and therefore can't get an answer
-$DIG -p ${PORT} @10.53.0.3 b.normal.example a >dig.out.ns3.2.$n
+$DIG -p ${PORT} @10.53.0.3 b.normal.example a >dig.out.ns3.2.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.2.$n >/dev/null || ret=1
 grep 'ANSWER: 0' dig.out.ns3.2.$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -643,17 +643,17 @@ rndc_reload ns3 10.53.0.3
 echo_i "test $n: inheritance of allow-query-cache-on"
 ret=0
 # this should query the cache, an answer should already be there
-$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n
+$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n || ret=1
 grep 'ANSWER: 1' dig.out.ns3.1.$n >/dev/null || ret=1
 # this should be refused due to allow-recursion-on/allow-query-cache-on
-$DIG -p ${PORT} @10.53.1.2 a.normal.example a >dig.out.ns3.2.$n
+$DIG -p ${PORT} @10.53.1.2 a.normal.example a >dig.out.ns3.2.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.2.$n >/dev/null || ret=1
 grep 'status: REFUSED' dig.out.ns3.2.$n >/dev/null || ret=1
 # this should require recursion and should be allowed
-$DIG -p ${PORT} @10.53.0.3 c.normal.example a >dig.out.ns3.3.$n
+$DIG -p ${PORT} @10.53.0.3 c.normal.example a >dig.out.ns3.3.$n || ret=1
 grep 'ANSWER: 1' dig.out.ns3.3.$n >/dev/null || ret=1
 # this should require recursion and be refused
-$DIG -p ${PORT} @10.53.1.2 d.normal.example a >dig.out.ns3.4.$n
+$DIG -p ${PORT} @10.53.1.2 d.normal.example a >dig.out.ns3.4.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.4.$n >/dev/null || ret=1
 grep 'status: REFUSED' dig.out.ns3.4.$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -667,17 +667,17 @@ rndc_reload ns3 10.53.0.3
 echo_i "test $n: inheritance of allow-recursion-on"
 ret=0
 # this should query the cache, an answer should already be there
-$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n
+$DIG -p ${PORT} @10.53.0.3 a.normal.example a >dig.out.ns3.1.$n || ret=1
 grep 'ANSWER: 1' dig.out.ns3.1.$n >/dev/null || ret=1
 # this should be refused due to allow-recursion-on/allow-query-cache-on
-$DIG -p ${PORT} @10.53.1.2 a.normal.example a >dig.out.ns3.2.$n
+$DIG -p ${PORT} @10.53.1.2 a.normal.example a >dig.out.ns3.2.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.2.$n >/dev/null || ret=1
 grep 'status: REFUSED' dig.out.ns3.2.$n >/dev/null || ret=1
 # this should require recursion and should be allowed
-$DIG -p ${PORT} @10.53.0.3 e.normal.example a >dig.out.ns3.3.$n
+$DIG -p ${PORT} @10.53.0.3 e.normal.example a >dig.out.ns3.3.$n || ret=1
 grep 'ANSWER: 1' dig.out.ns3.3.$n >/dev/null || ret=1
 # this should require recursion and be refused
-$DIG -p ${PORT} @10.53.1.2 f.normal.example a >dig.out.ns3.4.$n
+$DIG -p ${PORT} @10.53.1.2 f.normal.example a >dig.out.ns3.4.$n || ret=1
 grep 'recursion requested but not available' dig.out.ns3.4.$n >/dev/null || ret=1
 grep 'status: REFUSED' dig.out.ns3.4.$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi