]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
qname minimization: fix tests
authorWitold Kręcicki <wpk@isc.org>
Fri, 18 May 2018 18:00:31 +0000 (20:00 +0200)
committerWitold Kręcicki <wpk@isc.org>
Tue, 12 Jun 2018 07:18:47 +0000 (09:18 +0200)
12 files changed:
bin/tests/system/additional/ns2/named.conf.in [new file with mode: 0644]
bin/tests/system/additional/ns2/root.db [new file with mode: 0644]
bin/tests/system/additional/ns3/root.hint
bin/tests/system/additional/setup.sh
bin/tests/system/reclimit/ns3/named1.conf.in
bin/tests/system/reclimit/ns3/named2.conf.in
bin/tests/system/reclimit/ns3/named3.conf.in
bin/tests/system/reclimit/ns3/named4.conf.in
bin/tests/system/resolver/ans2/ans.pl
bin/tests/system/resolver/ans3/ans.pl
bin/tests/system/statistics/ns3/named.conf.in
util/copyrights

diff --git a/bin/tests/system/additional/ns2/named.conf.in b/bin/tests/system/additional/ns2/named.conf.in
new file mode 100644 (file)
index 0000000..1437ec4
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+       query-source address 10.53.0.2;
+       notify-source 10.53.0.2;
+       transfer-source 10.53.0.2;
+       recursion no;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.2; };
+       listen-on-v6 { none; };
+       notify no;
+       minimal-responses yes;
+};
+
+zone "." {
+       type master;
+       file "root.db";
+};
diff --git a/bin/tests/system/additional/ns2/root.db b/bin/tests/system/additional/ns2/root.db
new file mode 100644 (file)
index 0000000..c5371e1
--- /dev/null
@@ -0,0 +1,10 @@
+. IN SOA ns2. hostmaster ( 2 8H 2H 4W 1D);
+. NS ns2.
+ns1. A 10.53.0.1
+ns2. A 10.53.0.2
+rt.example. NS ns1.
+naptr.example. NS ns1.
+rt2.example. NS ns1.
+naptr2.example. NS ns1.
+nid.example. NS ns1.
+
index c1784c7ee88d021336c4ed23124a7a30c2b1b2ba..775f78235a968dd03e4975ec78ceb8c53bfe7a1d 100644 (file)
@@ -7,5 +7,5 @@
 ; See the COPYRIGHT file distributed with this work for additional
 ; information regarding copyright ownership.
 
-. NS ns1.
-ns1. A 10.53.0.1
+. NS ns2.
+ns2. A 10.53.0.2
index 417a8b872f18cb391012a5b64f8cf72241d393de..5f432530798f037109022dbb8d2404264008b761 100644 (file)
@@ -14,4 +14,5 @@ SYSTEMTESTTOP=..
 
 $SHELL clean.sh
 copy_setports ns1/named1.conf.in ns1/named.conf
+copy_setports ns2/named.conf.in ns2/named.conf
 copy_setports ns3/named.conf.in ns3/named.conf
