]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use jinja2 templates in logfileconf test
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 13:50:55 +0000 (14:50 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:14 +0000 (14:23 +0100)
- Replace all named*.in files with jinja2 templates.
- Rename the config files to named.*.conf convention.
- Rename named.plain.in to named.plain.conf.j2 and symlink it as te
  default config.
- Rename named.plainconf.in to named.plainlog.conf.j2 (there is a slight
  difference from named.plain, despite the similar name)

15 files changed:
bin/tests/system/logfileconfig/ns1/named.abspath.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.abspathconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.conf.j2 [new symlink]
bin/tests/system/logfileconfig/ns1/named.dir.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.dirconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.inc.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.incconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.iso8601-utc.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.iso8601-utc.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.iso8601.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.iso8601.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.pipe.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.pipeconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.plain.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.plain.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.plainlog.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.plainconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.sym.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.symconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.ts.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.tsconf.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.unlimited.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.unlimited.in with 100% similarity]
bin/tests/system/logfileconfig/ns1/named.vers.conf.j2 [moved from bin/tests/system/logfileconfig/ns1/named.versconf.in with 100% similarity]
bin/tests/system/logfileconfig/setup.sh [deleted file]
bin/tests/system/logfileconfig/tests.sh

diff --git a/bin/tests/system/logfileconfig/ns1/named.conf.j2 b/bin/tests/system/logfileconfig/ns1/named.conf.j2
new file mode 120000 (symlink)
index 0000000..abb4a9f
--- /dev/null
@@ -0,0 +1 @@
+named.plain.conf.j2
\ No newline at end of file
diff --git a/bin/tests/system/logfileconfig/setup.sh b/bin/tests/system/logfileconfig/setup.sh
deleted file mode 100644 (file)
index 8884af7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# 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.
-
-. ../conf.sh
-
-copy_setports ns1/named.plain.in ns1/named.conf
index 1b411174cd290c3e2830e9a3999efddd58f1b0ea..d3af326e5dfe89416f047d53d5fe983da1fd8744 100644 (file)
@@ -40,7 +40,7 @@ n=$((n + 1))
 echo_i "testing log file validity (only plain files allowed) ($n)"
 ret=0
 cat /dev/null >ns1/named_log
-copy_setports ns1/named.plainconf.in ns1/named.conf
+cp ns1/named.plainlog.conf ns1/named.conf
 nextpart ns1/named.run >/dev/null
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 wait_for_log 5 "reloading configuration succeeded" ns1/named.run || ret=1
@@ -52,7 +52,7 @@ n=$((n + 1))
 echo_i "testing directory as log file ($n)"
 ret=0
 nextpart ns1/named.run >/dev/null
-copy_setports ns1/named.dirconf.in ns1/named.conf
+cp ns1/named.dir.conf ns1/named.conf
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 wait_for_log 5 "reloading configuration failed: invalid file" ns1/named.run || ret=1
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -65,7 +65,7 @@ ret=0
 nextpart ns1/named.run >/dev/null
 rm -f ns1/named_pipe
 if mkfifo ns1/named_pipe >/dev/null 2>&1; then
-  copy_setports ns1/named.pipeconf.in ns1/named.conf
+  cp ns1/named.pipe.conf ns1/named.conf
   rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
   wait_for_log 5 "reloading configuration failed: invalid file" ns1/named.run || ret=1
   if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -82,7 +82,7 @@ rm -f ns1/named_log ns1/named_sym
 touch ns1/named_log
 if ln -s $(pwd)/ns1/named_log $(pwd)/ns1/named_sym >/dev/null 2>&1; then
   nextpart ns1/named.run >/dev/null
-  copy_setports ns1/named.symconf.in ns1/named.conf
+  cp ns1/named.sym.conf ns1/named.conf
   rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
   wait_for_log 5 "reloading configuration succeeded" ns1/named.run || ret=1
   if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -92,7 +92,7 @@ else
 fi
 
 echo_i "repeat previous tests without named -g"
-copy_setports ns1/named.plain.in ns1/named.conf
+cp ns1/named.plain.conf ns1/named.conf
 stop_server --use-rndc --port ${CONTROLPORT} ns1
 cp named1.args ns1/named.args
 start_server --noclean --restart --port ${PORT} ns1
@@ -101,7 +101,7 @@ n=$((n + 1))
 echo_i "testing log file validity (only plain files allowed) ($n)"
 ret=0
 cat /dev/null >ns1/named_log
