mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 01:59:59 -04:00
1890. [func] Add a system test for named-checkconf. [RT #14931]
This commit is contained in:
parent
8087418873
commit
2bef371309
7 changed files with 156 additions and 11 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
1890. [func] Add a system test for named-checkconf. [RT #14931]
|
||||
|
||||
1889. [func] The lame cache is now done on a <qname,qclass,qtype>
|
||||
basis as some servers only appear to be lame for
|
||||
certain query types. [RT #14916]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: named-checkconf.c,v 1.34 2005/06/20 01:03:48 marka Exp $ */
|
||||
/* $Id: named-checkconf.c,v 1.35 2005/06/23 06:52:22 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
|
|
@ -400,10 +400,6 @@ main(int argc, char **argv) {
|
|||
RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
|
||||
== ISC_R_SUCCESS);
|
||||
|
||||
RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
|
||||
== ISC_R_SUCCESS);
|
||||
|
||||
dns_result_register();
|
||||
|
||||
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
|
||||
|
|
@ -430,8 +426,6 @@ main(int argc, char **argv) {
|
|||
|
||||
cfg_parser_destroy(&parser);
|
||||
|
||||
isc_hash_destroy();
|
||||
|
||||
isc_log_destroy(&logc);
|
||||
|
||||
isc_hash_destroy();
|
||||
|
|
|
|||
52
bin/tests/system/checkconf/bad.conf
Normal file
52
bin/tests/system/checkconf/bad.conf
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: bad.conf,v 1.2 2005/06/23 06:52:23 marka Exp $ */
|
||||
|
||||
options {
|
||||
avoid-v4-udp-ports { 100; }
|
||||
avoid-v6-udp-ports { 100; };
|
||||
blackhole { 10.0.0.0/8; };
|
||||
coresize 1G;
|
||||
datasize 100M;
|
||||
deallocate-on-exit yes;
|
||||
directory ".";
|
||||
dump-file "named_dumpdb";
|
||||
fake-iquery yes;
|
||||
files 1000;
|
||||
has-old-clients no;
|
||||
heartbeat-interval 30;
|
||||
host-statistics yes;
|
||||
host-statistics-max 100;
|
||||
hostname none;
|
||||
interface-interval 30;
|
||||
listen-on port 90 { any; };
|
||||
listen-on port 100 { 127.0.0.1; };
|
||||
listen-on-v6 port 53 { none; };
|
||||
match-mapped-addresses yes;
|
||||
memstatistics-file "named.memstats";
|
||||
multiple-cnames no;
|
||||
named-xfer "this is no longer needed";
|
||||
pid-file none;
|
||||
port 5300;
|
||||
querylog yes;
|
||||
recursing-file "named.recursing";
|
||||
random-device "/dev/random";
|
||||
recursive-clients 3000;
|
||||
serial-queries 10;
|
||||
serial-query-rate 100;
|
||||
server-id none;
|
||||
};
|
||||
56
bin/tests/system/checkconf/good.conf
Normal file
56
bin/tests/system/checkconf/good.conf
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: good.conf,v 1.2 2005/06/23 06:52:23 marka Exp $ */
|
||||
|
||||
/*
|
||||
* This is just a random selection of configuration options.
|
||||
*/
|
||||
|
||||
options {
|
||||
avoid-v4-udp-ports { 100; };
|
||||
avoid-v6-udp-ports { 100; };
|
||||
blackhole { 10.0.0.0/8; };
|
||||
coresize 1G;
|
||||
datasize 100M;
|
||||
deallocate-on-exit yes;
|
||||
directory ".";
|
||||
dump-file "named_dumpdb";
|
||||
fake-iquery yes;
|
||||
files 1000;
|
||||
has-old-clients no;
|
||||
heartbeat-interval 30;
|
||||
host-statistics yes;
|
||||
host-statistics-max 100;
|
||||
hostname none;
|
||||
interface-interval 30;
|
||||
listen-on port 90 { any; };
|
||||
listen-on port 100 { 127.0.0.1; };
|
||||
listen-on-v6 port 53 { none; };
|
||||
match-mapped-addresses yes;
|
||||
memstatistics-file "named.memstats";
|
||||
multiple-cnames no;
|
||||
named-xfer "this is no longer needed";
|
||||
pid-file none;
|
||||
port 5300;
|
||||
querylog yes;
|
||||
recursing-file "named.recursing";
|
||||
random-device "/dev/random";
|
||||
recursive-clients 3000;
|
||||
serial-queries 10;
|
||||
serial-query-rate 100;
|
||||
server-id none;
|
||||
};
|
||||
37
bin/tests/system/checkconf/tests.sh
Normal file
37
bin/tests/system/checkconf/tests.sh
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: tests.sh,v 1.1 2005/06/23 06:52:23 marka Exp $
|
||||
|
||||
SYSTEMTESTTOP=..
|
||||
. $SYSTEMTESTTOP/conf.sh
|
||||
|
||||
status=0
|
||||
|
||||
echo "I: checking that named-checkconf handles a known good config"
|
||||
|
||||
ret=0
|
||||
$CHECKCONF good.conf > /dev/null 2>&1 || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I: checking that named-checkconf handles a known bad config"
|
||||
|
||||
ret=1
|
||||
$CHECKCONF bad.conf > /dev/null 2>&1 || ret=0
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:exit status: $status"
|
||||
exit $status
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: conf.sh.in,v 1.30 2005/06/22 00:10:30 marka Exp $
|
||||
# $Id: conf.sh.in,v 1.31 2005/06/23 06:52:22 marka Exp $
|
||||
|
||||
#
|
||||
# Common configuration data for system tests, to be sourced into
|
||||
|
|
@ -38,13 +38,14 @@ NSUPDATE=$TOP/bin/nsupdate/nsupdate
|
|||
KEYGEN=$TOP/bin/dnssec/dnssec-keygen
|
||||
SIGNER=$TOP/bin/dnssec/dnssec-signzone
|
||||
CHECKZONE=$TOP/bin/check/named-checkzone
|
||||
CHECKCONF=$TOP/bin/check/named-checkconf
|
||||
|
||||
# The "stress" test is not run by default since it creates enough
|
||||
# load on the machine to make it unusable to other users.
|
||||
# v6synth
|
||||
SUBDIRS="cacheclean checknames dnssec forward glue ixfr limits lwresd \
|
||||
masterfile masterformat notify nsupdate resolver sortlist stub tkey \
|
||||
unknown upforwd views xfer xferquota zonechecks"
|
||||
SUBDIRS="cacheclean checkconf checknames dnssec forward glue ixfr limits \
|
||||
lwresd masterfile masterformat notify nsupdate resolver sortlist stub \
|
||||
tkey unknown upforwd views xfer xferquota zonechecks"
|
||||
|
||||
# PERL will be an empty string if no perl interpreter was found.
|
||||
PERL=@PERL@
|
||||
|
|
|
|||
|
|
@ -421,6 +421,9 @@
|
|||
./bin/tests/system/cacheclean/ns2/.cvsignore X 2001
|
||||
./bin/tests/system/cacheclean/ns2/named.conf CONF-C 2001,2004
|
||||
./bin/tests/system/cacheclean/tests.sh SH 2001,2004
|
||||
./bin/tests/system/checkconf/bad.conf CONF-C 2005
|
||||
./bin/tests/system/checkconf/good.conf CONF-C 2005
|
||||
./bin/tests/system/checkconf/tests.sh SH 2005
|
||||
./bin/tests/system/checknames/clean.sh SH 2004
|
||||
./bin/tests/system/checknames/ns1/fail.example.db.in ZONE 2004
|
||||
./bin/tests/system/checknames/ns1/fail.update.db.in ZONE 2004
|
||||
|
|
|
|||
Loading…
Reference in a new issue