From: Mukund Sivaraman Date: Sat, 12 May 2018 03:03:18 +0000 (+0530) Subject: Add system test X-Git-Tag: v9.13.2~21^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2bf388a31b94e759c6aa87299345daaeac942997;p=thirdparty%2Fbind9.git Add system test --- diff --git a/bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength b/bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength new file mode 100644 index 00000000000..895f52635fc --- /dev/null +++ b/bin/tests/system/rpzrecurse/ns2/db.invalidprefixlength @@ -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 index 00000000000..fe5935517c9 --- /dev/null +++ b/bin/tests/system/rpzrecurse/ns2/named.invalidprefixlength.conf @@ -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"; }; +}; diff --git a/bin/tests/system/rpzrecurse/tests.sh b/bin/tests/system/rpzrecurse/tests.sh index e891f01d0f2..923f6f4182d 100644 --- a/bin/tests/system/rpzrecurse/tests.sh +++ b/bin/tests/system/rpzrecurse/tests.sh @@ -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 diff --git a/util/copyrights b/util/copyrights index 32f7aaa31cc..81498f6a33e 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1912,6 +1912,7 @@ ./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 @@ -1923,6 +1924,7 @@ ./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