]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not retry in resolution_fails() on timeout
authorMichal Nowak <mnowak@isc.org>
Wed, 5 Apr 2023 13:55:09 +0000 (15:55 +0200)
committerMichal Nowak <mnowak@isc.org>
Thu, 6 Apr 2023 09:35:48 +0000 (11:35 +0200)
At the time of test number (19), there were 10 "sending packet to
10.53.0.7" lines in the "legacy/ns1/named.run" file; usually, only seven
are present:

    I:legacy:checking recursive lookup to edns 512 + no tcp server does not cause query loops (19)
    I:legacy:ns1 sent 10 queries to ns7, expected less than 10
    I:legacy:failed

Those three can be attributed to tests "8", "10", and "18", where the
dig of "resolution_fails()" retried after a timeout to succeed with
"status: SERVFAIL" subsequently, as seen in each of
dig.out.test{8,10,18} files.

    ;; communications error to 10.53.0.1#13093: timed out

    ; <<>> DiG 9.19.12-dev <<>> -p 13093 +tcp @10.53.0.1 edns512-notcp. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5368
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

This retry is unnecessary because "resolution_fails()" considers timeout
a positive result.

bin/tests/system/legacy/tests.sh

index 0a876ab63b2050e147dd007c1d5557a6e68d536a..0bddac8a75f70463e46db06c18f1e0b5b56de589 100755 (executable)
@@ -32,7 +32,7 @@ resolution_succeeds() {
 resolution_fails() {
        _servfail=0
        _timeout=0
-       $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} TXT > dig.out.test$n
+       $DIG $DIGOPTS +tcp +time=5 @10.53.0.1 ${1} TXT > dig.out.test$n
        grep -F "status: SERVFAIL" dig.out.test$n > /dev/null && _servfail=1
        grep -F "timed out" dig.out.test$n > /dev/null && _timeout=1
        if [ $_servfail -eq 1 ] || [ $_timeout -eq 1 ]; then