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: rec-3.7.4~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2730%2Fhead;p=thirdparty%2Fpdns.git 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 0000000000..8b1819d1c7 --- /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 0000000000..52478b24d0 --- /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 0000000000..3534b98a0d --- /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 65b8d4a4f9..bad16460ca 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 <