From df7616ec09554886bb496ca1c27ef623989b9726 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Fri, 11 Mar 2022 21:29:14 +0000 Subject: [PATCH] Add digdelv system test to check that dig tries other servers on error Add a test to check whether dig tries the next query/server after a connection error. Add a test to check whether dig tries the next query/server after a one or more (default is 3) connection/request timeouts. (cherry picked from commit e8a64d0cbefdb7856cbd43c2c1d7e8bab37f3d12) --- bin/tests/system/digdelv/tests.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index f7e852a1c9..7e34527288 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -1014,6 +1014,24 @@ if [ -x "$DIG" ] ; then grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) + + n=$((n+1)) + echo_i "check that dig tries the next server after a connection error ($n)" + ret=0 + dig_with_opts -d @10.53.0.99 @10.53.0.3 a.example > dig.out.test$n 2>&1 || ret=1 + grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status+ret)) + + n=$((n+1)) + echo_i "check that dig tries the next server after timeouts ($n)" + # Ask ans4 to not respond to queries + echo "//" | sendcmd 10.53.0.4 + ret=0 + dig_with_opts -d @10.53.0.4 @10.53.0.3 a.example > dig.out.test$n 2>&1 || ret=1 + grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 + if [ $ret -ne 0 ]; then echo_i "failed"; fi + status=$((status+ret)) else echo_i "$DIG is needed, so skipping these dig tests" fi