]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Update tests since we now filter on CNAME chains
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Aug 2020 15:45:42 +0000 (17:45 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 24 Aug 2020 15:29:41 +0000 (17:29 +0200)
regression-tests.recursor/RPZ/expected_result
regression-tests.recursor/config.sh

index 53fd203f0d7f23d50c3761f53f92e3af94443e5e..c8a866e80fe7f7c2a84192dd981266df60d03056 100644 (file)
@@ -20,8 +20,8 @@ Rcode: 3 (Non-Existent domain), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
 ==> www.trillian.example.net has no RPZ policy attached, so lookup should succeed
 Reply to question for qname='www.trillian.example.net.', qtype=A
 Rcode: 0 (No Error), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
-0      www.trillian.example.net.       IN      CNAME   15      www2.arthur.example.net.
-0      www2.arthur.example.net.        IN      A       15      192.0.2.6
+0      www.trillian.example.net.       IN      CNAME   15      www3.arthur.example.net.
+0      www3.arthur.example.net.        IN      A       15      192.0.2.6
 ==> www.hijackme.example.net is served on ns.hijackme.example.net, which should be NXDOMAIN
 Reply to question for qname='www.hijackme.example.net.', qtype=A
 Rcode: 3 (Non-Existent domain), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
@@ -64,7 +64,9 @@ Rcode: 3 (Non-Existent domain), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
 Reply to question for qname='not-rpz.example.net.', qtype=A
 Rcode: 3 (Non-Existent domain), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
 0      not-rpz.example.net.    IN      CNAME   5       rpz-not.com.
+1      .       IN      SOA     15      ns.example.net. hostmaster.example.net. 1 3600 1800 1209600 300
 ==> echo-me.wildcard-target.example.net is an RPZ wildcard target
 Reply to question for qname='echo-me.wildcard-target.example.net.', qtype=A
 Rcode: 3 (Non-Existent domain), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
 0      echo-me.wildcard-target.example.net.    IN      CNAME   7200    echo-me.wildcard-target.example.net.walled-garden.example.net.
+1      example.net.    IN      SOA     15      ns.example.net. hostmaster.example.net. 1 3600 1800 1209600 300
index aad5387c45eaa5d8cf908ae82bbc385dfe0e583c..5e2b46dd1e40d78d506ace0684df126065f19348 100755 (executable)
@@ -137,6 +137,7 @@ ns.arthur.example.net.   3600 IN A   $PREFIX.12
 ns2.arthur.example.net.  3600 IN A   $PREFIX.13
 www.arthur.example.net.  3600 IN A   192.0.2.2
 www2.arthur.example.net. 3600 IN A   192.0.2.6
+www3.arthur.example.net. 3600 IN A   192.0.2.6
 mail.arthur.example.net. 3600 IN A   192.0.2.3
 big.arthur.example.net.  3600 IN TXT "the quick brown fox jumps over the lazy dog"
 big.arthur.example.net.  3600 IN TXT "The quick brown fox jumps over the lazy dog"
@@ -243,7 +244,7 @@ cat > $PREFIX.16/trillian.example.net.zone <<EOF
 trillian.example.net.         3600 IN SOA $SOA
 trillian.example.net.         3600 IN NS  ns.trillian.example.net.
 ns.trillian.example.net.      3600 IN A     $PREFIX.16
-www.trillian.example.net.     3600 IN CNAME www2.arthur.example.net.
+www.trillian.example.net.     3600 IN CNAME www3.arthur.example.net.
 EOF
 
 cat > $PREFIX.16/prequery.lua <<EOF
@@ -258,7 +259,7 @@ function prequery ( dnspacket )
     then
         dnspacket:setRcode(pdns.NXDOMAIN)
         ret = {}
-        ret[1] = newDR(newDN(qname), "CNAME", 3600, "www2.arthur.example.net", 1)
+        ret[1] = newDR(newDN(qname), "CNAME", 3600, "www3.arthur.example.net", 1)
         ret[2] = newDR(newDN(""), "SOA", 3600, "$SOA", 2)
         dnspacket:addRecords(ret)
         return true
@@ -602,7 +603,8 @@ cat > recursor-service3/rpz.zone <<EOF
 
 arthur.example.net     CNAME .                   ; NXDOMAIN on apex
 *.arthur.example.net   CNAME *.                  ; NODATA for everything below the apex
-srv.arthur.example.net CNAME rpz-passthru.       ; Allow this name though
+www3.arthur.example.net CNAME rpz-passthru.      ; Allow this name through (so that the CNAME from www.trillian.example.net is not blocked)
+srv.arthur.example.net CNAME rpz-passthru.       ; Allow this name through
 www.example.net        CNAME www2.example.net.   ; Local-Data Action
 www3.example.net       CNAME www4.example.net.   ; Local-Data Action (to be changed in preresolve)
 www5.example.net       A     192.0.2.15          ; Override www5.example.net.