2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Check that no primaries is logged with -4 or -6

When in -4 mode check that "IPv6 disabled and no IPv4 primaries"
is logged and when in -6 mode check that "IPv4 disabled and no IPv6
primaries" is logged.
This commit is contained in:
Mark Andrews 2023-11-29 14:29:05 +11:00
parent 2cd4303249
commit 07cdf3e945
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,30 @@
/*
* 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 {
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
dnssec-validation no;
};
zone "ipv4-only-servers" {
type secondary;
primaries { 10.53.0.3; };
};
zone "ipv6-only-servers" {
type secondary;
primaries { fd92:7065:b8e:ffff::2; };
};

View File

@ -21,6 +21,7 @@ copy_setports ns2/named-alt1.conf.in ns2/named-alt1.conf
copy_setports ns2/named-alt2.conf.in ns2/named-alt2.conf
copy_setports ns2/named-alt3.conf.in ns2/named-alt3.conf
copy_setports ns2/named-alt4.conf.in ns2/named-alt4.conf
copy_setports ns2/named-alt5.conf.in ns2/named-alt5.conf
mkdir ns2/nope
chmod 555 ns2/nope

View File

@ -196,6 +196,32 @@ test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking that named log missing IPv4 primaries in -4 mode ($n)"
ret=0
INSTANCE_NAME="missing-primaries-ipv4-only-mode"
testpid=$(run_named ns2 named$n.run -c named-alt5.conf -D "${INSTANCE_NAME}" -4)
test -n "$testpid" || ret=1
retry_quiet 60 check_named_log "running$" ns2/named$n.run || ret=1
grep "IPv6 disabled and no IPv4 primaries" ns2/named$n.run >/dev/null || ret=1
kill_named ns2/named.pid || ret=1
test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking that named log missing IPv6 primaries in -6 mode ($n)"
ret=0
INSTANCE_NAME="missing-primaries-ipv4-only-mode"
testpid=$(run_named ns2 named$n.run -c named-alt5.conf -D "${INSTANCE_NAME}" -6)
test -n "$testpid" || ret=1
retry_quiet 60 check_named_log "running$" ns2/named$n.run || ret=1
grep "IPv4 disabled and no IPv6 primaries" ns2/named$n.run >/dev/null || ret=1
kill_named ns2/named.pid || ret=1
test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "verifying that named switches UID ($n)"
if [ "$(id -u)" -eq 0 ]; then