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

13 files changed:
REUSE.toml
bin/tests/system/notify/ns1/named.conf.j2 [moved from bin/tests/system/notify/ns1/named.conf.in with 100% similarity]
bin/tests/system/notify/ns2/named-tls.conf.j2 [moved from bin/tests/system/notify/ns2/named-tls.conf.in with 100% similarity]
bin/tests/system/notify/ns2/named.conf.j2 [moved from bin/tests/system/notify/ns2/named.conf.in with 88% similarity]
bin/tests/system/notify/ns2/options-tls.conf.in [deleted file]
bin/tests/system/notify/ns3/named-tls.conf.j2 [moved from bin/tests/system/notify/ns3/named-tls.conf.in with 100% similarity]
bin/tests/system/notify/ns3/named.conf.j2 [moved from bin/tests/system/notify/ns3/named.conf.in with 90% similarity]
bin/tests/system/notify/ns3/options-tls.conf.in [deleted file]
bin/tests/system/notify/ns4/named.conf.j2 [moved from bin/tests/system/notify/ns4/named.conf.in with 100% similarity]
bin/tests/system/notify/ns4/named.port.j2 [moved from bin/tests/system/notify/ns4/named.port.in with 100% similarity]
bin/tests/system/notify/ns5/named.conf.j2 [moved from bin/tests/system/notify/ns5/named.conf.in with 100% similarity]
bin/tests/system/notify/setup.sh
bin/tests/system/notify/tests_sh_notify.py

