]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add masterfile-format checkconf tests
authorOndřej Surý <ondrej@sury.org>
Thu, 16 Sep 2021 08:58:38 +0000 (10:58 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 17 Sep 2021 07:16:10 +0000 (09:16 +0200)
Add tests that check that masterfile-format map generate deprecation
warning and mastefile-formats text and raw doesn't.

(cherry picked from commit f4e6348f296d9c8d7f40be8956062339fb1bb8e8)

bin/tests/system/checkconf/deprecated-masterfile-format-map.conf [new file with mode: 0644]
bin/tests/system/checkconf/good-masterfile-format-raw.conf [new file with mode: 0644]
bin/tests/system/checkconf/good-masterfile-format-text.conf [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh

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 (file)
index 0000000..9218adf
--- /dev/null
@@ -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 (file)
index 0000000..aa1386b
--- /dev/null
@@ -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 (file)
index 0000000..34fbf3b
--- /dev/null
@@ -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;
+};
index 0359795ae88295729f0fe6b4a75ba0b50d6814e7..c1feed16d0c72481774c6d5acba51f208ab0281f 100644 (file)
@@ -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"