From 4d94f8223277560800ac39cbb3429c798e16ddb5 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sat, 8 May 2021 10:53:09 -0700 Subject: [PATCH] system test Attempt a zone transfer with mismatched SOA records. --- bin/tests/system/xfer/ans5/soamismatch | 10 ++++++++++ bin/tests/system/xfer/tests.sh | 19 +++++++++++++++++++ util/copyrights | 1 + 3 files changed, 30 insertions(+) create mode 100644 bin/tests/system/xfer/ans5/soamismatch diff --git a/bin/tests/system/xfer/ans5/soamismatch b/bin/tests/system/xfer/ans5/soamismatch new file mode 100644 index 0000000000..14cfa4165c --- /dev/null +++ b/bin/tests/system/xfer/ans5/soamismatch @@ -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 diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index ec98194451..330f8f7e64 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -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 diff --git a/util/copyrights b/util/copyrights index 96f8dd7eec..22a6cbc908 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1000,6 +1000,7 @@ ./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