diff --git a/bin/tests/system/checkzone/tests.sh b/bin/tests/system/checkzone/tests.sh index aa26c8fb43..fb6bcab82a 100644 --- a/bin/tests/system/checkzone/tests.sh +++ b/bin/tests/system/checkzone/tests.sh @@ -218,5 +218,41 @@ echo $lines if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) +echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning ($n)" +ret=0 +$CHECKZONE example zones/warn.no-a.server.db >test.out1.$n 2>&1 || ret=1 +grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1 +grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1 +n=$((n + 1)) +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning ($n)" +ret=0 +$CHECKZONE example zones/warn.no-aaaa.server.db >test.out1.$n 2>&1 || ret=1 +grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1 +grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1 +n=$((n + 1)) +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning for glue ($n)" +ret=0 +$CHECKZONE example zones/warn.no-a.server.glue.db >test.out1.$n 2>&1 || ret=1 +grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1 +grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1 +n=$((n + 1)) +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + +echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning for glue ($n)" +ret=0 +$CHECKZONE example zones/warn.no-aaaa.server.glue.db >test.out1.$n 2>&1 || ret=1 +grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1 +grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1 +n=$((n + 1)) +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1 diff --git a/bin/tests/system/checkzone/zones/warn.no-a.server.db b/bin/tests/system/checkzone/zones/warn.no-a.server.db new file mode 100644 index 0000000000..a27c247f02 --- /dev/null +++ b/bin/tests/system/checkzone/zones/warn.no-a.server.db @@ -0,0 +1,22 @@ +; 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. + +@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30 +@ 7200 IN NS ns1 +@ 7200 IN NS ns2 +@ 7200 IN NS ns3 +@ 7200 IN NS ns4 +ns1 3600 IN AAAA fd92:7065:b8e:ffff::1 +ns2 3600 IN AAAA fd92:7065:b8e:ffff::2 +ns3 3600 IN AAAA fd92:7065:b8e:ffff::4 +ns4 3600 IN AAAA fd92:7065:b8e:ffff::4 +dualstack 300 IN AAAA 2001:db8::1 +dualstack 300 IN A 10.53.0.5 diff --git a/bin/tests/system/checkzone/zones/warn.no-a.server.glue.db b/bin/tests/system/checkzone/zones/warn.no-a.server.glue.db new file mode 100644 index 0000000000..0bbfdde4e7 --- /dev/null +++ b/bin/tests/system/checkzone/zones/warn.no-a.server.glue.db @@ -0,0 +1,23 @@ +; 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. + +@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30 +@ 7200 IN NS ns1 +@ 7200 IN NS ns2 +@ 7200 IN NS ns3 +@ 7200 IN NS ns4 +ns1 3600 IN AAAA fd92:7065:b8e:ffff::1 +ns2 3600 IN AAAA fd92:7065:b8e:ffff::2 +ns3 3600 IN AAAA fd92:7065:b8e:ffff::4 +ns4 3600 IN AAAA fd92:7065:b8e:ffff::4 +child 3600 IN NS ns1.child +ns1.child 300 IN AAAA 2001:db8::1 +ns1.child 300 IN A 10.53.0.5 diff --git a/bin/tests/system/checkzone/zones/warn.no-aaaa.server.db b/bin/tests/system/checkzone/zones/warn.no-aaaa.server.db new file mode 100644 index 0000000000..afb52d3743 --- /dev/null +++ b/bin/tests/system/checkzone/zones/warn.no-aaaa.server.db @@ -0,0 +1,22 @@ +; 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. + +@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30 +@ 7200 IN NS ns1 +@ 7200 IN NS ns2 +@ 7200 IN NS ns3 +@ 7200 IN NS ns4 +ns1 3600 IN A 10.53.0.1 +ns2 3600 IN A 10.53.0.2 +ns3 3600 IN A 10.53.0.4 +ns4 3600 IN A 10.53.0.4 +dualstack 300 IN AAAA 2001:db8::1 +dualstack 300 IN A 10.53.0.5 diff --git a/bin/tests/system/checkzone/zones/warn.no-aaaa.server.glue.db b/bin/tests/system/checkzone/zones/warn.no-aaaa.server.glue.db new file mode 100644 index 0000000000..165a1141bb --- /dev/null +++ b/bin/tests/system/checkzone/zones/warn.no-aaaa.server.glue.db @@ -0,0 +1,23 @@ +; 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. + +@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30 +@ 7200 IN NS ns1 +@ 7200 IN NS ns2 +@ 7200 IN NS ns3 +@ 7200 IN NS ns4 +ns1 3600 IN A 10.53.0.1 +ns2 3600 IN A 10.53.0.2 +ns3 3600 IN A 10.53.0.4 +ns4 3600 IN A 10.53.0.4 +child 3600 IN NS ns1.child +ns1.child 300 IN AAAA 2001:db8::1 +ns1.child 300 IN A 10.53.0.5