]> 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>
Tue, 2 Jan 2024 22:25:43 +0000 (09:25 +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.

(cherry picked from commit 7d90c056b039cc943413d82e4c9c748b45c60893)

bin/tests/system/autosign/tests.sh

index fb50de4a98873fecb716fd25d3f46ef0527addb6..a6283d50545802b40a815755250254176cba0484 100755 (executable)
@@ -1806,5 +1806,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