From ea648e70a989cca190cd7403fe892fd2dcc290b4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:37:14 +0200 Subject: Adding upstream version 1:9.11.5.P4+dfsg. Signed-off-by: Daniel Baumann --- bin/tests/system/dlz/clean.sh | 16 +++++ .../com/broken/dns.d/@/DNAME=10=example.net.= | 6 ++ .../com/broken/dns.d/@/NS=10=example.com.= | 6 ++ ...om.=root.example.com.=None=None=None=None=None= | 6 ++ .../com/example/dns.d/@/DNAME=10=example.net.= | 6 ++ .../com/example/dns.d/@/NS=10=example.com.= | 6 ++ ...ple.com.=root.example.com.=2010062900=0=0=0=10= | 6 ++ .../dlz/ns1/dns-root/com/example/xfr.d/10.53.0.1 | 6 ++ bin/tests/system/dlz/ns1/named.conf.in | 25 ++++++++ bin/tests/system/dlz/prereq.sh.in | 19 ++++++ bin/tests/system/dlz/setup.sh | 16 +++++ bin/tests/system/dlz/tests.sh | 75 ++++++++++++++++++++++ 12 files changed, 193 insertions(+) create mode 100644 bin/tests/system/dlz/clean.sh create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/DNAME=10=example.net.= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/NS=10=example.com.= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/SOA=10=ns.example.com.=root.example.com.=None=None=None=None=None= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/DNAME=10=example.net.= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/NS=10=example.com.= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/SOA=10=ns.example.com.=root.example.com.=2010062900=0=0=0=10= create mode 100644 bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d/10.53.0.1 create mode 100644 bin/tests/system/dlz/ns1/named.conf.in create mode 100644 bin/tests/system/dlz/prereq.sh.in create mode 100644 bin/tests/system/dlz/setup.sh create mode 100644 bin/tests/system/dlz/tests.sh (limited to 'bin/tests/system/dlz') diff --git a/bin/tests/system/dlz/clean.sh b/bin/tests/system/dlz/clean.sh new file mode 100644 index 0000000..e38b806 --- /dev/null +++ b/bin/tests/system/dlz/clean.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# 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. + +rm -f ns*/named.conf +rm -f dig.out.* +rm -f */named.memstats +rm -f */named.run +rm -f ns*/named.lock diff --git a/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/DNAME=10=example.net.= b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/DNAME=10=example.net.= new file mode 100644 index 0000000..be99eb3 --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/DNAME=10=example.net.= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "DNAME 10 example.net.". diff --git a/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/NS=10=example.com.= b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/NS=10=example.com.= new file mode 100644 index 0000000..cca17c3 --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/NS=10=example.com.= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "NS 10 example.com.". diff --git a/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/SOA=10=ns.example.com.=root.example.com.=None=None=None=None=None= b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/SOA=10=ns.example.com.=root.example.com.=None=None=None=None=None= new file mode 100644 index 0000000..f2ca5de --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/broken/dns.d/@/SOA=10=ns.example.com.=root.example.com.=None=None=None=None=None= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "SOA 10 ns.example.com. root.example.com. 2010062900 None None None None" which is a malformed SOA record. diff --git a/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/DNAME=10=example.net.= b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/DNAME=10=example.net.= new file mode 100644 index 0000000..be99eb3 --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/DNAME=10=example.net.= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "DNAME 10 example.net.". diff --git a/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/NS=10=example.com.= b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/NS=10=example.com.= new file mode 100644 index 0000000..cca17c3 --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/NS=10=example.com.= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "NS 10 example.com.". diff --git a/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/SOA=10=ns.example.com.=root.example.com.=2010062900=0=0=0=10= b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/SOA=10=ns.example.com.=root.example.com.=2010062900=0=0=0=10= new file mode 100644 index 0000000..bb5ebac --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/example/dns.d/@/SOA=10=ns.example.com.=root.example.com.=2010062900=0=0=0=10= @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file is not read by the filesystem driver. +This is the file for "SOA 10 ns.example.com. root.example.com. 2010062900 0 0 0 10". diff --git a/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d/10.53.0.1 b/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d/10.53.0.1 new file mode 100644 index 0000000..70deea6 --- /dev/null +++ b/bin/tests/system/dlz/ns1/dns-root/com/example/xfr.d/10.53.0.1 @@ -0,0 +1,6 @@ +Copyright (C) Internet Systems Consortium, Inc. ("ISC") + +See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. + +The contents of this file are not read by the filesystem driver. +The presence of this file allows 10.53.0.1 to transfer this zone. diff --git a/bin/tests/system/dlz/ns1/named.conf.in b/bin/tests/system/dlz/ns1/named.conf.in new file mode 100644 index 0000000..273ff02 --- /dev/null +++ b/bin/tests/system/dlz/ns1/named.conf.in @@ -0,0 +1,25 @@ +/* + * 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.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 no; +}; + +dlz fszone { + database "filesystem dns-root/ dns.d xfr.d 0 ="; +}; diff --git a/bin/tests/system/dlz/prereq.sh.in b/bin/tests/system/dlz/prereq.sh.in new file mode 100644 index 0000000..afec653 --- /dev/null +++ b/bin/tests/system/dlz/prereq.sh.in @@ -0,0 +1,19 @@ +#!/bin/sh +# +# 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. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +if [ "@DLZ_SYSTEM_TEST@" != "filesystem" ]; then + echo_i "DLZ filesystem driver not supported" + exit 255 +fi +exit 0 diff --git a/bin/tests/system/dlz/setup.sh b/bin/tests/system/dlz/setup.sh new file mode 100644 index 0000000..7e60631 --- /dev/null +++ b/bin/tests/system/dlz/setup.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# 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. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +$SHELL clean.sh +copy_setports ns1/named.conf.in ns1/named.conf diff --git a/bin/tests/system/dlz/tests.sh b/bin/tests/system/dlz/tests.sh new file mode 100644 index 0000000..78f74dc --- /dev/null +++ b/bin/tests/system/dlz/tests.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# 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. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +status=0 +n=0 + +rm -f dig.out.* + +DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p ${PORT}" + +# Check the example.com. domain + +echo_i "checking DNAME at apex works ($n)" +ret=0 +$DIG $DIGOPTS +norec foo.example.com. \ + @10.53.0.1 a > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*DNAME.*example.net." dig.out.ns1.test$n > /dev/null || ret=1 +grep "foo.example.com..*CNAME.*foo.example.net." dig.out.ns1.test$n > /dev/null || ret=1 +grep "flags:[^;]* aa[ ;]" dig.out.ns1.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "checking DLZ IXFR=2010062899 (less than serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062899 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "checking DLZ IXFR=2010062900 (equal serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062900 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null && ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "checking DLZ IXFR=2010062901 (greater than serial) ($n)" +ret=0 +$DIG $DIGOPTS ixfr=2010062901 example.com @10.53.0.1 +all > dig.out.ns1.test$n +grep "example.com..*IN.IXFR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "example.com..*10.IN.DNAME.example.net." dig.out.ns1.test$n > /dev/null && ret=1 +grep "example.com..*10.IN.NS.example.com." dig.out.ns1.test$n > /dev/null && ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "checking DLZ with a malformed SOA record" +ret=0 +$DIG $DIGOPTS broken.com type600 @10.53.0.1 > dig.out.ns1.test$n +grep status: dig.out.ns1.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +echo_i "exit status: $status" +[ $status -eq 0 ] || exit 1 -- cgit v1.2.3