]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Optimize dig parameters to decrease test run time
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:49 +0000 (11:11 +0200)
Performing server setup checks using "+tries=3 +time=5" is redundant as
a single query is arguably good enough for determining whether a given
named instance was set up properly.  Only use multiple queries with a
long timeout for resolution checks in the "legacy" system test, in order
to significantly reduce its run time (on a contemporary machine, from
about 1m45s to 0m40s).

(cherry picked from commit 47b850348cbc2961bc44eb31c05cd620e5fc35f0)

bin/tests/system/legacy/tests.sh

index 34d00d10211d1b973e4347a79bfde74e8ce3a599..ce22016935bc643eaa0826090de5f31d206a162b 100755 (executable)
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
-DIGOPTS="-p ${PORT} +tries=3 +time=5"
+DIGOPTS="-p ${PORT} +tries=1 +time=2"
 
 # Check whether the SOA record for the name provided in $1 can be resolved by
 # ns1.  Return 0 if resolution succeeds as expected; return 1 otherwise.
 resolution_succeeds() {
        _ret=0
-       $DIG $DIGOPTS +tcp @10.53.0.1 ${1} SOA > dig.out.test$n || _ret=1
+       $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} SOA > dig.out.test$n || _ret=1
        grep "status: NOERROR" dig.out.test$n > /dev/null || _ret=1
        return $_ret
 }
@@ -31,7 +31,7 @@ resolution_succeeds() {
 resolution_fails() {
        _servfail=0
        _timeout=0
-       $DIG $DIGOPTS +tcp @10.53.0.1 ${1} SOA > dig.out.test$n
+       $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} SOA > dig.out.test$n
        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