]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use jinja2 templates in legacy test
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 16:04:00 +0000 (17:04 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:17 +0000 (14:23 +0100)
The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.

13 files changed:
bin/tests/system/legacy/ns1/named.conf.j2 [moved from bin/tests/system/legacy/ns1/named1.conf.in with 82% similarity]
bin/tests/system/legacy/ns1/named2.conf.j2 [moved from bin/tests/system/legacy/ns1/named2.conf.in with 58% similarity]
bin/tests/system/legacy/ns10/named.conf.j2 [moved from bin/tests/system/legacy/ns10/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns2/named.conf.j2 [moved from bin/tests/system/legacy/ns2/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns3/named.conf.j2 [moved from bin/tests/system/legacy/ns3/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns4/named.conf.j2 [moved from bin/tests/system/legacy/ns4/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns5/named.conf.j2 [moved from bin/tests/system/legacy/ns5/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns6/named.conf.j2 [moved from bin/tests/system/legacy/ns6/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns7/named.conf.j2 [moved from bin/tests/system/legacy/ns7/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns8/named.conf.j2 [moved from bin/tests/system/legacy/ns8/named.conf.in with 100% similarity]
bin/tests/system/legacy/ns9/named.conf.j2 [moved from bin/tests/system/legacy/ns9/named.conf.in with 100% similarity]
bin/tests/system/legacy/setup.sh [deleted file]
bin/tests/system/legacy/tests.sh

similarity index 82%
rename from bin/tests/system/legacy/ns1/named1.conf.in
rename to bin/tests/system/legacy/ns1/named.conf.j2
index 1441674f402aebeec34e7fa99a8fb286576e9151..31f41a8298a9cf52eb57f35bba7e2f2b0785092f 100644 (file)
@@ -11,6 +11,8 @@
  * information regarding copyright ownership.
  */
 
+{% set dnssec_validation = dnssec_validation | default("no") %}
+
 options {
        query-source address 10.53.0.1;
        notify-source 10.53.0.1;
@@ -20,7 +22,7 @@ options {
        listen-on { 10.53.0.1; };
        listen-on-v6 { none; };
        recursion yes;
-       dnssec-validation no;
+       dnssec-validation @dnssec_validation@;
 };
 
 
@@ -37,3 +39,7 @@ zone "." {
        type primary;
        file "root.db";
 };
+
+{% if dnssec_validation != "no" %}
+include "trusted.conf";
+{% endif %}
similarity index 58%
rename from bin/tests/system/legacy/ns1/named2.conf.in
rename to bin/tests/system/legacy/ns1/named2.conf.j2
index 239e58f1b7a3e3f24bd054c33541ba0d018f3d61..184f26813b2cec763bad77623c500659ae75582c 100644 (file)
  * information regarding copyright ownership.
  */
 
-options {
-       query-source address 10.53.0.1;
-       notify-source 10.53.0.1;
-       transfer-source 10.53.0.1;
-       port @PORT@;
-       pid-file "named.pid";
-       listen-on { 10.53.0.1; };
-       listen-on-v6 { none; };
-       recursion yes;
-       dnssec-validation yes;
-};
+{% set dnssec_validation = "yes" %}
 
-zone "." {
-       type primary;
-       file "root.db";
-};
-
-include "trusted.conf";
+{% include "ns1/named.conf.j2" %}
diff --git a/bin/tests/system/legacy/setup.sh b/bin/tests/system/legacy/setup.sh
deleted file mode 100644 (file)
index d2a53bb..0000000
+++ /dev/null
@@ -1,25 +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/named1.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
index 8c9c229a19bb8c90106d163e72c3abc94af07d48..f1aa59a0128022f793a805399bdc2b669db7abae 100755 (executable)
@@ -250,7 +250,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
 stop_server --use-rndc --port ${CONTROLPORT} ns1
-copy_setports ns1/named2.conf.in ns1/named.conf
+cp ns1/named2.conf ns1/named.conf
 start_server --noclean --restart --port ${PORT} ns1
 
 n=$((n + 1))