]> 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:33:15 +0000 (17:33 +1000)
(cherry picked from commit 2bf388a31b94e759c6aa87299345daaeac942997)

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 b49f2fd93e82179d3c01ab830998d2e399e4266d..eb5e09246e78ddd3dc4e2148a0a2e657f51a4d6c 100644 (file)
@@ -460,6 +460,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 c34732bdc70d1ef41482d67613dbc9f28170c0e2..fc690558b1ccec61316fbc85ba39aad8de061b57 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.wildcard1.conf CONF-C  2015,2016,2017,2018
 ./bin/tests/system/rpzrecurse/ns2/named.wildcard2.conf CONF-C  2015,2016,2017,2018