From: Ondřej Surý Date: Thu, 16 Sep 2021 08:58:38 +0000 (+0200) Subject: Add masterfile-format checkconf tests X-Git-Tag: v9.16.22~16^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4515523aa2b96048d98cb7611edc440bdf749473;p=thirdparty%2Fbind9.git Add masterfile-format checkconf tests Add tests that check that masterfile-format map generate deprecation warning and mastefile-formats text and raw doesn't. (cherry picked from commit f4e6348f296d9c8d7f40be8956062339fb1bb8e8) --- diff --git a/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf b/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf new file mode 100644 index 00000000000..9218adf59a5 --- /dev/null +++ b/bin/tests/system/checkconf/deprecated-masterfile-format-map.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * 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 http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format map; +}; diff --git a/bin/tests/system/checkconf/good-masterfile-format-raw.conf b/bin/tests/system/checkconf/good-masterfile-format-raw.conf new file mode 100644 index 00000000000..aa1386b81d0 --- /dev/null +++ b/bin/tests/system/checkconf/good-masterfile-format-raw.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * 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 http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format raw; +}; diff --git a/bin/tests/system/checkconf/good-masterfile-format-text.conf b/bin/tests/system/checkconf/good-masterfile-format-text.conf new file mode 100644 index 00000000000..34fbf3b8f2a --- /dev/null +++ b/bin/tests/system/checkconf/good-masterfile-format-text.conf @@ -0,0 +1,20 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * 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 http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + port 5300; +}; + +zone example { + type secondary; + primaries { ::1; }; + masterfile-format text; +}; diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index 0359795ae88..c1feed16d0c 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -583,6 +583,24 @@ grep "not recommended" < checkconf.out$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi status=`expr $status + $ret` +n=$((n+1)) +echo_i "check that masterfile-format map generates deprecation warning ($n)" +ret=0 +$CHECKCONF deprecated-masterfile-format-map.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi +status=$((status+ret)) + +n=$((n+1)) +echo_i "check that masterfile-format text and raw don't generate deprecation warning ($n)" +ret=0 +$CHECKCONF good-masterfile-format-text.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null && ret=1 +$CHECKCONF good-masterfile-format-raw.conf > checkconf.out$n 2>/dev/null || ret=1 +grep "is deprecated" < checkconf.out$n >/dev/null && ret=1 +if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi +status=$((status+ret)) + rmdir keys echo_i "exit status: $status"