]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add system test
authorMukund Sivaraman <muks@isc.org>
Sat, 12 May 2018 03:03:18 +0000 (08:33 +0530)
committerMark Andrews <marka@isc.org>
Mon, 25 Jun 2018 07:18:36 +0000 (17:18 +1000)
bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength [new file with mode: 0644]
bin/tests/system/rpzrecurse/ns2/named.invalidprefixlength.conf [new file with mode: 0644]
bin/tests/system/rpzrecurse/tests.sh
util/copyrights

diff --git a/bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength b/bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength
new file mode 100644 (file)
index 0000000..895f526
--- /dev/null
@@ -0,0 +1,14 @@
+; 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.
+
+$TTL 60
+@ IN SOA root.ns ns 1996072700 3600 1800 86400 60
+     NS ns
+ns A 127.0.0.1
+1000.4.0.53.10.rpz-client-ip A 10.53.0.1
diff --git a/bin/tests/system/rpzrecurse/ns2/named.invalidprefixlength.conf b/bin/tests/system/rpzrecurse/ns2/named.invalidprefixlength.conf
new file mode 100644 (file)
index 0000000..fe59355
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+# common configuration
+include "named.conf.header";
+
+view "recursive" {
+    zone "." {
+       type hint;
+       file "root.hint";
+    };
+
+    # policy configuration to be tested
+    response-policy {
+       zone "invalidprefixlength";
+    };
+
+    # policy zones to be tested
+    zone "invalidprefixlength" { type master; file "db.invalidprefixlength"; };
+};
index e891f01d0f217e511136eb878151e0b81704ec9e..923f6f4182d1cf86ecdb5fdbc27ab8a486bcef51 100644 (file)
@@ -476,6 +476,16 @@ do
     status=1
   }
 
+  # Check for invalid prefix length error
+  t=`expr $t + 1`
+  echo_i "testing for invalid prefix length error (${t})"
+  add_test_marker 10.53.0.2
+  run_server invalidprefixlength
+  grep "invalid rpz IP address \"1000.4.0.53.10.rpz-client-ip.invalidprefixlength\"; invalid prefix length of 1000$" ns2/named.run > /dev/null || {
+    echo_i " failed: expected that invalid prefix length error would be logged"
+    status=1
+  }
+
   t=`expr $t + 1`
   echo_i "checking 'nsip-wait-recurse no' is faster than 'nsip-wait-recurse yes' ($t)"
   add_test_marker 10.53.0.2
index 32f7aaa31cc9a6341b339d561eae5edc94dcdcf0..81498f6a33e19b56dcef9bc7a44241378418d4fd 100644 (file)
 ./bin/tests/system/rpzrecurse/ns2/db.clientip1 ZONE    2015,2016,2018
 ./bin/tests/system/rpzrecurse/ns2/db.clientip2 ZONE    2015,2016,2018
 ./bin/tests/system/rpzrecurse/ns2/db.clientip21        ZONE    2016,2018
+./bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength       ZONE    2018
 ./bin/tests/system/rpzrecurse/ns2/db.log1      ZONE    2015,2016,2018
 ./bin/tests/system/rpzrecurse/ns2/db.log2      ZONE    2015,2016,2018
 ./bin/tests/system/rpzrecurse/ns2/db.log3      ZONE    2015,2016,2018
 ./bin/tests/system/rpzrecurse/ns2/named.clientip2.conf CONF-C  2016,2017,2018
 ./bin/tests/system/rpzrecurse/ns2/named.conf.header.in CONF-C  2015,2016,2017,2018
 ./bin/tests/system/rpzrecurse/ns2/named.default.conf   CONF-C  2015,2016,2018
+./bin/tests/system/rpzrecurse/ns2/named.invalidprefixlength.conf       CONF-C  2018
 ./bin/tests/system/rpzrecurse/ns2/named.log.conf       CONF-C  2015,2016,2017,2018
 ./bin/tests/system/rpzrecurse/ns2/named.max.conf       CONF-C  2018
 ./bin/tests/system/rpzrecurse/ns2/named.wildcard1.conf CONF-C  2015,2016,2017,2018