]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use jinja2 templates in rpzrecurse test
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 16:04:25 +0000 (17:04 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:14 +0000 (14:23 +0100)
- Change ns2 header into jinja2 template.
- Keep the various ns2 config files as non-templates, same for the
  named.default.conf to be consistent.
- Symlink the ns2/named.default.conf as a jinja2 template to pick a
  starting config. It is rendered as a template to avoid an error when
  the test would overwrite a git-tracked file.
- Use jinja2 templates for the ns3 files, keep named1.conf around
  because it's needed later in the test to restore the config. Symlink
  it to `ns3/named.conf.j2` to select a default config.

bin/tests/system/rpzrecurse/ns1/named.conf.j2 [moved from bin/tests/system/rpzrecurse/ns1/named.conf.in with 100% similarity]
bin/tests/system/rpzrecurse/ns2/named.conf.header.j2 [moved from bin/tests/system/rpzrecurse/ns2/named.conf.header.in with 100% similarity]
bin/tests/system/rpzrecurse/ns2/named.conf.j2 [new symlink]
bin/tests/system/rpzrecurse/ns3/named.conf.j2 [new symlink]
bin/tests/system/rpzrecurse/ns3/named1.conf.j2 [moved from bin/tests/system/rpzrecurse/ns3/named1.conf.in with 100% similarity]
bin/tests/system/rpzrecurse/ns3/named2.conf.j2 [moved from bin/tests/system/rpzrecurse/ns3/named2.conf.in with 100% similarity]
bin/tests/system/rpzrecurse/ns3/named3.conf.j2 [moved from bin/tests/system/rpzrecurse/ns3/named3.conf.in with 100% similarity]
bin/tests/system/rpzrecurse/ns4/named.conf.j2 [moved from bin/tests/system/rpzrecurse/ns4/named.conf.in with 100% similarity]
bin/tests/system/rpzrecurse/setup.sh
bin/tests/system/rpzrecurse/tests.sh

diff --git a/bin/tests/system/rpzrecurse/ns2/named.conf.j2 b/bin/tests/system/rpzrecurse/ns2/named.conf.j2
new file mode 120000 (symlink)
index 0000000..1be181d
--- /dev/null
@@ -0,0 +1 @@
+named.default.conf
\ No newline at end of file
diff --git a/bin/tests/system/rpzrecurse/ns3/named.conf.j2 b/bin/tests/system/rpzrecurse/ns3/named.conf.j2
new file mode 120000 (symlink)
index 0000000..96e5f1d
--- /dev/null
@@ -0,0 +1 @@
+named1.conf.j2
\ No newline at end of file
index b08beedf41fbd1d6337aebed41e1c6b4b91e0fc7..6e6cca188234b9951d10d6a57790e94b564d2498 100644 (file)
@@ -17,15 +17,6 @@ set -e
 
 $PERL testgen.pl
 
-copy_setports ns1/named.conf.in ns1/named.conf
-
-copy_setports ns2/named.conf.header.in ns2/named.conf.header
-copy_setports ns2/named.default.conf ns2/named.conf
-
-copy_setports ns3/named1.conf.in ns3/named.conf
-
-copy_setports ns4/named.conf.in ns4/named.conf
-
 # setup policy zones for a 64-zone test
 i=1
 while test $i -le 64; do
index 3e8b6ffbafa0caf89ee766dcd30670d246e58740..251e353ff8849c057f68e02735ccac6f6650756c 100644 (file)
@@ -448,7 +448,7 @@ p1=$((t2 - t1))
 echo_i "elapsed time $p1 seconds"
 
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
-copy_setports ns3/named2.conf.in ns3/named.conf
+cp ns3/named2.conf ns3/named.conf
 nextpart ns3/named.run >/dev/null
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload >/dev/null
 wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1
@@ -466,7 +466,7 @@ status=$((status + ret))
 
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
 # restore original named.conf
-copy_setports ns3/named1.conf.in ns3/named.conf
+cp ns3/named1.conf ns3/named.conf
 nextpart ns3/named.run >/dev/null
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload >/dev/null
 wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1
@@ -483,7 +483,7 @@ p1=$((t2 - t1))
 echo_i "elapsed time $p1 seconds"
 
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} flush
-copy_setports ns3/named3.conf.in ns3/named.conf
+cp ns3/named3.conf ns3/named.conf
 nextpart ns3/named.run >/dev/null
 $RNDC -c ../_common/rndc.conf -s 10.53.0.3 -p ${CONTROLPORT} reload >/dev/null
 wait_for_log 20 "rpz: policy: reload done" ns3/named.run || ret=1