2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Check that 'check-names {secondary|slave} ignore;' works

This commit is contained in:
Mark Andrews
2021-09-29 09:36:02 +10:00
parent 9107c8caeb
commit 0b0d400d7c
5 changed files with 48 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ options {
recursion yes;
dnssec-validation yes;
check-names primary ignore;
check-names secondary ignore;
notify yes;
};
@@ -33,3 +34,9 @@ zone "primary-ignore.update" {
file "primary-ignore.update.db";
allow-update { any; };
};
zone "master-ignore.update" {
type secondary;
primaries { 10.53.0.5; };
file "secondary-ignore.update.db";
};

View File

@@ -8,7 +8,9 @@
; information regarding copyright ownership.
$TTL 300
@ SOA ns1.ignore.update. hostmaster.ignore.update. (
@ SOA ns4 hostmaster.ignore.update. (
1 3600 1200 604800 3600 )
NS ns1.ignore.update.
ns1.ignore.update. A 10.53.0.1
NS ns4
NS ns5
ns4 A 10.53.0.4
ns5 A 10.53.0.5

View File

@@ -8,7 +8,9 @@
; information regarding copyright ownership.
$TTL 300
@ SOA ns1.ignore.update. hostmaster.ignore.update. (
@ SOA ns5. hostmaster.ignore.update. (
1 3600 1200 604800 3600 )
NS ns1.ignore.update.
ns1.ignore.update. A 10.53.0.1
NS ns4
NS ns5
ns4 A 10.53.0.4
ns5 A 10.53.0.5

View File

@@ -20,6 +20,7 @@ options {
recursion yes;
dnssec-validation yes;
check-names master ignore;
check-names slave ignore;
notify yes;
};
@@ -33,3 +34,9 @@ zone "master-ignore.update" {
file "master-ignore.update.db";
allow-update { any; };
};
zone "primary-ignore.update" {
type secondary;
primaries { 10.53.0.4; };
file "primary-ignore.update.db";
};

View File

@@ -16,6 +16,12 @@ n=1
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p ${PORT}"
wait_for_record () {
$DIG $DIGOPTS "$1" "$2" "$3" > "$4" || return 1
grep NOERROR "$4" > /dev/null || return 1
return 0
}
# Entry should exist.
echo_i "check for failure from on zone load for 'check-names fail;' ($n)"
ret=0
@@ -160,5 +166,23 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "check that updates to 'check-names secondary ignore;' succeed and are not logged ($n)"
ret=0
# takes a while for the transfer to succeed as ns5 (primary) is started after ns4 (secondary)
# and the zone is still loading when we get to this point.
retry_quiet 35 wait_for_record xxx_xxx.master-ignore.update @10.53.0.4 A dig.out.ns4.test$n || ret=1
grep "xxx_xxx.master-ignore.update/A.*(check-names)" ns4/named.run > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that updates to 'check-names master ignore;' succeed and are not logged ($n)"
ret=0
retry_quiet 35 wait_for_record xxx_xxx.primary-ignore.update @10.53.0.5 A dig.out.ns5.test$n || ret=1
grep "xxx_xxx.primary-ignore.update/A.*(check-names)" ns5/named.run > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1