-copy_setports ns1/named.plainconf.in ns1/named.conf
+cp ns1/named.plainlog.conf ns1/named.conf
 nextpart ns1/named.run >/dev/null
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 wait_for_log 5 "reloading configuration succeeded" ns1/named.run || ret=1
@@ -113,7 +113,7 @@ n=$((n + 1))
 echo_i "testing directory as log file ($n)"
 ret=0
 nextpart ns1/named.run >/dev/null
-copy_setports ns1/named.dirconf.in ns1/named.conf
+cp ns1/named.dir.conf ns1/named.conf
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 wait_for_log 5 "reloading configuration failed: invalid file" ns1/named.run || ret=1
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -126,7 +126,7 @@ ret=0
 nextpart ns1/named.run >/dev/null
 rm -f ns1/named_pipe
 if mkfifo ns1/named_pipe >/dev/null 2>&1; then
-  copy_setports ns1/named.pipeconf.in ns1/named.conf
+  cp ns1/named.pipe.conf ns1/named.conf
   rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
   wait_for_log 5 "reloading configuration failed: invalid file" ns1/named.run || ret=1
   if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -143,7 +143,7 @@ rm -f ns1/named_log ns1/named_sym
 touch ns1/named_log
 if ln -s $(pwd)/ns1/named_log $(pwd)/ns1/named_sym >/dev/null 2>&1; then
   nextpart ns1/named.run >/dev/null
-  copy_setports ns1/named.symconf.in ns1/named.conf
+  cp ns1/named.sym.conf ns1/named.conf
   rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
   wait_for_log 5 "reloading configuration succeeded" ns1/named.run || ret=1
   if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -156,7 +156,7 @@ echo_i "testing logging functionality"
 n=$((n + 1))
 ret=0
 echo_i "testing iso8601 timestamp ($n)"
-copy_setports ns1/named.iso8601.in ns1/named.conf
+cp ns1/named.iso8601.conf ns1/named.conf
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 grep '^....-..-..T..:..:..\.... ' ns1/named_iso8601 >/dev/null || ret=1
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -165,7 +165,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing iso8601-utc timestamp ($n)"
 ret=0
-copy_setports ns1/named.iso8601-utc.in ns1/named.conf
+cp ns1/named.iso8601-utc.conf ns1/named.conf
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
 grep '^....-..-..T..:..:..\....Z' ns1/named_iso8601_utc >/dev/null || ret=1
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi
@@ -174,7 +174,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing explicit versions ($n)"
 ret=0
-copy_setports ns1/named.versconf.in ns1/named.conf
+cp ns1/named.vers.conf ns1/named.conf
 # a seconds since epoch version number
 touch ns1/named_vers.1480039317
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
@@ -192,7 +192,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing timestamped versions ($n)"
 ret=0
-copy_setports ns1/named.tsconf.in ns1/named.conf
+cp ns1/named.ts.conf ns1/named.conf
 # a seconds since epoch version number
 touch ns1/named_ts.1480039317
 # a timestamp version number
@@ -217,7 +217,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing incremented versions ($n)"
 ret=0
-copy_setports ns1/named.incconf.in ns1/named.conf
+cp ns1/named.inc.conf ns1/named.conf
 try=0
 while test $try -lt 12; do
   touch ns1/named_inc.$try
@@ -243,7 +243,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing absolute file path versions ($n)"
 ret=0
-copy_setports ns1/named.abspathconf.in ns1/named.conf
+cp ns1/named.abspath.conf ns1/named.conf
 try=0
 while test $try -lt 12; do
   touch $TMPDIR/example.log.$try
@@ -269,7 +269,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "testing unlimited versions ($n)"
 ret=0
-copy_setports ns1/named.unlimited.in ns1/named.conf
+cp ns1/named.unlimited.conf ns1/named.conf
 # a seconds since epoch version number
 touch ns1/named_unlimited.1480039317
 rndc_reconfig ns1 10.53.0.1 >rndc.out.test$n
@@ -313,7 +313,7 @@ stop_server ns1
 cp named2.args ns1/named.args
 test -f ns1/named.pid && ret=1
 rm -f ns1/named_deflog
-copy_setports ns1/named.plainconf.in ns1/named.conf
+cp ns1/named.plainlog.conf ns1/named.conf
 start_server --noclean --restart --port ${PORT} ns1
 [ -f "ns1/named_deflog" ] || ret=1
 if [ "$ret" -ne 0 ]; then echo_i "failed"; fi