]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reorder dead primary checks in upforwd test
authorTom Krizek <tkrizek@isc.org>
Mon, 22 May 2023 12:20:29 +0000 (14:20 +0200)
committerTom Krizek <tkrizek@isc.org>
Mon, 22 May 2023 12:24:33 +0000 (14:24 +0200)
The check which attempts to forward dynamic update to a dead primary may
trigger a timing issue #4080. For some reason, this has manifested under
the pytest runner, while the test still passes with the legacy runner.

Move the dead primary check closer to the end of the test to avoid
hitting this issue before we have a proper fix.

bin/tests/system/upforwd/tests.sh

index 34c3ca40cecee6309f468a85dc52d958d08ae312..7c0e01796c7c3143503aed3997cad40c792e427e 100644 (file)
@@ -313,43 +313,6 @@ then
 fi
 n=`expr $n + 1`
 
-echo_i "checking update forwarding to dead primary ($n)"
-count=0
-ret=0
-while [ $count -lt 5 -a $ret -eq 0 ]
-do
-(
-$NSUPDATE -- - <<EOF 
-local 10.53.0.1
-server 10.53.0.3 ${PORT}
-zone noprimary
-update add unsigned.noprimary. 600 A 10.10.10.1
-update add unsigned.noprimary. 600 TXT Foo
-send
-EOF
-) > /dev/null 2>&1 &
-       $DIG -p ${PORT} +noadd +notcp +noauth noprimary. @10.53.0.3 soa > dig.out.ns3.test$n.$count || ret=1
-       grep "status: NOERROR" dig.out.ns3.test$n.$count > /dev/null || ret=1
-       count=`expr $count + 1`
-done
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
-n=`expr $n + 1`
-
-echo_i "waiting for nsupdate to finish ($n)"
-wait
-n=`expr $n + 1`
-
-if $FEATURETEST --enable-dnstap
-then
-       echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
-       ret=0
-       capture_dnstap
-       uq_equals_ur noprimary && ret=1
-       if [ $ret != 0 ] ; then echo_i "failed"; fi
-       status=`expr $status + $ret`
-       n=`expr $n + 1`
-fi
-
 if test -f keyname
 then
        echo_i "checking update forwarding with sig0 (Do53 -> Do53) ($n)"
@@ -434,6 +397,43 @@ grep REFUSED nsupdate.out.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 n=`expr $n + 1`
 
+echo_i "checking update forwarding to dead primary ($n)"
+count=0
+ret=0
+while [ $count -lt 5 -a $ret -eq 0 ]
+do
+(
+$NSUPDATE -- - <<EOF
+local 10.53.0.1
+server 10.53.0.3 ${PORT}
+zone noprimary
+update add unsigned.noprimary. 600 A 10.10.10.1
+update add unsigned.noprimary. 600 TXT Foo
+send
+EOF
+) > /dev/null 2>&1 &
+       $DIG -p ${PORT} +noadd +notcp +noauth noprimary. @10.53.0.3 soa > dig.out.ns3.test$n.$count || ret=1
+       grep "status: NOERROR" dig.out.ns3.test$n.$count > /dev/null || ret=1
+       count=`expr $count + 1`
+done
+if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+n=`expr $n + 1`
+
+echo_i "waiting for nsupdate to finish ($n)"
+wait
+n=`expr $n + 1`
+
+if $FEATURETEST --enable-dnstap
+then
+       echo_i "checking DNSTAP logging of UPDATE forwarded update replies ($n)"
+       ret=0
+       capture_dnstap
+       uq_equals_ur noprimary && ret=1
+       if [ $ret != 0 ] ; then echo_i "failed"; fi
+       status=`expr $status + $ret`
+       n=`expr $n + 1`
+fi
+
 n=$((n + 1))
 ret=0
 echo_i "attempting updates that should exceed quota ($n)"