]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add digdelv system test to check that dig tries other servers on error
authorAram Sargsyan <aram@isc.org>
Fri, 11 Mar 2022 21:29:14 +0000 (21:29 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 18 Mar 2022 09:12:23 +0000 (09:12 +0000)
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.

bin/tests/system/digdelv/tests.sh

index f7e852a1c983752f78fe180e5f6f1e62a3cf0d28..7e34527288822dbc53d8be065568b664884f9e75 100644 (file)
@@ -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