From: Nicki Křížek Date: Fri, 5 Dec 2025 16:19:26 +0000 (+0100) Subject: Use jinja2 templates in synthfromdnssec test X-Git-Tag: v9.21.17~46^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=719c656d2b48f55672ec71d70ac53b012d7c4e0a;p=thirdparty%2Fbind9.git Use jinja2 templates in synthfromdnssec test - Merge ns*/statistics-channels.conf.in config snippets into conditionally rendered section in ns*/named.conf.j2 files. --- diff --git a/bin/tests/system/synthfromdnssec/ns1/named.conf.in b/bin/tests/system/synthfromdnssec/ns1/named.conf.j2 similarity index 90% rename from bin/tests/system/synthfromdnssec/ns1/named.conf.in rename to bin/tests/system/synthfromdnssec/ns1/named.conf.j2 index e0ff8da1c51..f409fe2891a 100644 --- a/bin/tests/system/synthfromdnssec/ns1/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns1/named.conf.j2 @@ -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 index 12a1e27003e..00000000000 --- a/bin/tests/system/synthfromdnssec/ns1/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/ns2/named.conf.in b/bin/tests/system/synthfromdnssec/ns2/named.conf.j2 similarity index 88% rename from bin/tests/system/synthfromdnssec/ns2/named.conf.in rename to bin/tests/system/synthfromdnssec/ns2/named.conf.j2 index efcf7e5d78d..ca326e5d23a 100644 --- a/bin/tests/system/synthfromdnssec/ns2/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns2/named.conf.j2 @@ -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 index 6dd1516962e..00000000000 --- a/bin/tests/system/synthfromdnssec/ns2/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/ns3/named.conf.in b/bin/tests/system/synthfromdnssec/ns3/named.conf.j2 similarity index 87% rename from bin/tests/system/synthfromdnssec/ns3/named.conf.in rename to bin/tests/system/synthfromdnssec/ns3/named.conf.j2 index 7665d8a6e6d..b4fceb903c8 100644 --- a/bin/tests/system/synthfromdnssec/ns3/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns3/named.conf.j2 @@ -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 index a755c394391..00000000000 --- a/bin/tests/system/synthfromdnssec/ns3/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/ns4/named.conf.in b/bin/tests/system/synthfromdnssec/ns4/named.conf.j2 similarity index 86% rename from bin/tests/system/synthfromdnssec/ns4/named.conf.in rename to bin/tests/system/synthfromdnssec/ns4/named.conf.j2 index 85cbc38d986..9f55cb9ddec 100644 --- a/bin/tests/system/synthfromdnssec/ns4/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns4/named.conf.j2 @@ -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 index 5a89f8d4892..00000000000 --- a/bin/tests/system/synthfromdnssec/ns4/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/ns5/named.conf.in b/bin/tests/system/synthfromdnssec/ns5/named.conf.j2 similarity index 88% rename from bin/tests/system/synthfromdnssec/ns5/named.conf.in rename to bin/tests/system/synthfromdnssec/ns5/named.conf.j2 index 0875b7701eb..cf75599726b 100644 --- a/bin/tests/system/synthfromdnssec/ns5/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns5/named.conf.j2 @@ -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 index 12a9398c601..00000000000 --- a/bin/tests/system/synthfromdnssec/ns5/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/ns6/named.conf.in b/bin/tests/system/synthfromdnssec/ns6/named.conf.j2 similarity index 86% rename from bin/tests/system/synthfromdnssec/ns6/named.conf.in rename to bin/tests/system/synthfromdnssec/ns6/named.conf.j2 index 1f631865acf..3000b47825f 100644 --- a/bin/tests/system/synthfromdnssec/ns6/named.conf.in +++ b/bin/tests/system/synthfromdnssec/ns6/named.conf.j2 @@ -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 index 138a84bde38..00000000000 --- a/bin/tests/system/synthfromdnssec/ns6/statistics-channels.conf.in +++ /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; }; -}; diff --git a/bin/tests/system/synthfromdnssec/setup.sh b/bin/tests/system/synthfromdnssec/setup.sh index 85feba601d0..db51cff6eb2 100644 --- a/bin/tests/system/synthfromdnssec/setup.sh +++ b/bin/tests/system/synthfromdnssec/setup.sh @@ -16,17 +16,6 @@ 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