From 3b9b6d0b8e7f798023c9d109c490449d528fde80 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:59:48 +0200 Subject: Adding upstream version 1:9.18.19. Signed-off-by: Daniel Baumann --- bin/tests/system/glue/clean.sh | 23 ++++++++++++++ bin/tests/system/glue/fi.good | 27 ++++++++++++++++ bin/tests/system/glue/noglue.good | 14 +++++++++ bin/tests/system/glue/ns1/named.conf.in | 39 ++++++++++++++++++++++++ bin/tests/system/glue/ns1/net.db | 34 +++++++++++++++++++++ bin/tests/system/glue/ns1/root-servers.nil.db | 25 +++++++++++++++ bin/tests/system/glue/ns1/root.db | 44 +++++++++++++++++++++++++++ bin/tests/system/glue/setup.sh | 16 ++++++++++ bin/tests/system/glue/tests.sh | 35 +++++++++++++++++++++ bin/tests/system/glue/tests_sh_glue.py | 14 +++++++++ 10 files changed, 271 insertions(+) create mode 100644 bin/tests/system/glue/clean.sh create mode 100644 bin/tests/system/glue/fi.good create mode 100644 bin/tests/system/glue/noglue.good create mode 100644 bin/tests/system/glue/ns1/named.conf.in create mode 100644 bin/tests/system/glue/ns1/net.db create mode 100644 bin/tests/system/glue/ns1/root-servers.nil.db create mode 100644 bin/tests/system/glue/ns1/root.db create mode 100644 bin/tests/system/glue/setup.sh create mode 100644 bin/tests/system/glue/tests.sh create mode 100644 bin/tests/system/glue/tests_sh_glue.py (limited to 'bin/tests/system/glue') diff --git a/bin/tests/system/glue/clean.sh b/bin/tests/system/glue/clean.sh new file mode 100644 index 0000000..4d84f06 --- /dev/null +++ b/bin/tests/system/glue/clean.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# 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. + +# +# Clean up after glue tests. +# + +rm -f dig.out +rm -f */named.conf +rm -f */named.memstats +rm -f */named.run +rm -f ns*/named.lock +rm -f ns*/managed-keys.bind* diff --git a/bin/tests/system/glue/fi.good b/bin/tests/system/glue/fi.good new file mode 100644 index 0000000..a08bc7a --- /dev/null +++ b/bin/tests/system/glue/fi.good @@ -0,0 +1,27 @@ + +; <<>> DiG 9.0 <<>> +norec @10.53.0.1 -p 5300 foo.bar.fi. A +;; global options: printcmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58772 +;; flags: qr ad; QUERY: 1, ANSWER: 0, AUTHORITY: 6, ADDITIONAL: 7 + +;; QUESTION SECTION: +;foo.bar.fi. IN A + +;; AUTHORITY SECTION: +fi. 172800 IN NS NS.EU.NET. +fi. 172800 IN NS NS.TELE.fi. +fi. 172800 IN NS PRIFI.EUNET.fi. +fi. 172800 IN NS NS.UU.NET. +fi. 172800 IN NS T.NS.VERIO.NET. +fi. 172800 IN NS HYDRA.HELSINKI.fi. + +;; ADDITIONAL SECTION: +NS.TELE.fi. 172800 IN A 193.210.19.19 +NS.TELE.fi. 172800 IN A 193.210.18.18 +PRIFI.EUNET.fi. 172800 IN A 193.66.1.146 +NS.UU.NET. 172800 IN A 137.39.1.3 +T.NS.VERIO.NET. 172800 IN A 192.67.14.16 +HYDRA.HELSINKI.fi. 172800 IN A 128.214.4.29 +NS.EU.NET. 172800 IN A 192.16.202.11 + diff --git a/bin/tests/system/glue/noglue.good b/bin/tests/system/glue/noglue.good new file mode 100644 index 0000000..22eca7b --- /dev/null +++ b/bin/tests/system/glue/noglue.good @@ -0,0 +1,14 @@ + +; <<>> DiG 9.0 <<>> @10.53.0.1 -p 5300 example.net a +;; global options: printcmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29409 +;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 0 + +;; QUESTION SECTION: +;example.net. IN A + +;; AUTHORITY SECTION: +example.net. 300 IN NS ns2.example. +example.net. 300 IN NS ns1.example. + diff --git a/bin/tests/system/glue/ns1/named.conf.in b/bin/tests/system/glue/ns1/named.conf.in new file mode 100644 index 0000000..9ac9bc5 --- /dev/null +++ b/bin/tests/system/glue/ns1/named.conf.in @@ -0,0 +1,39 @@ +/* + * 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.1; + notify-source 10.53.0.1; + transfer-source 10.53.0.1; + port @PORT@; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; + recursion yes; + notify no; + dnssec-validation no; +}; + +zone "." { + type primary; + file "root.db"; +}; + +zone "root-servers.nil" { + type primary; + file "root-servers.nil.db"; +}; +zone "net" { + type primary; + file "net.db"; +}; diff --git a/bin/tests/system/glue/ns1/net.db b/bin/tests/system/glue/ns1/net.db new file mode 100644 index 0000000..db784cc --- /dev/null +++ b/bin/tests/system/glue/ns1/net.db @@ -0,0 +1,34 @@ +; 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. + +$ORIGIN net. +$TTL 300 +@ IN SOA gson.nominum.com. a.root.servers.nil. ( + 2000042100 ; serial + 600 ; refresh + 600 ; retry + 1200 ; expire + 600 ; minimum + ) +@ NS a.root-servers.nil. + +; FI. authoritative servers, for the FI. glue test. +uu.net. NS ns.uu.net. +NS.UU.NET. 172800 IN A 137.39.1.3 +eu.net. NS ns.eu.net. +NS.EU.NET. 172800 IN A 192.16.202.11 + +; Referral outside of server authority, but with glue records present. +; Don't hand out the glue. +example.net. NS ns1.example. +example.net. NS ns2.example. +ns1.example. 172800 IN A 1.1.1.1 +ns2.example. 172800 IN A 2.2.2.2 diff --git a/bin/tests/system/glue/ns1/root-servers.nil.db b/bin/tests/system/glue/ns1/root-servers.nil.db new file mode 100644 index 0000000..1475aed --- /dev/null +++ b/bin/tests/system/glue/ns1/root-servers.nil.db @@ -0,0 +1,25 @@ +; 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 300 +@ IN SOA ns hostmaster ( + 1 + 3600 + 1800 + 1814400 + 3600 + ) + NS a +a A 10.53.0.1 +b A 10.53.0.2 + + + diff --git a/bin/tests/system/glue/ns1/root.db b/bin/tests/system/glue/ns1/root.db new file mode 100644 index 0000000..debdf01 --- /dev/null +++ b/bin/tests/system/glue/ns1/root.db @@ -0,0 +1,44 @@ +; 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 300 +. IN SOA gson.nominum.com. a.root.servers.nil. ( + 2000042100 ; serial + 600 ; refresh + 600 ; retry + 1200 ; expire + 600 ; minimum + ) +. NS a.root-servers.nil. + +root-servers.nil. NS a.root-servers.nil. +a.root-servers.nil. A 10.53.0.1 + +; Delegate some domains that contain name servers for the sample +; ccTLDs below. +net. 172800 IN NS a.root-servers.nil. + +; +; A sample ccTLD +; +fi. 172800 IN NS NS.TELE.fi. +fi. 172800 IN NS PRIFI.EUNET.fi. +fi. 172800 IN NS NS.UU.NET. +fi. 172800 IN NS T.NS.VERIO.NET. +fi. 172800 IN NS HYDRA.HELSINKI.fi. +fi. 172800 IN NS NS.EU.NET. +NS.TELE.fi. 172800 IN A 193.210.18.18 +NS.TELE.fi. 172800 IN A 193.210.19.19 +PRIFI.EUNET.fi. 172800 IN A 193.66.1.146 +NS.UU.NET. 172800 IN A 137.39.1.3 +T.NS.VERIO.NET. 172800 IN A 192.67.14.16 +HYDRA.HELSINKI.fi. 172800 IN A 128.214.4.29 +NS.EU.NET. 172800 IN A 192.16.202.11 diff --git a/bin/tests/system/glue/setup.sh b/bin/tests/system/glue/setup.sh new file mode 100644 index 0000000..82240a7 --- /dev/null +++ b/bin/tests/system/glue/setup.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# 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. + +. ../conf.sh + +copy_setports ns1/named.conf.in ns1/named.conf diff --git a/bin/tests/system/glue/tests.sh b/bin/tests/system/glue/tests.sh new file mode 100644 index 0000000..2dcacbf --- /dev/null +++ b/bin/tests/system/glue/tests.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# 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. + +set -e + +. ../conf.sh + +# +# Do glue tests. +# + +DIGOPTS="+norec -p ${PORT}" + +status=0 + +echo_i "testing that a ccTLD referral gets a full glue set from the root zone" +$DIG $DIGOPTS @10.53.0.1 foo.bar.fi. A >dig.out || status=1 +digcomp --lc fi.good dig.out || status=1 + +echo_i "testing that we don't find out-of-zone glue" +$DIG $DIGOPTS @10.53.0.1 example.net. a > dig.out || status=1 +digcomp noglue.good dig.out || status=1 + +echo_i "exit status: $status" +[ $status -eq 0 ] || exit 1 diff --git a/bin/tests/system/glue/tests_sh_glue.py b/bin/tests/system/glue/tests_sh_glue.py new file mode 100644 index 0000000..4f3ff04 --- /dev/null +++ b/bin/tests/system/glue/tests_sh_glue.py @@ -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. + + +def test_glue(run_tests_sh): + run_tests_sh() -- cgit v1.2.3