]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Properly test servers with TCP support disabled
authorMichał Kępień <michal@isc.org>
Wed, 29 May 2019 09:05:01 +0000 (11:05 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 29 May 2019 09:11:03 +0000 (11:11 +0200)
Sending TCP queries to test named instances with TCP support disabled
should cause dig output to contain the phrase "connection refused", not
"connection timed out", as such instances never open the relevant
sockets.  Make sure that the "legacy" system test fails if the expected
phrase is not found in any of the relevant files containing dig output.

(cherry picked from commit 9491616e5cd412e30cd2802d963a3f024af9399e)

bin/tests/system/legacy/tests.sh

index c93a0dc75d1cc575b608973a2671188d4bd99809..31c1e048302dae47a90c6ca50f040ef9d59f679b 100755 (executable)
@@ -47,7 +47,7 @@ ret=0
 $DIG $DIGOPTS +edns @10.53.0.3 dropedns-notcp soa > dig.out.1.test$n
 grep "connection timed out; no servers could be reached" dig.out.1.test$n > /dev/null || ret=1
 $DIG $DIGOPTS +noedns +tcp @10.53.0.3 dropedns-notcp soa > dig.out.2.test$n
-grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
+grep "connection refused" dig.out.2.test$n > /dev/null || ret=1
 $DIG $DIGOPTS +noedns @10.53.0.3 dropedns-notcp soa > dig.out.3.test$n || ret=1
 grep "status: NOERROR" dig.out.3.test$n > /dev/null || ret=1
 grep "EDNS: version:" dig.out.3.test$n > /dev/null && ret=1
@@ -86,7 +86,7 @@ $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
-grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
+grep "connection refused" dig.out.2.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -126,7 +126,7 @@ ret=0
 $DIG $DIGOPTS +noedns @10.53.0.7 edns512-notcp soa > dig.out.1.test$n || ret=1
 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
 $DIG $DIGOPTS +noedns +tcp @10.53.0.7 edns512-notcp soa > dig.out.2.test$n
-grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
+grep "connection refused" dig.out.2.test$n > /dev/null || ret=1
 $DIG $DIGOPTS +edns @10.53.0.7 edns512-notcp soa > dig.out.3.test$n
 grep "connection timed out; no servers could be reached" dig.out.3.test$n > /dev/null
 $DIG $DIGOPTS +edns +bufsize=512 +ignor @10.53.0.7 edns512-notcp soa > dig.out.4.test$n