]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use jinja2 templates in nsupdate test
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 16:04:16 +0000 (17:04 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:14 +0000 (14:23 +0100)
- Merge ns1/tls.options.in into ns1/named.conf.j2 and render it
  conditionally. Also conditionally include the additional
  ns1/tls.conf.j2 which is always rendered.
- Use multiple templates for ns7 and replace the copy_setports.
- Use jinja2 template for verylarge.in as well.

16 files changed:
REUSE.toml
bin/tests/system/nsupdate/ns1/named.conf.j2 [moved from bin/tests/system/nsupdate/ns1/named.conf.in with 91% similarity]
bin/tests/system/nsupdate/ns1/tls.conf.j2 [moved from bin/tests/system/nsupdate/ns1/tls.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns1/tls.options.in [deleted file]
bin/tests/system/nsupdate/ns10/named.conf.j2 [moved from bin/tests/system/nsupdate/ns10/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns2/named.conf.j2 [moved from bin/tests/system/nsupdate/ns2/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns3/named.conf.j2 [moved from bin/tests/system/nsupdate/ns3/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns5/named.conf.j2 [moved from bin/tests/system/nsupdate/ns5/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns6/named.conf.j2 [moved from bin/tests/system/nsupdate/ns6/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns7/named.conf.j2 [moved from bin/tests/system/nsupdate/ns7/named1.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns7/named2.conf.j2 [moved from bin/tests/system/nsupdate/ns7/named2.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns8/named.conf.j2 [moved from bin/tests/system/nsupdate/ns8/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/ns9/named.conf.j2 [moved from bin/tests/system/nsupdate/ns9/named.conf.in with 100% similarity]
bin/tests/system/nsupdate/setup.sh
bin/tests/system/nsupdate/tests.sh
bin/tests/system/nsupdate/verylarge.j2 [moved from bin/tests/system/nsupdate/verylarge.in with 100% similarity]

index 7d0aaeb149449638cb7bd59cf0d667c853847f88..14c78fdf44cd06943f02a566a7714cea141bf8e9 100644 (file)
@@ -93,7 +93,7 @@ path = [
        "bin/tests/system/nsupdate/CA/index.txt.attr",
        "bin/tests/system/nsupdate/CA/serial",
        "bin/tests/system/nsupdate/commandlist",
-       "bin/tests/system/nsupdate/verylarge.in",
+       "bin/tests/system/nsupdate/verylarge.j2",
        "bin/tests/system/org.isc.bind.system.plist",
        "bin/tests/system/pipelined/input",
        "bin/tests/system/pipelined/inputb",
similarity index 91%
rename from bin/tests/system/nsupdate/ns1/named.conf.in
rename to bin/tests/system/nsupdate/ns1/named.conf.j2
index 7b5194f70d2524b54bdb9abf5bd365ed5215078f..20a6019cd5881ab21d78b472dc12ef74b09e466e 100644 (file)
@@ -11,7 +11,9 @@
  * information regarding copyright ownership.
  */
 
+{% if FEATURE_FIPS_DH == "1" %}
 include "tls.conf";
+{% endif %}
 
 options {
        query-source address 10.53.0.1;
@@ -27,7 +29,15 @@ options {
        minimal-responses no;
        update-quota 1;
        dnssec-validation no;
-       include "tls.options";
+
+{% if FEATURE_FIPS_DH == "1" %}
+       tls-port @TLSPORT@;
+       listen-on tls ephemeral { 10.53.0.1; };
+       listen-on port @EXTRAPORT1@ tls tls-forward-secrecy { 10.53.0.1; };
+       listen-on port @EXTRAPORT2@ tls tls-forward-secrecy-mutual-tls { 10.53.0.1; };
+       listen-on port @EXTRAPORT3@ tls tls-expired { 10.53.0.1; };
+{% endif %}
+
 };
 
 acl named-acl {
diff --git a/bin/tests/system/nsupdate/ns1/tls.options.in b/bin/tests/system/nsupdate/ns1/tls.options.in
deleted file mode 100644 (file)
index 52f514b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
-
-tls-port @TLSPORT@;
-listen-on tls ephemeral { 10.53.0.1; };
-listen-on port @EXTRAPORT1@ tls tls-forward-secrecy { 10.53.0.1; };
-listen-on port @EXTRAPORT2@ tls tls-forward-secrecy-mutual-tls { 10.53.0.1; };
-listen-on port @EXTRAPORT3@ tls tls-expired { 10.53.0.1; };
index d42af7f1e3db963b64bc43cca5fb1057858fef91..299330773a202246ee2b199d3f3576b1f3200339 100644 (file)
 
 . ../conf.sh
 
-if $FEATURETEST --have-fips-dh; then
-  copy_setports ns1/tls.conf.in ns1/tls.conf
-  copy_setports ns1/tls.options.in ns1/tls.options
-else
-  : >ns1/tls.conf
-  : >ns1/tls.options
-fi
-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 ns5/named.conf.in ns5/named.conf
-copy_setports ns6/named.conf.in ns6/named.conf
-copy_setports ns7/named1.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
-
-copy_setports verylarge.in verylarge
-
 cp -f ns1/example1.db ns1/example.db
 sed 's/example.nil/other.nil/g' ns1/example1.db >ns1/other.db
 sed 's/example.nil/unixtime.nil/g' ns1/example1.db >ns1/unixtime.db
index 1e5695ed97fdcd255360555994760e8f74574cbf..808a019bb7197871b7cd0cf94d8e1de1412aaafd 100755 (executable)
@@ -2464,7 +2464,7 @@ EOF
     status=1
   }
 
-  copy_setports ns7/named2.conf.in ns7/named.conf
+  cp ns7/named2.conf ns7/named.conf
   rndc_reload ns7 10.53.0.7
 
   n=$((n + 1))