]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Regression check for NSEC3 to NSEC conversion
authorMark Andrews <marka@isc.org>
Mon, 18 Dec 2023 00:23:21 +0000 (11:23 +1100)
committerMark Andrews <marka@isc.org>
Thu, 21 Dec 2023 09:12:09 +0000 (20:12 +1100)
When transitioning from NSEC3 to NSEC the NSEC3 must be built before
the NSEC3PARAM is removed.  Check each delta in the conversion to
ensure this ordering is met.

bin/tests/system/autosign/tests.sh

index ba67b3d93dabf6a7fdf6a468f7721d1692f428da..19e95901398b73257a9e245184149e31245411ed 100755 (executable)
@@ -1337,5 +1337,18 @@ n=$((n + 1))
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+echo_i "check that NSEC3 to NSEC builds the NSEC chain first ($n)"
+ret=0
+$JOURNALPRINT ns3/nsec3-to-nsec.example.db.jnl \
+  | awk 'BEGIN { nsec3param=0; nsec=0 }
+$1 == "del" && $5 == "SOA" { if (nsec3param || nsec) { if (nsec3param && !nsec) { exit(1); } else { exit(0); } } }
+$1 == "del" && $5 == "NSEC3PARAM" { nsec3param=1 }
+$1 == "add" && $2 == "nsec3-to-nsec.example." && $5 == "NSEC" { nsec=1 }
+END { if (nsec3param || nsec) { if (nsec3param && !nsec) { exit(1); } else { exit(0); } } else { exit(1); } }
+' || ret=1
+n=$((n + 1))
+if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1