]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add new catz system test to check a version property with invalid type
authorAram Sargsyan <aram@isc.org>
Fri, 15 Apr 2022 15:34:19 +0000 (15:34 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 28 Apr 2022 12:40:03 +0000 (12:40 +0000)
There is already a check for the missing version property case
(catalog-bad1.example), and this new test should result in the same
outcome, but differs in a way that there exists a version record in the
zone, but it is of a wrong type (A instead of the expected TXT).

bin/tests/system/catz/ns1/catalog-bad4.example.db [new file with mode: 0644]
bin/tests/system/catz/ns1/named.conf.in
bin/tests/system/catz/ns2/named1.conf.in
bin/tests/system/catz/ns2/named2.conf.in
bin/tests/system/catz/tests.sh

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 (file)
index 0000000..d04bab3
--- /dev/null
@@ -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
index 5bfac4694f7879e71f8a94bd3b8ef83d215414ac..142128131ce0ef1240cb8766ee936e67c36e1243 100644 (file)
@@ -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 {
index 961b4c571234fff7982ac10c2c1d480bf059e3e2..c52205aab37b2eb65fc4b177411e28a09153cadb 100644 (file)
@@ -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";
index 927aa0481068c3c1881ec94b440069fedfe8299c..89c15c71afeb9305f6a45c1cf3649b743daf18f4 100644 (file)
@@ -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";
index 18e718c5e592cb0826146f97f7bf14f243b90f78..c973dc020cf58f63da751e5b332b2009467e7a26 100644 (file)
@@ -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