mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Do not ignore dig exit codes
Make sure the "legacy" system test fails if any exit code returned by dig does not match the expected one.
This commit is contained in:
parent
effd16ab25
commit
4dea5cb799
1 changed files with 9 additions and 9 deletions
|
|
@ -98,7 +98,7 @@ status=`expr $status + $ret`
|
|||
n=`expr $n + 1`
|
||||
echo_i "checking drop edns server setup ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS +edns @10.53.0.2 dropedns soa > dig.out.1.test$n
|
||||
$DIG $DIGOPTS +edns @10.53.0.2 dropedns soa > dig.out.1.test$n && ret=1
|
||||
grep "connection timed out; no servers could be reached" dig.out.1.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +noedns @10.53.0.2 dropedns soa > dig.out.2.test$n || ret=1
|
||||
grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
|
||||
|
|
@ -106,7 +106,7 @@ grep "EDNS: version:" dig.out.2.test$n > /dev/null && ret=1
|
|||
$DIG $DIGOPTS +noedns +tcp @10.53.0.2 dropedns 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
|
||||
$DIG $DIGOPTS +edns +tcp @10.53.0.2 dropedns soa > dig.out.4.test$n
|
||||
$DIG $DIGOPTS +edns +tcp @10.53.0.2 dropedns soa > dig.out.4.test$n && ret=1
|
||||
grep "connection timed out; no servers could be reached" dig.out.4.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
|
@ -121,9 +121,9 @@ status=`expr $status + $ret`
|
|||
n=`expr $n + 1`
|
||||
echo_i "checking drop edns + no tcp server setup ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS +edns @10.53.0.3 dropedns-notcp soa > dig.out.1.test$n
|
||||
$DIG $DIGOPTS +edns @10.53.0.3 dropedns-notcp soa > dig.out.1.test$n && ret=1
|
||||
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
|
||||
$DIG $DIGOPTS +noedns +tcp @10.53.0.3 dropedns-notcp soa > dig.out.2.test$n && ret=1
|
||||
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
|
||||
|
|
@ -179,9 +179,9 @@ $DIG $DIGOPTS +edns @10.53.0.6 edns512 soa > dig.out.1.test$n || ret=1
|
|||
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +edns +tcp @10.53.0.6 edns512 soa > dig.out.2.test$n || ret=1
|
||||
grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +edns +dnssec @10.53.0.6 edns512 soa > dig.out.3.test$n
|
||||
$DIG $DIGOPTS +edns +dnssec @10.53.0.6 edns512 soa > dig.out.3.test$n && ret=1
|
||||
grep "connection timed out; no servers could be reached" dig.out.3.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +edns +dnssec +bufsize=512 +ignore @10.53.0.6 edns512 soa > dig.out.4.test$n
|
||||
$DIG $DIGOPTS +edns +dnssec +bufsize=512 +ignore @10.53.0.6 edns512 soa > dig.out.4.test$n || ret=1
|
||||
grep "status: NOERROR" dig.out.4.test$n > /dev/null || ret=1
|
||||
grep "flags:.* tc[ ;]" dig.out.4.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
|
|
@ -199,11 +199,11 @@ echo_i "checking edns 512 + no tcp server setup ($n)"
|
|||
ret=0
|
||||
$DIG $DIGOPTS +edns @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 +edns +tcp @10.53.0.7 edns512-notcp soa > dig.out.2.test$n
|
||||
$DIG $DIGOPTS +edns +tcp @10.53.0.7 edns512-notcp soa > dig.out.2.test$n && ret=1
|
||||
grep "connection refused" dig.out.2.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +edns +dnssec @10.53.0.7 edns512-notcp soa > dig.out.3.test$n
|
||||
$DIG $DIGOPTS +edns +dnssec @10.53.0.7 edns512-notcp soa > dig.out.3.test$n && ret=1
|
||||
grep "connection timed out; no servers could be reached" dig.out.3.test$n > /dev/null || ret=1
|
||||
$DIG $DIGOPTS +edns +dnssec +bufsize=512 +ignore @10.53.0.7 edns512-notcp soa > dig.out.4.test$n
|
||||
$DIG $DIGOPTS +edns +dnssec +bufsize=512 +ignore @10.53.0.7 edns512-notcp soa > dig.out.4.test$n || ret=1
|
||||
grep "status: NOERROR" dig.out.4.test$n > /dev/null || ret=1
|
||||
grep "flags:.* tc[ ;]" dig.out.4.test$n > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue