From: Tom Krizek Date: Wed, 5 Oct 2022 13:59:13 +0000 (+0200) Subject: Make digdelv test work in different network envs X-Git-Tag: v9.18.9~25^2~4 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=25d2d7e46e5735ea5813acab7556f0bef0d18885;p=thirdparty%2Fbind9.git Make digdelv test work in different network envs When a target server is unreachable, the varying network conditions may cause different ICMP message (or no message). The host unreachable message was discovered when attempting to run the test locally while connected to a VPN network which handles all traffic. Extend the dig output check with "host unreachable" message to avoid a false negative test result in certain network environments. (cherry picked from commit 1e7d832342aa2aaaeb8ef1710ec095dfcade4c6d) --- diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 939560737f8..c630ae1e8ac 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -1023,7 +1023,7 @@ if [ -x "$DIG" ] ; then echo_i "check that dig tries the next server after a UDP socket network unreachable error ($n)" ret=0 dig_with_opts @192.0.2.128 @10.53.0.3 a.example > dig.out.test$n 2>&1 || ret=1 - test $(grep -F -e "connection refused" -e "timed out" -e "network unreachable" dig.out.test$n | wc -l) -eq 3 || ret=1 + test $(grep -F -e "connection refused" -e "timed out" -e "network unreachable" -e "host unreachable" dig.out.test$n | wc -l) -eq 3 || ret=1 grep -F "status: NOERROR" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -1032,7 +1032,7 @@ if [ -x "$DIG" ] ; then echo_i "check that dig tries the next server after a TCP socket network unreachable error ($n)" ret=0 dig_with_opts +tcp @192.0.2.128 @10.53.0.3 a.example > dig.out.test$n 2>&1 || ret=1 - test $(grep -F -e "connection refused" -e "timed out" -e "network unreachable" dig.out.test$n | wc -l) -eq 3 || ret=1 + test $(grep -F -e "connection refused" -e "timed out" -e "network unreachable" -e "host unreachable" dig.out.test$n | wc -l) -eq 3 || ret=1 grep -F "status: NOERROR" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret))