From 6ea67cfc91ae2d6f818f7b006756e373ea4145b9 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 4 Sep 2015 10:28:31 +0200 Subject: [PATCH] Recursor: add an extensive test for auth-zones --- regression-tests.recursor/auth-zones/command | 4 ++ .../auth-zones/description | 3 ++ .../auth-zones/expected_result | 14 +++++++ regression-tests.recursor/config.sh | 41 +++++++++++++++++-- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100755 regression-tests.recursor/auth-zones/command create mode 100644 regression-tests.recursor/auth-zones/description create mode 100644 regression-tests.recursor/auth-zones/expected_result diff --git a/regression-tests.recursor/auth-zones/command b/regression-tests.recursor/auth-zones/command new file mode 100755 index 000000000..8b1819d1c --- /dev/null +++ b/regression-tests.recursor/auth-zones/command @@ -0,0 +1,4 @@ +cleandig host1.auth-zone.example.net. A | sed 's/\(.*\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\13600/' +cleandig host1.auth-zone.example.net. AAAA | sed 's/\(.*\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\13600/' +cleandig host2.auth-zone.example.net. A | sed 's/\(.*\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\13600/' +cleandig host3.auth-zone.example.net. A | sed 's/\(.*\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\13600/' diff --git a/regression-tests.recursor/auth-zones/description b/regression-tests.recursor/auth-zones/description new file mode 100644 index 000000000..52478b24d --- /dev/null +++ b/regression-tests.recursor/auth-zones/description @@ -0,0 +1,3 @@ +Test 3 direct queries for data in an auth-zone. 2 records that are in-zone, +one that is a CNAME to a name inside another auth-zone and a final one that is a +CNAME to a record in a zone where the recursor is not authoritative for. diff --git a/regression-tests.recursor/auth-zones/expected_result b/regression-tests.recursor/auth-zones/expected_result new file mode 100644 index 000000000..3534b98a0 --- /dev/null +++ b/regression-tests.recursor/auth-zones/expected_result @@ -0,0 +1,14 @@ +0 host1.auth-zone.example.net. IN A 3600 127.0.0.55 +Rcode: 0, RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0 +Reply to question for qname='host1.auth-zone.example.net.', qtype=A +0 host1.auth-zone.example.net. IN AAAA 3600 2001:db8::1:45ba +Rcode: 0, RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0 +Reply to question for qname='host1.auth-zone.example.net.', qtype=AAAA +0 host1.another-auth-zone.example.net. IN A 3600 127.0.0.56 +0 host2.auth-zone.example.net. IN CNAME 3600 host1.another-auth-zone.example.net. +Rcode: 0, RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0 +Reply to question for qname='host2.auth-zone.example.net.', qtype=A +0 host1.not-auth-zone.example.net. IN A 3600 127.0.0.57 +0 host3.auth-zone.example.net. IN CNAME 3600 host1.not-auth-zone.example.net. +Rcode: 0, RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0 +Reply to question for qname='host3.auth-zone.example.net.', qtype=A diff --git a/regression-tests.recursor/config.sh b/regression-tests.recursor/config.sh index 65b8d4a4f..bad16460c 100755 --- a/regression-tests.recursor/config.sh +++ b/regression-tests.recursor/config.sh @@ -81,6 +81,8 @@ hijackme.example.net. 3600 IN NS ns.hijackme.example.net. ns.hijackme.example.net. 3600 IN A $PREFIX.20 hijacker.example.net. 3600 IN NS ns.hijacker.example.net. ns.hijacker.example.net. 3600 IN A $PREFIX.21 +not-auth-zone.example.net. 3600 IN NS ns.not-auth-zone.example.net. +ns.not-auth-zone.example.net. 3600 IN A $PREFIX.23 EOF mkdir $PREFIX.11 @@ -328,6 +330,37 @@ www.hijackme.example.net. 20 IN A 192.0.2.21 EOF +# Used for the auth-zones test, to test a CNAME inside an auth-zone to a name +# outside of and auth-zone +mkdir $PREFIX.23 +cat > $PREFIX.23/not-auth-zone.example.net.zone < recursor-service/auth-zone.example.net.zone < recursor-service/another-auth-zone.example.net.zone < $dir/pdns.conf < recursor-service/recursor.conf << EOF -socket-dir=$(pwd)/recursor-service -EOF \ No newline at end of file +cat > recursor-service/recursor.conf <