index 18b094d12b8a5d0a1bced4fc317c49b0d2fee77f..7d0aaeb149449638cb7bd59cf0d667c853847f88 100644 (file)
@@ -86,7 +86,7 @@ path = [
        "bin/tests/system/notify/CA/index.txt",
        "bin/tests/system/notify/CA/index.txt.attr",
        "bin/tests/system/notify/CA/serial",
-       "bin/tests/system/notify/ns4/named.port.in",
+       "bin/tests/system/notify/ns4/named.port.j2",
        "bin/tests/system/nsupdate/CA/CA.cfg",
        "bin/tests/system/nsupdate/CA/README",
        "bin/tests/system/nsupdate/CA/index.txt",
similarity index 88%
rename from bin/tests/system/notify/ns2/named.conf.in
rename to bin/tests/system/notify/ns2/named.conf.j2
index 2c80fc3027dfd41de0ccd97bc746cf3ab950d86e..6ef327398d9bc3d6eef1934459c3b45645095527 100644 (file)
@@ -11,7 +11,9 @@
  * information regarding copyright ownership.
  */
 
+{% if FEATURE_FIPS_DH == "1" %}
 include "named-tls.conf";
+{% endif %}
 
 options {
        query-source address 10.53.0.2;
@@ -19,7 +21,6 @@ options {
        notify-source-v6 fd92:7065:b8e:ffff::2;
        transfer-source 10.53.0.2;
        port @PORT@;
-       include "options-tls.conf";
        pid-file "named.pid";
        listen-on { 10.53.0.2; };
        listen-on-v6 { none; };
@@ -28,6 +29,15 @@ options {
        notify yes;
        startup-notify-rate 5;
        dnssec-validation no;
+
+{% if FEATURE_FIPS_DH == "1" %}
+       tls-port @TLSPORT@;
+       listen-on tls ephemeral { 10.53.0.2; };
+       listen-on port @EXTRAPORT1@ tls tls-forward-secrecy { 10.53.0.2; };
+       listen-on port @EXTRAPORT3@ tls tls-forward-secrecy-mutual-tls { 10.53.0.2; };
+       listen-on port @EXTRAPORT4@ tls tls-expired { 10.53.0.2; };
+{% endif %}
+
 };
 
 key rndc_key {
diff --git a/bin/tests/system/notify/ns2/options-tls.conf.in b/bin/tests/system/notify/ns2/options-tls.conf.in
deleted file mode 100644 (file)
index 29f4df5..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.2; };
-       listen-on port @EXTRAPORT1@ tls tls-forward-secrecy { 10.53.0.2; };
-       listen-on port @EXTRAPORT3@ tls tls-forward-secrecy-mutual-tls { 10.53.0.2; };
-       listen-on port @EXTRAPORT4@ tls tls-expired { 10.53.0.2; };
similarity index 90%
rename from bin/tests/system/notify/ns3/named.conf.in
rename to bin/tests/system/notify/ns3/named.conf.j2
index 65983e38a0fb264070e69fd98b31a5dcb8f75130..756ec746fc474b9695cc0b0a8b29d8629054e291 100644 (file)
  * information regarding copyright ownership.
  */
 
+{% if FEATURE_FIPS_DH == "1" %}
 include "named-tls.conf";
+{% endif %}
 
 options {
        query-source address 10.53.0.3;
        notify-source 10.53.0.3;
        transfer-source 10.53.0.3;
        port @PORT@;
-       include "options-tls.conf";
        pid-file "named.pid";
        listen-on { 10.53.0.3; };
        listen-on-v6 { fd92:7065:b8e:ffff::3; };
@@ -27,6 +28,11 @@ options {
        dnssec-validation no;
 
        tcp-initial-timeout 150; # 15 seconds
+
+{% if FEATURE_FIPS_DH == "1" %}
+       tls-port @TLSPORT@;
+{% endif %}
+
 };
 
 zone "." {
diff --git a/bin/tests/system/notify/ns3/options-tls.conf.in b/bin/tests/system/notify/ns3/options-tls.conf.in
deleted file mode 100644 (file)
index fe3491e..0000000
+++ /dev/null
@@ -1,14 +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@;
index 6793a33f8dc212a2597c1a7b548052d0c34158f9..5948652d130a8850727043b0cba8e8744e94f141 100644 (file)
 
 . ../conf.sh
 
-copy_setports ns1/named.conf.in ns1/named.conf
-if $FEATURETEST --have-fips-dh; then
-  copy_setports ns2/named-tls.conf.in ns2/named-tls.conf
-  copy_setports ns2/options-tls.conf.in ns2/options-tls.conf
-  copy_setports ns2/named.conf.in ns2/named.conf
-else
-  cp /dev/null ns2/named-tls.conf
-  cp /dev/null ns2/options-tls.conf
-  copy_setports ns2/named.conf.in ns2/named.conf
-fi
-if $FEATURETEST --have-fips-dh; then
-  copy_setports ns3/named-tls.conf.in ns3/named-tls.conf
-  copy_setports ns3/options-tls.conf.in ns3/options-tls.conf
-  copy_setports ns3/named.conf.in ns3/named.conf
-else
-  cp /dev/null ns3/named-tls.conf
-  cp /dev/null ns3/options-tls.conf
-  copy_setports ns3/named.conf.in ns3/named.conf
-fi
-copy_setports ns4/named.conf.in ns4/named.conf
-copy_setports ns5/named.conf.in ns5/named.conf
-
-copy_setports ns4/named.port.in ns4/named.port
-
 cp -f ns2/example1.db ns2/example.db
 cp -f ns2/generic.db ns2/x21.db
index ff8e9df2c72093802c74bc0734e2e4a9e7ffe712..74c626b76b95f7cf8909fc937926399562c66eff 100644 (file)
@@ -17,11 +17,9 @@ pytestmark = pytest.mark.extra_artifacts(
         "dig.out.*",
         "ns2/example.db",
         "ns2/named-tls.conf",
-        "ns2/options-tls.conf",
         "ns2/x21.db*",
         "ns3/example.bk",
         "ns3/named-tls.conf",
-        "ns3/options-tls.conf",
         "ns4/named.port",
         "ns4/x21.bk",
         "ns4/x21.bk.jnl",