diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 07:24:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 07:24:22 +0000 |
commit | 45d6379135504814ab723b57f0eb8be23393a51d (patch) | |
tree | d4f2ec4acca824a8446387a758b0ce4238a4dffa /bin/tests/system/dialup | |
parent | Initial commit. (diff) | |
download | bind9-45d6379135504814ab723b57f0eb8be23393a51d.tar.xz bind9-45d6379135504814ab723b57f0eb8be23393a51d.zip |
Adding upstream version 1:9.16.44.upstream/1%9.16.44
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/tests/system/dialup')
-rw-r--r-- | bin/tests/system/dialup/clean.sh | 18 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns1/example.db | 19 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns1/named.conf.in | 40 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns1/root.db | 20 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns2/hint.db | 13 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns2/named.conf.in | 40 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns3/hint.db | 13 | ||||
-rw-r--r-- | bin/tests/system/dialup/ns3/named.conf.in | 40 | ||||
-rw-r--r-- | bin/tests/system/dialup/setup.sh | 19 | ||||
-rw-r--r-- | bin/tests/system/dialup/tests.sh | 65 |
10 files changed, 287 insertions, 0 deletions
diff --git a/bin/tests/system/dialup/clean.sh b/bin/tests/system/dialup/clean.sh new file mode 100644 index 0000000..9318255 --- /dev/null +++ b/bin/tests/system/dialup/clean.sh @@ -0,0 +1,18 @@ +#!/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. + +rm -f ns2/example.bk +rm -f ns3/example.bk +rm -f */named.memstats */named.run +rm -f ns*/named.conf +rm -f ns*/named.lock diff --git a/bin/tests/system/dialup/ns1/example.db b/bin/tests/system/dialup/ns1/example.db new file mode 100644 index 0000000..3ce33f9 --- /dev/null +++ b/bin/tests/system/dialup/ns1/example.db @@ -0,0 +1,19 @@ +; 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. + +@ 3600 SOA hostmaster.ns1 ns1 ( + 1 3600 1200 3600000 1200 ) + NS ns1.example. + NS ns2.example. + NS ns3.example. +ns1 A 10.53.0.1 +ns2 A 10.53.0.2 +ns3 A 10.53.0.3 diff --git a/bin/tests/system/dialup/ns1/named.conf.in b/bin/tests/system/dialup/ns1/named.conf.in new file mode 100644 index 0000000..8ed56a8 --- /dev/null +++ b/bin/tests/system/dialup/ns1/named.conf.in @@ -0,0 +1,40 @@ +/* + * 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. + */ + +controls { /* empty */ }; + +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; }; + heartbeat-interval 2; + recursion no; + dnssec-validation no; +}; + +zone "." { + type master; + file "root.db"; +}; + +zone "example." { + type master; + notify explicit; + also-notify { 10.53.0.2; }; + dialup yes; + file "example.db"; +}; diff --git a/bin/tests/system/dialup/ns1/root.db b/bin/tests/system/dialup/ns1/root.db new file mode 100644 index 0000000..882da96 --- /dev/null +++ b/bin/tests/system/dialup/ns1/root.db @@ -0,0 +1,20 @@ +; 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. + +@ 3600 SOA hostmaster.ns1.example ns1.example ( + 1 3600 1200 3600000 1200 ) + NS ns1.example +example NS ns1.example + NS ns2.example + NS ns3.example +ns1.example A 10.53.0.1 +ns2.example A 10.53.0.2 +ns3.example A 10.53.0.3 diff --git a/bin/tests/system/dialup/ns2/hint.db b/bin/tests/system/dialup/ns2/hint.db new file mode 100644 index 0000000..0198f25 --- /dev/null +++ b/bin/tests/system/dialup/ns2/hint.db @@ -0,0 +1,13 @@ +; 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. + +. 1200 NS ns1.example +ns1.example A 10.53.0.1 diff --git a/bin/tests/system/dialup/ns2/named.conf.in b/bin/tests/system/dialup/ns2/named.conf.in new file mode 100644 index 0000000..a30bb0d --- /dev/null +++ b/bin/tests/system/dialup/ns2/named.conf.in @@ -0,0 +1,40 @@ +/* + * 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. + */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.2; + notify-source 10.53.0.2; + transfer-source 10.53.0.2; + port @PORT@; + pid-file "named.pid"; + listen-on { 10.53.0.2; }; + listen-on-v6 { none; }; + heartbeat-interval 2; + recursion no; + dnssec-validation no; +}; + +zone "." { + type hint; + file "hint.db"; +}; + +zone "example." { + type slave; + dialup passive; + notify no; + file "example.bk"; + masters { 10.53.0.1; }; +}; diff --git a/bin/tests/system/dialup/ns3/hint.db b/bin/tests/system/dialup/ns3/hint.db new file mode 100644 index 0000000..0198f25 --- /dev/null +++ b/bin/tests/system/dialup/ns3/hint.db @@ -0,0 +1,13 @@ +; 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. + +. 1200 NS ns1.example +ns1.example A 10.53.0.1 diff --git a/bin/tests/system/dialup/ns3/named.conf.in b/bin/tests/system/dialup/ns3/named.conf.in new file mode 100644 index 0000000..df6514d --- /dev/null +++ b/bin/tests/system/dialup/ns3/named.conf.in @@ -0,0 +1,40 @@ +/* + * 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. + */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.3; + notify-source 10.53.0.3; + transfer-source 10.53.0.3; + port @PORT@; + pid-file "named.pid"; + listen-on { 10.53.0.3; }; + listen-on-v6 { none; }; + heartbeat-interval 2; + recursion no; + dnssec-validation no; +}; + +zone "." { + type hint; + file "hint.db"; +}; + +zone "example." { + type slave; + dialup refresh; + notify no; + file "example.bk"; + masters { 10.53.0.2; }; +}; diff --git a/bin/tests/system/dialup/setup.sh b/bin/tests/system/dialup/setup.sh new file mode 100644 index 0000000..dad3589 --- /dev/null +++ b/bin/tests/system/dialup/setup.sh @@ -0,0 +1,19 @@ +#!/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. + +# shellcheck source=conf.sh +. ../conf.sh + +copy_setports ns1/named.conf.in ns1/named.conf +copy_setports ns2/named.conf.in ns2/named.conf +copy_setports ns3/named.conf.in ns3/named.conf diff --git a/bin/tests/system/dialup/tests.sh b/bin/tests/system/dialup/tests.sh new file mode 100644 index 0000000..1353569 --- /dev/null +++ b/bin/tests/system/dialup/tests.sh @@ -0,0 +1,65 @@ +#!/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. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +status=0 + +rm -f dig.out.* + +DIGOPTS="+norec +tcp +noadd +nosea +nostat +noquest +nocmd -p ${PORT}" + +# Check the example. domain + +$DIG $DIGOPTS example. @10.53.0.1 soa > dig.out.ns1.test || ret=1 +echo_i "checking that first zone transfer worked" +ret=0 +try=0 +while test $try -lt 120 +do + $DIG $DIGOPTS example. @10.53.0.2 soa > dig.out.ns2.test || ret=1 + if grep SERVFAIL dig.out.ns2.test > /dev/null + then + try=`expr $try + 1` + sleep 1 + else + digcomp dig.out.ns1.test dig.out.ns2.test || ret=1 + break; + fi +done +echo_i "try $try" +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "checking that second zone transfer worked" +ret=0 +try=0 +while test $try -lt 120 +do + $DIG $DIGOPTS example. @10.53.0.3 soa > dig.out.ns3.test || ret=1 + if grep SERVFAIL dig.out.ns3.test > /dev/null + then + try=`expr $try + 1` + sleep 1 + else + digcomp dig.out.ns1.test dig.out.ns3.test || ret=1 + break; + fi +done +echo_i "try $try" +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "exit status: $status" +[ $status -eq 0 ] || exit 1 |