]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
make dupsigs test less timing-sensitive
authorEvan Hunt <each@isc.org>
Sun, 30 Oct 2022 08:19:35 +0000 (01:19 -0700)
committerTom Krizek <tkrizek@isc.org>
Mon, 7 Nov 2022 09:29:00 +0000 (10:29 +0100)
the dupsigs test is prone to failing on slow CI machines
because the first test can occur before the zone is fully
signed.

instead of just waiting ten seconds arbitrarily, we now
check every second, and allow up to 30 seconds before giving
up.

(cherry picked from commit d9b85cbaaeda81d5f5351a1b463ad7e509bf76cf)

bin/tests/system/dupsigs/tests.sh

index 87f9347e4f645a277ba0433c1ee9023bd3d5b783..8cd81d60eb20a35be78ee808d1b976d47d2ec524 100644 (file)
@@ -13,13 +13,30 @@ SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
 status=0
+
+# Wait for the zone to be fully signed before beginning test
+#
+# We expect the zone to have the following:
+#
+# - 5 signatures for signing.test.
+# - 3 signatures for ns.signing.test.
+# - 2 x 500 signatures for a{0000-0499}.signing.test.
+#
+# for a total of 1008.
+fully_signed () {
+        $DIG axfr signing.test -p ${PORT} @10.53.0.1 |
+                awk 'BEGIN { lines = 0 }
+                     $4 == "RRSIG" {lines++}
+                     END { if (lines != 1008) exit(1) }'
+}
+retry_quiet 30 fully_signed || ret=1
+
 start=`date +%s`
-end=`expr $start + 150`
-sleep 10  # wait for a bit for the initial signing
-now=`expr $start + 10`
-while test $now -lt $end
-do
-       et=`expr $now - $start`
+now=$start
+end=$((start + 140))
+
+while [ $now -lt $end ]; do
+        et=$((now - start))
        echo "=============== $et ============"
        $JOURNALPRINT ns1/signing.test.db.signed.jnl | $PERL check_journal.pl
        $DIG axfr signing.test -p ${PORT} @10.53.0.1 > dig.out.at$et
@@ -28,7 +45,7 @@ do
        if [ ${et} -ne 0 -a ${lines} -ne 1009 ]
        then
                echo_i "failed"
-               status=`expr $status + 1`
+                status=$((status + 1))
        fi
        sleep 5
        now=`date +%s`