Add masterfile-format checkconf tests

Add tests that check that masterfile-format map generate deprecation
warning and mastefile-formats text and raw doesn't.
This commit is contained in:
Ondřej Surý
2021-09-16 10:58:38 +02:00
committed by Ondřej Surý
parent 6b7a488cbc
commit f4e6348f29
4 changed files with 78 additions and 0 deletions

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -571,6 +571,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"