From a095388207738f70bd4bbe3fc88dbdb769e01301 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Fri, 5 Jan 2024 15:07:40 +0100 Subject: [PATCH] Handle dig timing out gracefully in legacy (cherry picked from commit 2cc90a815e60198e59aa5ba290a79cd433d2cd72) --- bin/tests/system/legacy/tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/legacy/tests.sh b/bin/tests/system/legacy/tests.sh index 7cae407d0a..3a9e4caa67 100755 --- a/bin/tests/system/legacy/tests.sh +++ b/bin/tests/system/legacy/tests.sh @@ -33,7 +33,7 @@ resolution_succeeds() { resolution_fails() { _servfail=0 _timeout=0 - $DIG $DIGOPTS +tcp +time=5 @10.53.0.1 ${1} SOA >dig.out.test$n + $DIG $DIGOPTS +tcp +time=5 @10.53.0.1 ${1} SOA >dig.out.test$n || true grep "status: SERVFAIL" dig.out.test$n >/dev/null && _servfail=1 grep "connection timed out" dig.out.test$n >/dev/null && _timeout=1 if [ $_servfail -eq 1 ] || [ $_timeout -eq 1 ]; then @@ -152,7 +152,7 @@ ret=0 $DIG $DIGOPTS +edns @10.53.0.4 plain soa >dig.out.1.test$n || ret=1 grep "status: NOERROR" dig.out.1.test$n >/dev/null || ret=1 grep "EDNS: version:" dig.out.1.test$n >/dev/null && ret=1 -$DIG $DIGOPTS +edns +tcp @10.53.0.4 plain soa >dig.out.2.test$n +$DIG $DIGOPTS +edns +tcp @10.53.0.4 plain soa >dig.out.2.test$n || ret=1 grep "status: NOERROR" dig.out.2.test$n >/dev/null || ret=1 grep "EDNS: version:" dig.out.2.test$n >/dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi @@ -171,7 +171,7 @@ ret=0 $DIG $DIGOPTS +edns @10.53.0.5 plain-notcp soa >dig.out.1.test$n || ret=1 grep "status: NOERROR" dig.out.1.test$n >/dev/null || ret=1 grep "EDNS: version:" dig.out.1.test$n >/dev/null && ret=1 -$DIG $DIGOPTS +edns +tcp @10.53.0.5 plain-notcp soa >dig.out.2.test$n +$DIG $DIGOPTS +edns +tcp @10.53.0.5 plain-notcp soa >dig.out.2.test$n && ret=1 grep "connection refused" dig.out.2.test$n >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$(expr $status + $ret)