]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test resolver-use-dns64
authorMark Andrews <marka@isc.org>
Tue, 6 Aug 2019 07:28:02 +0000 (17:28 +1000)
committerMark Andrews <marka@isc.org>
Wed, 13 Sep 2023 04:31:43 +0000 (14:31 +1000)
Test resolver-use-dns64 by simulating a connection to an IPv4-only
server through a NAT64.

This test uses EXTRAPORT1 rather than PORT for DNS traffic exchanged
between ns3 and ns4. Both servers also listen on PORT on their IPv4
addresses to support server startup testing in start.pl.

bin/tests/system/dns64/ns3/hints [new file with mode: 0644]
bin/tests/system/dns64/ns3/named.conf.in [new file with mode: 0644]
bin/tests/system/dns64/ns4/named.conf.in [new file with mode: 0644]
bin/tests/system/dns64/ns4/root.db [new file with mode: 0644]
bin/tests/system/dns64/setup.sh
bin/tests/system/dns64/tests.sh

diff --git a/bin/tests/system/dns64/ns3/hints b/bin/tests/system/dns64/ns3/hints
new file mode 100644 (file)
index 0000000..3685f54
--- /dev/null
@@ -0,0 +1,14 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; 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 https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 999999
+.                       IN NS  a.root-servers.nil.
+a.root-servers.nil.     IN A   10.53.0.4
diff --git a/bin/tests/system/dns64/ns3/named.conf.in b/bin/tests/system/dns64/ns3/named.conf.in
new file mode 100644 (file)
index 0000000..4491de1
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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 https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+
+// NS3
+
+acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
+
+options {
+       query-source address 10.53.0.3;
+       query-source-v6 address fd92:7065:b8e:ffff::3;
+       notify-source 10.53.0.3;
+       notify-source-v6 fd92:7065:b8e:ffff::3;
+       transfer-source 10.53.0.3;
+       transfer-source-v6 fd92:7065:b8e:ffff::3;
+       port @EXTRAPORT1@;
+       pid-file "named.pid";
+       listen-on port @PORT@ { 10.53.0.3; };   // for start.pl
+       listen-on { 10.53.0.3; };
+       listen-on-v6 { fd92:7065:b8e:ffff::3; };
+       notify yes;
+       dnssec-validation yes;
+       allow-recursion { any; };
+       resolver-use-dns64 yes;
+
+       dns64 fd92:7065:b8e:fffe::/96 {
+               clients { any; };
+               mapped { 10.53.0.4; !rfc1918; any; };
+               suffix ::;
+       };
+};
+
+zone "." {
+       type hint;
+       file "hints";
+};
diff --git a/bin/tests/system/dns64/ns4/named.conf.in b/bin/tests/system/dns64/ns4/named.conf.in
new file mode 100644 (file)
index 0000000..ca831f9
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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 https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+
+// NS4
+
+options {
+       query-source address 10.53.0.4;
+       query-source-v6 address fd92:7065:b8e:fffe::10.53.0.4;
+       notify-source 10.53.0.4;
+       notify-source-v6 fd92:7065:b8e:fffe::10.53.0.4;
+       transfer-source 10.53.0.4;
+       transfer-source-v6 fd92:7065:b8e:fffe::10.53.0.4;
+       port @EXTRAPORT1@;
+       pid-file "named.pid";
+       listen-on port @PORT@ { 10.53.0.4; };   // for start.pl
+       listen-on-v6 { fd92:7065:b8e:fffe::10.53.0.4; };
+       notify yes;
+       dnssec-validation yes;
+       recursion no;
+};
+
+zone "." {
+       type master;
+       file "root.db";
+};
diff --git a/bin/tests/system/dns64/ns4/root.db b/bin/tests/system/dns64/ns4/root.db
new file mode 100644 (file)
index 0000000..afa7c8a
--- /dev/null
@@ -0,0 +1,17 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; 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 https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 999999
+.                       IN SOA a.root-servers.nil. . 0 0 0 0 0
+.                       IN NS  a.root-servers.nil.
+a.root-servers.nil.     IN A   10.53.0.4
+no-aaaa                         IN A   1.2.3.4
+have-aaaa               IN AAAA 2002::1
index 6771f3f2b23fe8f4b7e24d04714323d53640e4d9..e6df4d0c121528860fdd56bcb91e6912a6eb7a44 100644 (file)
@@ -15,5 +15,7 @@
 
 copy_setports ns1/named.conf1.in ns1/named.conf
 copy_setports ns2/named.conf.in ns2/named.conf
+copy_setports ns3/named.conf.in ns3/named.conf
+copy_setports ns4/named.conf.in ns4/named.conf
 
 cd ns1 && $SHELL sign.sh
index 4ee42dce4c21e4013eef78f0858b024b70ab1620..87d4bf157d2e8d28427765eacd26da56bff43e5f 100644 (file)
@@ -1452,5 +1452,19 @@ n=$((n + 1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+if $PERL ../testsock6.pl fd92:7065:b8e:fffe::10.53.0.4 2> /dev/null
+then
+  echo_i "checking resolver-use-dns64 ($n)"
+  ret=0
+  $DIG $DIGOPTS @10.53.0.3 no-aaaa aaaa > dig.out.ns3.test$n || ret=1
+  grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
+  grep "fd92:7065:b8e:fffe::102:304" dig.out.ns3.test$n > /dev/null || ret=1
+  n=$((n + 1))
+  if [ $ret != 0 ]; then echo_i "failed"; fi
+  status=$((status + ret))
+else
+  echo_i "skipped use-dns64 test - fd92:7065:b8e:fffe::10.53.0.4 not configured ($n)"
+fi
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1