diff --git a/bin/tests/system/catz/ns1/catalog-bad4.example.db b/bin/tests/system/catz/ns1/catalog-bad4.example.db new file mode 100644 index 0000000000..d04bab321c --- /dev/null +++ b/bin/tests/system/catz/ns1/catalog-bad4.example.db @@ -0,0 +1,14 @@ +; 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 . . 1 86400 3600 86400 3600 +@ 3600 IN NS invalid. +version IN A 10.53.0.1 diff --git a/bin/tests/system/catz/ns1/named.conf.in b/bin/tests/system/catz/ns1/named.conf.in index 5bfac4694f..142128131c 100644 --- a/bin/tests/system/catz/ns1/named.conf.in +++ b/bin/tests/system/catz/ns1/named.conf.in @@ -95,6 +95,15 @@ view "default" { notify explicit; }; + # Type A "version" property + zone "catalog-bad4.example" { + type primary; + file "catalog-bad4.example.db"; + allow-transfer { any; }; + allow-update { any; }; + also-notify { 10.53.0.2; }; + notify explicit; + }; }; view "ch" ch { diff --git a/bin/tests/system/catz/ns2/named1.conf.in b/bin/tests/system/catz/ns2/named1.conf.in index 961b4c5712..c52205aab3 100644 --- a/bin/tests/system/catz/ns2/named1.conf.in +++ b/bin/tests/system/catz/ns2/named1.conf.in @@ -62,6 +62,9 @@ view "default" { zone "catalog-bad3.example" default-masters { 10.53.0.1; } in-memory yes; + zone "catalog-bad4.example" + default-masters { 10.53.0.1; } + in-memory yes; }; # A faulty dlz configuration to check if named and catz survive a certain class @@ -101,24 +104,34 @@ view "default" { primaries { 10.53.0.1; }; }; + # No "version" property zone "catalog-bad1.example" { type secondary; file "catalog-bad1.example.db"; primaries { 10.53.0.1; }; }; + # Unsupported "version" property zone "catalog-bad2.example" { type secondary; file "catalog-bad2.example.db"; primaries { 10.53.0.1; }; }; + # Two RRs in TXT RRset for the "version" property zone "catalog-bad3.example" { type secondary; file "catalog-bad3.example.db"; primaries { 10.53.0.1; }; }; + # Type A "version" property + zone "catalog-bad4.example" { + type secondary; + file "catalog-bad4.example.db"; + primaries { 10.53.0.1; }; + }; + }; view "ch" ch { @@ -129,6 +142,7 @@ view "ch" ch { in-memory yes; }; + # Non-IN class catalog zone zone "catalog-bad5.example" ch { type secondary; file "catalog-bad5.example.db"; diff --git a/bin/tests/system/catz/ns2/named2.conf.in b/bin/tests/system/catz/ns2/named2.conf.in index 927aa04810..89c15c71af 100644 --- a/bin/tests/system/catz/ns2/named2.conf.in +++ b/bin/tests/system/catz/ns2/named2.conf.in @@ -64,31 +64,42 @@ view "default" { primaries { 10.53.0.1; }; }; + # No "version" property zone "catalog-bad1.example" { type secondary; file "catalog-bad1.example.db"; primaries { 10.53.0.1; }; }; + # Unsupported "version" property zone "catalog-bad2.example" { type secondary; file "catalog-bad2.example.db"; primaries { 10.53.0.1; }; }; + # Two RRs in TXT RRset for the "version" property zone "catalog-bad3.example" { type secondary; file "catalog-bad3.example.db"; primaries { 10.53.0.1; }; }; + # Type A "version" property + zone "catalog-bad4.example" { + type secondary; + file "catalog-bad4.example.db"; + primaries { 10.53.0.1; }; + }; + }; view "ch" ch { - # removed catalog-zone option, otherwise this is + # Removed catalog-zone option, otherwise this is # identical to named1.conf.in + # Non-IN class catalog zone zone "catalog-bad5.example" ch { type secondary; file "catalog-bad5.example.db"; diff --git a/bin/tests/system/catz/tests.sh b/bin/tests/system/catz/tests.sh index 18e718c5e5..c973dc020c 100644 --- a/bin/tests/system/catz/tests.sh +++ b/bin/tests/system/catz/tests.sh @@ -108,6 +108,15 @@ wait_for_message ns2/named.run "catz: new catalog zone 'catalog-bad3.example' is if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) +n=$((n+1)) +echo_i "checking that catalog-bad4.example (with only spurious type A version record) has failed to load ($n)" +ret=0 +wait_for_message ns2/named.run "catz: invalid record in catalog zone - version.catalog-bad4.example IN A (failure) - ignoring" && +wait_for_message ns2/named.run "catz: zone 'catalog-bad4.example' version is not set" && +wait_for_message ns2/named.run "catz: new catalog zone 'catalog-bad4.example' is broken and will not be processed" || ret=1 +if [ $ret -ne 0 ]; then echo_i "failed"; fi +status=$((status+ret)) + n=$((n+1)) echo_i "checking that catalog-bad5.example (non-IN class) has failed to load ($n)" ret=0