]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
system test
authorEvan Hunt <each@isc.org>
Sat, 8 May 2021 17:53:09 +0000 (10:53 -0700)
committerMark Andrews <marka@isc.org>
Thu, 13 May 2021 03:36:50 +0000 (03:36 +0000)
Attempt a zone transfer with mismatched SOA records.

bin/tests/system/xfer/ans5/soamismatch [new file with mode: 0644]
bin/tests/system/xfer/tests.sh
util/copyrights

diff --git a/bin/tests/system/xfer/ans5/soamismatch b/bin/tests/system/xfer/ans5/soamismatch
new file mode 100644 (file)
index 0000000..14cfa41
--- /dev/null
@@ -0,0 +1,10 @@
+/SOA tsig_key LSAnCU+Z/
+nil.           300     SOA     ns.nil. root.nil. 1 300 300 604800 300
+/AXFR tsig_key LSAnCU+Z/
+nil.           300     SOA     ns.nil. root.nil. 1 300 300 604800 300
+/AXFR tsig_key LSAnCU+Z/
+nil.           300     NS      ns.nil.
+nil.           300     TXT     "SOA mismatch AXFR"
+a.nil.         60      A       10.0.0.61
+/AXFR tsig_key LSAnCU+Z/
+nil.           300     SOA     whatever. other. 1 300 300 604800 300
index ec98194451f892187e55c77b7838ab0e7ac8bc76..330f8f7e64522cd1daeaae34c61c4910147af0e7 100755 (executable)
@@ -428,6 +428,25 @@ $DIGCMD nil. TXT | grep 'bad message id' >/dev/null && {
     status=$((status+1))
 }
 
+n=$((n+1))
+echo_i "mismatched SOA ($n)"
+
+sendcmd < ans5/soamismatch
+
+$RNDCCMD 10.53.0.4 retransfer nil | sed 's/^/ns4 /' | cat_i
+
+sleep 2
+
+nextpart ns4/named.run | grep "Transfer status: FORMERR" > /dev/null || {
+    echo_i "failed: expected status was not logged"
+    status=$((status+1))
+}
+
+$DIGCMD nil. TXT | grep 'SOA mismatch AXFR' >/dev/null && {
+    echo_i "failed"
+    status=$((status+1))
+}
+
 n=$((n+1))
 echo_i "check that we ask for and get a EDNS EXPIRE response ($n)"
 # force a refresh query
index 96f8dd7eec6c712ded7a566a5fdcf38a36151793..22a6cbc908090ee2b5584dc2a1d6978f27f5c475 100644 (file)
 ./bin/tests/system/xfer/ans5/badmessageid      X       2020,2021
 ./bin/tests/system/xfer/ans5/goodaxfr          X       2011,2018,2019,2020,2021
 ./bin/tests/system/xfer/ans5/partial           X       2011,2018,2019,2020,2021
+./bin/tests/system/xfer/ans5/soamismatch       X       2021
 ./bin/tests/system/xfer/ans5/unknownkey                X       2011,2018,2019,2020,2021
 ./bin/tests/system/xfer/ans5/unsigned          X       2011,2018,2019,2020,2021
 ./bin/tests/system/xfer/ans5/wrongkey          X       2011,2018,2019,2020,2021