]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Match UQ and UR stats to domain name
authorEvan Hunt <each@isc.org>
Mon, 15 May 2023 20:22:24 +0000 (13:22 -0700)
committerTony Finch <fanf@isc.org>
Tue, 16 May 2023 12:37:07 +0000 (13:37 +0100)
The upforwd test for forwarding updates to a dead primary can continue
running a little bit past its end, causing update replies to be
recorded during a subsequent test case. Correct this by only looking
for update requests and replies for the specific domain name being
tested at any given time.

bin/tests/system/upforwd/tests.sh

index 8aeeb3bf31666e5eb2c0acf5336e734529244334..34c3ca40cecee6309f468a85dc52d958d08ae312 100644 (file)
@@ -41,7 +41,9 @@ capture_dnstap() {
 }
 
 uq_equals_ur() {
+        zonename="$1"
        "$DNSTAPREAD" dnstap.out.$n |
+        awk '$9 ~ /^'$zonename'\// { print }' |
         awk '$3 == "UQ" { UQ+=1 } $3 == "UR" { UR += 1 } END { print UQ+0, UR+0 }' > dnstapread.out$n
         read UQ UR < dnstapread.out$n
        echo_i "UQ=$UQ UR=$UR"
@@ -185,7 +187,7 @@ then
        echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
        ret=0
        capture_dnstap
-       uq_equals_ur || ret=1
+       uq_equals_ur example || ret=1
        if [ $ret != 0 ] ; then echo_i "failed"; fi
        status=`expr $status + $ret`
        n=`expr $n + 1`
@@ -304,7 +306,7 @@ then
        echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
        ret=0
        capture_dnstap
-       uq_equals_ur || ret=1
+       uq_equals_ur example3 || ret=1
        if [ $ret != 0 ] ; then echo_i "failed"; fi
        status=`expr $status + $ret`
        n=`expr $n + 1`
@@ -342,7 +344,7 @@ then
        echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
        ret=0
        capture_dnstap
-       uq_equals_ur && ret=1
+       uq_equals_ur noprimary && ret=1
        if [ $ret != 0 ] ; then echo_i "failed"; fi
        status=`expr $status + $ret`
        n=`expr $n + 1`
@@ -377,7 +379,7 @@ EOF
                echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
                ret=0
                capture_dnstap
-               uq_equals_ur || ret=1
+               uq_equals_ur example2 || ret=1
                if [ $ret != 0 ] ; then echo_i "failed"; fi
                status=`expr $status + $ret`
                n=`expr $n + 1`
@@ -410,7 +412,7 @@ EOF
                echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
                ret=0
                capture_dnstap
-               uq_equals_ur || ret=1
+               uq_equals_ur example2 || ret=1
                if [ $ret != 0 ] ; then echo_i "failed"; fi
                status=`expr $status + $ret`
                n=`expr $n + 1`