From 5d8147fa7044702620ce296615d5231310fc07b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 23 Apr 2019 14:59:05 +0200 Subject: [PATCH 1/2] Remove redundant sleeps In the "nsupdate" system test, do not sleep before checking results of changes which are expected to be processed synchronously, i.e. before nsupdate returns. (cherry picked from commit 1c8e5ea33366094dc77f63fa8e728bb0f7691c8c) --- bin/tests/system/nsupdate/tests.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 901cd22f57..d5c0f07e9b 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -424,8 +424,6 @@ update add example 3600 nsec3param 1 0 0 - send EOF -sleep 1 - # the zone is not signed. The nsec3param records should be removed. # this also proves that the server is still running. $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocmd +norec example.\ @@ -443,8 +441,6 @@ update add nsec3param.test 3600 NSEC3PARAM 1 0 1 - send EOF -sleep 1 - $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocmd +norec nsec3param.test.\ @10.53.0.3 nsec3param > dig.out.ns3.$n || ret=1 grep "ANSWER: 1" dig.out.ns3.$n > /dev/null || ret=1 From 4e2cc911d2ceb90ec04605451fb1bb518ef75cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 23 Apr 2019 14:59:05 +0200 Subject: [PATCH 2/2] Wait more than 1 second for NSEC3 chain changes One second may not be enough for an NSEC3 chain change triggered by an UPDATE message to complete. Wait up to 10 seconds when checking whether a given NSEC3 chain change is complete in the "nsupdate" system test. (cherry picked from commit f8746cddbce838fec2a28f00617df6af1319fbc8) --- bin/tests/system/nsupdate/tests.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index d5c0f07e9b..4da48490b6 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -450,18 +450,24 @@ grep "flags:[^;]* aa[ ;]" dig.out.ns3.$n > /dev/null || ret=1 n=`expr $n + 1` ret=0 -echo_i "add a new the NSEC3PARAM via update ($n)" +echo_i "add a new NSEC3PARAM via update ($n)" $NSUPDATE << EOF server 10.53.0.3 ${PORT} update add nsec3param.test 3600 NSEC3PARAM 1 0 4 - send EOF -sleep 1 +_ret=1 +for i in 0 1 2 3 4 5 6 7 8 9; do + $DIG $DIGOPTS +tcp +norec +time=1 +tries=1 @10.53.0.3 nsec3param.test. NSEC3PARAM > dig.out.ns3.$n || _ret=1 + if grep "ANSWER: 2" dig.out.ns3.$n > /dev/null; then + _ret=0 + break + fi + sleep 1 +done -$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocmd +norec nsec3param.test.\ - @10.53.0.3 nsec3param > dig.out.ns3.$n || ret=1 -grep "ANSWER: 2" dig.out.ns3.$n > /dev/null || ret=1 +if [ $_ret -ne 0 ]; then ret=1; fi grep "NSEC3PARAM 1 0 4 -" dig.out.ns3.$n > /dev/null || ret=1 grep "flags:[^;]* aa[ ;]" dig.out.ns3.$n > /dev/null || ret=1 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $ret + $status`; fi @@ -476,11 +482,17 @@ update add nsec3param.test 7200 NSEC3PARAM 1 0 5 - send EOF -sleep 1 +_ret=1 +for i in 0 1 2 3 4 5 6 7 8 9; do + $DIG $DIGOPTS +tcp +norec +time=1 +tries=1 @10.53.0.3 nsec3param.test. NSEC3PARAM > dig.out.ns3.$n || _ret=1 + if grep "ANSWER: 1" dig.out.ns3.$n > /dev/null; then + _ret=0 + break + fi + sleep 1 +done -$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocmd +norec nsec3param.test.\ - @10.53.0.3 nsec3param > dig.out.ns3.$n || ret=1 -grep "ANSWER: 1" dig.out.ns3.$n > /dev/null || ret=1 +if [ $_ret -ne 0 ]; then ret=1; fi grep "7200.*NSEC3PARAM 1 0 5 -" dig.out.ns3.$n > /dev/null || ret=1 grep "flags:[^;]* aa[ ;]" dig.out.ns3.$n > /dev/null || ret=1 $JOURNALPRINT ns3/nsec3param.test.db.signed.jnl > jp.out.ns3.$n