]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add system test covering EDE 20
authorColin Vidal <colin@isc.org>
Wed, 12 Mar 2025 09:29:10 +0000 (10:29 +0100)
committerColin Vidal <colin@isc.org>
Thu, 13 Mar 2025 10:16:01 +0000 (11:16 +0100)
Add system test to cover extended DNS error 20 (Not authoritative).

bin/tests/system/resolver/ns11/named.conf.in [new file with mode: 0644]
bin/tests/system/resolver/setup.sh
bin/tests/system/resolver/tests.sh

diff --git a/bin/tests/system/resolver/ns11/named.conf.in b/bin/tests/system/resolver/ns11/named.conf.in
new file mode 100644 (file)
index 0000000..14ed048
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+options {
+       query-source address 10.53.0.11;
+       notify-source 10.53.0.11;
+       transfer-source 10.53.0.11;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.11; };
+       listen-on-v6 { none; };
+       recursion no;
+       dnssec-validation no;
+};
index eeda13bcd0270b5618c35dd022ab8a53764612e1..ae64e5f93e7e74ed2b7f12ecbf2485bbf79fe8b8 100644 (file)
@@ -24,5 +24,6 @@ copy_setports ns5/named.conf.in ns5/named.conf
 copy_setports ns6/named.conf.in ns6/named.conf
 copy_setports ns7/named1.conf.in ns7/named.conf
 copy_setports ns9/named.conf.in ns9/named.conf
+copy_setports ns11/named.conf.in ns11/named.conf
 
 (cd ns6 && $SHELL keygen.sh)
index d667a2b2dda6f0d8d8221f47df3ee20e254338e3..95e8617ad95c43a7a60b1ac532792b479855d8bd 100755 (executable)
@@ -1015,5 +1015,14 @@ ttl=$(awk '{print $2}' dig.ns1.out.${n})
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+n=$((n + 1))
+echo_i "client requests recursion but it is disabled - expect EDE 20 code with REFUSED($n)"
+ret=0
+dig_with_opts +recurse www.isc.org @10.53.0.11 a >dig.out.ns11.test${n} || ret=1
+grep "status: REFUSED" dig.out.ns11.test${n} >/dev/null || ret=1
+grep -F "EDE: 20 (Not Authoritative)" dig.out.ns11.test${n} >/dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1