From: Evan Hunt Date: Mon, 15 May 2023 20:22:24 +0000 (-0700) Subject: Match UQ and UR stats to domain name X-Git-Tag: v9.19.14~45^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6bf35c2f19dcfd3a1afcb0f477911978efea6418;p=thirdparty%2Fbind9.git Match UQ and UR stats to domain name 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. --- diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh index 8aeeb3bf316..34c3ca40cec 100644 --- a/bin/tests/system/upforwd/tests.sh +++ b/bin/tests/system/upforwd/tests.sh @@ -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`