From: Pieter Lexis Date: Fri, 4 Sep 2015 08:28:31 +0000 (+0200) Subject: Recursor: add an extensive test for auth-zones X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~60^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33a4f605c4e8c60b3488741cca11cfacc0b6cf06;p=pdns Recursor: add an extensive test for auth-zones --- 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 8b529b2de..6e91f14d6 100755 --- a/regression-tests.recursor/config.sh +++ b/regression-tests.recursor/config.sh @@ -85,6 +85,8 @@ answer-cname-in-local.example.net. 3600 IN NS ns.answer-cname-in-local.example.n pfsbox.answer-cname-in-local.example.net. 3600 IN NS ns.answer-cname-in-local.example.net. box.answer-cname-in-local.example.net. 3600 IN NS ns.answer-cname-in-local.example.net. ns.answer-cname-in-local.example.net. 3600 IN A $PREFIX.22 +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 @@ -360,6 +362,17 @@ vip-reunion.pfsbox.answer-cname-in-local.example.net. 20 IN A 10.1.1.1 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/global.box.answer-cname-in-local.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 <