]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle dig timing out gracefully in logfileconfig
authorTom Krizek <tkrizek@isc.org>
Fri, 5 Jan 2024 14:08:05 +0000 (15:08 +0100)
committerTom Krizek <tkrizek@isc.org>
Mon, 8 Jan 2024 16:03:34 +0000 (17:03 +0100)
bin/tests/system/logfileconfig/tests.sh

index f5c9b45c8cd619bec16a2ac2bf0a00fcbf2258bb..e738dbd66f496babf6242516a5eb18c28034ba4d 100644 (file)
@@ -174,7 +174,7 @@ copy_setports ns1/named.versconf.in ns1/named.conf
 # a seconds since epoch version number
 touch ns1/named_vers.1480039317
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
-$DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n
+$DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n || ret=1
 grep "status: NOERROR" dig.out.test$n >/dev/null || ret=1
 # we are configured to retain five logfiles (a current file
 # and 4 backups). so files with version number 5 or higher
@@ -195,8 +195,8 @@ touch ns1/named_ts.1480039317
 touch ns1/named_ts.20150101120000120
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 _found2() (
-  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n
-  grep "status: NOERROR" dig.out.test$n >/dev/null || ret=1
+  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n || return 1
+  grep "status: NOERROR" dig.out.test$n >/dev/null || return 1
 
   # we are configured to keep three versions, so the oldest
   # timestamped versions should be gone, and there should
@@ -221,8 +221,8 @@ while test $try -lt 12; do
 done
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 _found2() (
-  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n
-  grep "status: NOERROR" dig.out.test$n >/dev/null || ret=1
+  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n || return 1
+  grep "status: NOERROR" dig.out.test$n >/dev/null || return 1
 
   try=1
   while test $try -lt 12; do
@@ -247,8 +247,8 @@ while test $try -lt 12; do
 done
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 _found2() (
-  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n
-  grep "status: NOERROR" dig.out.test$n >/dev/null || ret=1
+  $DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n || return 1
+  grep "status: NOERROR" dig.out.test$n >/dev/null || return 1
 
   try=1
   while test $try -lt 12; do
@@ -269,7 +269,7 @@ copy_setports ns1/named.unlimited.in ns1/named.conf
 # a seconds since epoch version number
 touch ns1/named_unlimited.1480039317
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
-$DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n
+$DIG version.bind txt ch @10.53.0.1 -p ${PORT} >dig.out.test$n || ret=1
 grep "status: NOERROR" dig.out.test$n >/dev/null || ret=1
 test_with_retry -f ns1/named_unlimited.1480039317 || ret=1
 test_with_retry -f ns1/named_unlimited.4 || ret=1