* Main rpz test DNS server.
*/
+{% set bad_dlz = bad_dlz | default(False) %}
+
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
file "wild-cname.db";
};
+{% if bad_dlz %}
# A faulty dlz configuration to check if named with response policy zones
# survives a certain class of failed configuration attempts (see GL #3880).
# "dlz" is used because the dlz processing code is located in an ideal place in
# the view configuration function for the test to cover the view reverting code.
-# The "BAD" comments below are necessary, because they will be removed using
-# 'sed' by tests.sh in order to activate the faulty configuration.
-#BAD dlz "bad-dlz" {
-#BAD database "dlopen bad-dlz.@DYLIB@ example.org";
-#BAD };
+ dlz "bad-dlz" {
+ database "dlopen bad-dlz.@DYLIB@ example.org";
+ };
+{% endif %}
--- /dev/null
+named.conf.j2
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * 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 https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+{% set bad_dlz = True %}
+
+{% include "ns3/named.conf.j2" %}
nextpart $dir/named.run >/dev/null
done
-copy_setports ns1/named.conf.in ns1/named.conf
-copy_setports ns2/named.conf.in ns2/named.conf
-copy_setports ns3/named.conf.in ns3/named.conf
-copy_setports ns4/named.conf.in ns4/named.conf
-copy_setports ns5/named.conf.in ns5/named.conf
-copy_setports ns6/named.conf.in ns6/named.conf
-copy_setports ns7/named.conf.in ns7/named.conf
-copy_setports ns8/named.conf.in ns8/named.conf
-copy_setports ns9/named.conf.in ns9/named.conf
-copy_setports ns10/named.conf.in ns10/named.conf
-
# set up test policy zones.
# bl is the main test zone
# bl-2 is used to check competing zones.
# (re)load the response policy zones with the rules in the file $TEST_FILE
load_db() {
if test -n "$TEST_FILE"; then
- copy_setports $TEST_FILE tmp
-
- if $NSUPDATE -v tmp; then
+ if $NSUPDATE -v $TEST_FILE; then
:
$RNDCCMD $ns3 sync
else
$RNDCCMD $ns3 sync
exit 1
fi
- rm -f tmp
fi
}
end_group() {
if test -n "$TEST_FILE"; then
# remove the previous set of test rules
- copy_setports $TEST_FILE tmp
- sed -e 's/[ ]add[ ]/ delete /' tmp | $NSUPDATE
+ sed -e 's/[ ]add[ ]/ delete /' $TEST_FILE | $NSUPDATE
rm -f tmp
TEST_FILE=
fi
t=$((t + 1))
echo_i "checking if rpz survives a certain class of failed reconfiguration attempts (${t})"
-sed -e "s/^#BAD//" <ns3/named.conf.in >ns3/named.conf.tmp
-copy_setports ns3/named.conf.tmp ns3/named.conf
-rm ns3/named.conf.tmp
+cp ns3/named2.conf ns3/named.conf
$RNDCCMD $ns3 reconfig >/dev/null 2>&1 && setret "failed"
sleep 1
-copy_setports ns3/named.conf.in ns3/named.conf
+cp ns3/named1.conf ns3/named.conf
$RNDCCMD $ns3 reconfig || setret "failed"
t=$((t + 1))
"dnsrps.conf",
"dnsrps.zones",
"proto.*",
+ "test*",
"trusted.conf",
"ns2/K*",
"ns2/bl.tld2.db",