From edaa5f5d2a221dade97ef8c7892f0b6b7a50ddec Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Mon, 22 May 2023 14:20:29 +0200 Subject: [PATCH] Reorder dead primary checks in upforwd test 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 | 74 +++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh index 34c3ca40ce..7c0e01796c 100644 --- a/bin/tests/system/upforwd/tests.sh +++ b/bin/tests/system/upforwd/tests.sh @@ -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 -- - < /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 -- - < /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)"