index a649db11e330f21d512ba7f309563c94853a28ee..6275d5904a4b39a84172ed001af0248d3b485d14 100644 (file)
@@ -19,6 +19,7 @@ options {
        listen-on { 10.53.0.3; };
        listen-on-v6 { none; };
        servfail-ttl 0;
+       qname-minimization disabled;
        max-recursion-depth 12;
        recursion yes;
        dnssec-validation yes;
index 806eb5170ee20c930fcbbfbba80c5478637d9493..3d6d27e912c35a895289d2deec32e585879a96ac 100644 (file)
@@ -19,6 +19,7 @@ options {
        listen-on { 10.53.0.3; };
        listen-on-v6 { none; };
        servfail-ttl 0;
+       qname-minimization disabled;
        max-recursion-depth 5;
        recursion yes;
        dnssec-validation yes;
index a0c87a2dd9157af4fcfc42842c665cf8dbbd9a69..57dbf032f7a620de32bb745be7c4e909209bb4c4 100644 (file)
@@ -19,6 +19,7 @@ options {
        listen-on { 10.53.0.3; };
        listen-on-v6 { none; };
        servfail-ttl 0;
+       qname-minimization disabled;
        max-recursion-depth 100;
        max-recursion-queries 50;
        recursion yes;
index dd254ad6a142607f8ef0e01af6f853f4fed392b0..c095913fe98fb1fb90774a765e6af25fd22e0eca 100644 (file)
@@ -19,6 +19,7 @@ options {
        listen-on { 10.53.0.3; };
        listen-on-v6 { none; };
        servfail-ttl 0;
+       qname-minimization disabled;
        max-recursion-depth 100;
        max-recursion-queries 40;
        recursion yes;
index a242a998ec7f1fd1a6df769f571ca3bf513f506b..ee0fed5b25aad0f6a2cd35bbe43d15350be85036 100644 (file)
@@ -57,7 +57,13 @@ for (;;) {
        my $qname = $questions[0]->qname;
        my $qtype = $questions[0]->qtype;
 
-       if ($qname eq "cname1.example.com") {
+       if ($qname eq "com" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("com 300 NS a.root-servers.nil."));
+       } elsif ($qname eq "example.com" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("example.com 300 NS a.root-servers.nil."));
+       } elsif ($qname eq "cname1.example.com") {
                # Data for the "cname + other data / 1" test
                $packet->push("answer", new Net::DNS::RR("cname1.example.com 300 CNAME cname1.example.com"));
                $packet->push("answer", new Net::DNS::RR("cname1.example.com 300 A 1.2.3.4"));
@@ -65,6 +71,15 @@ for (;;) {
                # Data for the "cname + other data / 2" test: same RRs in opposite order
                $packet->push("answer", new Net::DNS::RR("cname2.example.com 300 A 1.2.3.4"));
                $packet->push("answer", new Net::DNS::RR("cname2.example.com 300 CNAME cname2.example.com"));
+       } elsif ($qname eq "org" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("org 300 NS a.root-servers.nil."));
+       } elsif ($qname eq "example.org" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("example.org 300 NS a.root-servers.nil."));
+       } elsif (($qname eq "baddname.example.org" || $qname eq "gooddname.example.org") && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("example.org 300 NS a.root-servers.nil."));
        } elsif ($qname eq "www.example.org" || $qname eq "www.example.net" ||
                 $qname eq "badcname.example.org" ||
                 $qname eq "goodcname.example.org" ||
@@ -81,6 +96,12 @@ for (;;) {
                                      new Net::DNS::RR($qname .
                                                " 300 AAAA 2001:db8:beef::1"));
                }
+       } elsif ($qname eq "net" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("net 300 NS a.root-servers.nil."));
+       } elsif ($qname eq "example.net" && $qtype eq "NS") {
+               $packet->header->aa(1);
+               $packet->push("answer", new Net::DNS::RR("example.net 300 NS a.root-servers.nil."));
        } elsif ($qname eq "badcname.example.net" ||
                 $qname eq "goodcname.example.net") {
                # Data for CNAME/DNAME filtering.  We need to make one-level
@@ -97,7 +118,7 @@ for (;;) {
                # expected to be accepted regardless of the filter setting.
                $packet->push("authority", new Net::DNS::RR("sub.example.org 300 NS ns.sub.example.org"));
                $packet->push("additional", new Net::DNS::RR("ns.sub.example.org 300 A 10.53.0.3"));
-       } elsif ($qname =~ /\.broken/) {
+       } elsif ($qname =~ /broken/) {
                # Delegation to broken TLD.
                $packet->push("authority", new Net::DNS::RR("broken 300 NS ns.broken"));
                $packet->push("additional", new Net::DNS::RR("ns.broken 300 A 10.53.0.4"));
index 46d767378daadcb2bba481dc75a8ad0201eb756e..4f1ef38bf59097d490ffa415b5d77ac06c904766 100644 (file)
@@ -61,6 +61,8 @@ for (;;) {
                $packet->push("answer",
                              new Net::DNS::RR($qname .
                                       " 300 CNAME badcname.example.org"));
+       } elsif (($qname eq "baddname.example.net" || $qname eq "gooddname.example.net") && $qtype eq "NS") {
+               $packet->push("authority", new Net::DNS::RR("example.net IN SOA (1 2 3 4 5)"))
        } elsif ($qname eq "foo.baddname.example.net") {
                $packet->push("answer",
                              new Net::DNS::RR("baddname.example.net" .
index 67d041b67a28d576bc4517258fb5a2236430f452..c3c9208870db453c2d1da7c6ac91f120ef8540d0 100644 (file)
@@ -21,6 +21,7 @@ options {
        recursion yes;
        dnssec-validation yes;
        notify yes;
+       qname-minimization disabled;
 };
 
 statistics-channels {
index ddeb8eafa22e383500dc78b34ee0794da15927c1..22dbf69854a4736b9919956360af4b0790959710 100644 (file)
 ./bin/tests/system/additional/ns1/rt.db                ZONE    2013,2016,2018
 ./bin/tests/system/additional/ns1/rt2.db       ZONE    2013,2016,2018
 ./bin/tests/system/additional/ns1/srv.db       ZONE    2016,2018
+./bin/tests/system/additional/ns2/named.conf.in        CONF-C  2018
+./bin/tests/system/additional/ns2/root.db      ZONE    2018
 ./bin/tests/system/additional/ns3/named.conf.in        CONF-C  2017,2018
 ./bin/tests/system/additional/ns3/root.hint    ZONE    2017,2018
 ./bin/tests/system/additional/setup.sh         SH      2013,2016,2018