From: Diego Fronza Date: Tue, 16 Feb 2021 16:13:07 +0000 (-0300) Subject: Added tests for tries=1 and retry=0 on TCP EOF X-Git-Tag: v9.17.12~24^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f82cc41cc46971f1ab95d55ee686fb9efce2f34;p=thirdparty%2Fbind9.git Added tests for tries=1 and retry=0 on TCP EOF Added tests to ensure that dig won't retry sending a query over tcp (+tcp) when a TCP connection is closed prematurely (EOF is read) if either +tries=1 or retry=0 is specified on the command line. --- diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index f0f1f4fa2e3..a30577139a8 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -857,6 +857,25 @@ if [ -x "$DIG" ] ; then if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) + n=$((n+1)) + echo_i "checking +tries=1 won't retry twice upon TCP EOF ($n)" + ret=0 + echo "no_response no_response" | sendcmd 10.53.0.5 + dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1 + # Sanity check: ensure ans5 behaves as expected. + [ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status+ret)) + + n=$((n+1)) + echo_i "checking +retry=0 won't retry twice upon TCP EOF ($n)" + ret=0 + dig_with_opts @10.53.0.5 example AXFR +retry=0 > dig.out.test$n 2>&1 && ret=1 + # Sanity check: ensure ans5 behaves as expected. + [ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status+ret)) + n=$((n+1)) echo_i "check that dig +expandaaaa works ($n)" ret=0