From 4f82cc41cc46971f1ab95d55ee686fb9efce2f34 Mon Sep 17 00:00:00 2001 From: Diego Fronza Date: Tue, 16 Feb 2021 13:13:07 -0300 Subject: [PATCH] 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. --- bin/tests/system/digdelv/tests.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index f0f1f4fa2e..a30577139a 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