]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use jinja2 templates in synthfromdnssec test
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 16:19:26 +0000 (17:19 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:14 +0000 (14:23 +0100)
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.

13 files changed:
bin/tests/system/synthfromdnssec/ns1/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns1/named.conf.in with 90% similarity]
bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/ns2/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns2/named.conf.in with 88% similarity]
bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/ns3/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns3/named.conf.in with 87% similarity]
bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/ns4/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns4/named.conf.in with 86% similarity]
bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/ns5/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns5/named.conf.in with 88% similarity]
bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/ns6/named.conf.j2 [moved from bin/tests/system/synthfromdnssec/ns6/named.conf.in with 86% similarity]
bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in [deleted file]
bin/tests/system/synthfromdnssec/setup.sh

similarity index 90%
rename from bin/tests/system/synthfromdnssec/ns1/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns1/named.conf.j2
index e0ff8da1c519c7f388e57052c1aec4e7b0a77be8..f409fe2891aaf2655f81263494857dad32a327ce 100644 (file)
@@ -35,7 +35,11 @@ controls {
        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type primary;
diff --git a/bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in
deleted file mode 100644 (file)
index 12a1e27..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
-};
similarity index 88%
rename from bin/tests/system/synthfromdnssec/ns2/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns2/named.conf.j2
index efcf7e5d78d9c4d57341465b535a2d54101e3a7c..ca326e5d23ae100a8639943c37f8331a640823bf 100644 (file)
@@ -35,7 +35,11 @@ controls {
        inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in
deleted file mode 100644 (file)
index 6dd1516..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
-};
similarity index 87%
rename from bin/tests/system/synthfromdnssec/ns3/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns3/named.conf.j2
index 7665d8a6e6d32598524a30a0b06c7e7f3167e190..b4fceb903c845edb872cb783a2684ec99613ba47 100644 (file)
@@ -35,7 +35,11 @@ controls {
        inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in
deleted file mode 100644 (file)
index a755c39..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
-};
similarity index 86%
rename from bin/tests/system/synthfromdnssec/ns4/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns4/named.conf.j2
index 85cbc38d98696f4c4536f2f056fa5cfed956192b..9f55cb9ddec3ce0a2f4944fddd89451296c5acc8 100644 (file)
@@ -36,7 +36,11 @@ controls {
        inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.4 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in
deleted file mode 100644 (file)
index 5a89f8d..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.4 port @EXTRAPORT1@ allow { any; };
-};
similarity index 88%
rename from bin/tests/system/synthfromdnssec/ns5/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns5/named.conf.j2
index 0875b7701eb9fddf8ddaa1ee50820480d9d5af62..cf75599726bad60911b351d31b10c3fdffc2b231 100644 (file)
@@ -37,7 +37,11 @@ controls {
        inet 10.53.0.5 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.5 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in
deleted file mode 100644 (file)
index 12a9398..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.5 port @EXTRAPORT1@ allow { any; };
-};
similarity index 86%
rename from bin/tests/system/synthfromdnssec/ns6/named.conf.in
rename to bin/tests/system/synthfromdnssec/ns6/named.conf.j2
index 1f631865acfc04b24f78d291db265c584cefbeb0..3000b47825f7917812bd3a74485fd49f0cbad45f 100644 (file)
@@ -36,7 +36,11 @@ controls {
        inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-include "statistics-channels.conf";
+{% if FEATURE_LIBXML2 == "1" or FEATURE_JSON_C == "1" %}
+statistics-channels {
+       inet 10.53.0.6 port @EXTRAPORT1@ allow { any; };
+};
+{% endif %}
 
 zone "." {
        type hint;
diff --git a/bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in b/bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in
deleted file mode 100644 (file)
index 138a84b..0000000
+++ /dev/null
@@ -1,16 +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.
- */
-
-statistics-channels {
-        inet 10.53.0.6 port @EXTRAPORT1@ allow { any; };
-};
index 85feba601d04cbd0960b6f858cfa18958d34fd6f..db51cff6eb223dcd6e154ccb9d91ef40aea0561c 100644 (file)
 
 set -e
 
-for d in ns1 ns2 ns3 ns4 ns5 ns6; do
-  conf=named.conf
-  copy_setports "${d}/${conf}.in" "${d}/${conf}"
-  conf=statistics-channels.conf
-  if $FEATURETEST --have-libxml2 || $FEATURETEST --have-json-c; then
-    copy_setports "${d}/${conf}.in" "${d}/${conf}"
-  else
-    echo "" >"${d}/${conf}"
-  fi
-done
-
 (
   cd ns1
   $SHELL sign.sh