]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix DiG "timed out" message check in "legacy" system test
authorAram Sargsyan <aram@isc.org>
Wed, 21 Dec 2022 13:52:22 +0000 (13:52 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 21 Dec 2022 14:32:18 +0000 (14:32 +0000)
The test expects a "connection timed out" message from DiG when it
experiences a timeout, while the current version of DiG prints just
a "timed out" message, like below:

    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out

    ; <<>> DiG 9.19.9-dev <<>> -p 11314 +tries +time +tcp +tries +time @10.53.0.1 dropedns. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; no servers could be reached

Change the expected string to match the current DiG output.

Use the '-F' switch for "grep" for matching a fixed string.

(cherry picked from commit 35988748f31fbbd23048ce63dced74bd4fd4e0f2)

bin/tests/system/legacy/tests.sh

index 4df0871b6082baaf6704823d1fc94ec616fb9899..0a876ab63b2050e147dd007c1d5557a6e68d536a 100755 (executable)
@@ -33,8 +33,8 @@ resolution_fails() {
        _servfail=0
        _timeout=0
        $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} TXT > 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
+       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
                return 0
        else