]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1890. [func] Add a system test for named-checkconf. [RT #14931]
authorMark Andrews <marka@isc.org>
Thu, 23 Jun 2005 06:52:23 +0000 (06:52 +0000)
committerMark Andrews <marka@isc.org>
Thu, 23 Jun 2005 06:52:23 +0000 (06:52 +0000)
CHANGES
bin/check/named-checkconf.c
bin/tests/system/checkconf/bad.conf [new file with mode: 0644]
bin/tests/system/checkconf/good.conf [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh [new file with mode: 0644]
bin/tests/system/conf.sh.in
util/copyrights

diff --git a/CHANGES b/CHANGES
index 9680945764ee1e7c589a4ad3071162c32ce5aece..57c1d5592eee3eae9bc839a5e40105e4875429af 100644 (file)
--- a/CHANGES
+++ b/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]
index 7f137a3f92111f3d5038603eb1bb7e7995ceda43..54789e4272f85a5c44934ce3902f0bcbcf89c8d6 100644 (file)
@@ -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();
diff --git a/bin/tests/system/checkconf/bad.conf b/bin/tests/system/checkconf/bad.conf
new file mode 100644 (file)
index 0000000..c3592e8
--- /dev/null
@@ -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;
+};
diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf
new file mode 100644 (file)
index 0000000..aeb30bc
--- /dev/null
@@ -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;
+};
diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh
new file mode 100644 (file)
index 0000000..b5ebe08
--- /dev/null
@@ -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
index 08f5c9a27fc20b5b684480626b9edcee4ae6f73d..45b173769913f7d3d250635496f335114c5b7634 100644 (file)
@@ -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@
index 9a418d0637211941bc0aa50e6cf3b62bc24e096f..652a87903733c05f5964afe560ca3133fb1a9cdd 100644 (file)
 ./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