From b9dbf29f489fc65e2fae945589766abbf8c5d6f2 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Fri, 5 Jan 2024 15:03:26 +0100 Subject: [PATCH] Handle dig timing out gracefully in allow-query (cherry picked from commit 0d5df1fc02527fddb8baa19cd664a4a749fa9000) --- bin/tests/system/allow-query/tests.sh | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh index 242ac99846..1cb7da30e6 100644 --- a/bin/tests/system/allow-query/tests.sh +++ b/bin/tests/system/allow-query/tests.sh @@ -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