From: Nicki Křížek Date: Wed, 1 Apr 2026 16:25:28 +0000 (+0200) Subject: Include controls.conf as jinja2 template X-Git-Tag: v9.21.23~29^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4ca352bc88ab1c766fb4862de118e494fddfb5b;p=thirdparty%2Fbind9.git Include controls.conf as jinja2 template Rather than using named.conf include, render the controls directly into the config using jinja2 template include. --- diff --git a/bin/tests/system/_common/controls.conf.in b/bin/tests/system/_common/controls.conf.in deleted file mode 100644 index 429a2d32bef..00000000000 --- a/bin/tests/system/_common/controls.conf.in +++ /dev/null @@ -1,9 +0,0 @@ -key rndc_key { - secret "1234abcd8765"; - algorithm @DEFAULT_HMAC@; -}; - -controls { - inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; -}; - diff --git a/bin/tests/system/_common/controls.conf.j2 b/bin/tests/system/_common/controls.conf.j2 new file mode 100644 index 00000000000..975299f63f0 --- /dev/null +++ b/bin/tests/system/_common/controls.conf.j2 @@ -0,0 +1,4 @@ +{% include "_common/rndc.key" %} +controls { + inet @ns.ip@ port @CONTROLPORT@ allow { any; } keys { rndc_key; }; +}; diff --git a/bin/tests/system/allow_query/.gitignore b/bin/tests/system/allow_query/.gitignore index f9285974439..f40b21b45f1 100644 --- a/bin/tests/system/allow_query/.gitignore +++ b/bin/tests/system/allow_query/.gitignore @@ -1,2 +1 @@ /ns2/named.conf -/ns2/controls.conf diff --git a/bin/tests/system/allow_query/ns2/controls.conf.j2 b/bin/tests/system/allow_query/ns2/controls.conf.j2 deleted file mode 120000 index f1371a044e1..00000000000 --- a/bin/tests/system/allow_query/ns2/controls.conf.j2 +++ /dev/null @@ -1 +0,0 @@ -../../_common/controls.conf.in \ No newline at end of file diff --git a/bin/tests/system/allow_query/ns2/named.conf.j2 b/bin/tests/system/allow_query/ns2/named.conf.j2 index 4f715dd7768..0777766fddd 100644 --- a/bin/tests/system/allow_query/ns2/named.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named02.conf.j2 b/bin/tests/system/allow_query/ns2/named02.conf.j2 index 374b9c786fe..524cb1c0821 100644 --- a/bin/tests/system/allow_query/ns2/named02.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named02.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named03.conf.j2 b/bin/tests/system/allow_query/ns2/named03.conf.j2 index 736c0a3c6cc..e3f1f8aceb2 100644 --- a/bin/tests/system/allow_query/ns2/named03.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named03.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named04.conf.j2 b/bin/tests/system/allow_query/ns2/named04.conf.j2 index c740e7dc15b..51ee80baaf5 100644 --- a/bin/tests/system/allow_query/ns2/named04.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named04.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named05.conf.j2 b/bin/tests/system/allow_query/ns2/named05.conf.j2 index ae71b8bdfc5..d7ea3c46d9d 100644 --- a/bin/tests/system/allow_query/ns2/named05.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named05.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named06.conf.j2 b/bin/tests/system/allow_query/ns2/named06.conf.j2 index 534e8700ec1..4a2b29d7a2d 100644 --- a/bin/tests/system/allow_query/ns2/named06.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named06.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named07.conf.j2 b/bin/tests/system/allow_query/ns2/named07.conf.j2 index 0a2015721bd..75002889f49 100644 --- a/bin/tests/system/allow_query/ns2/named07.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named07.conf.j2 @@ -10,7 +10,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named08.conf.j2 b/bin/tests/system/allow_query/ns2/named08.conf.j2 index ccf5ca88b08..7c3ffea4204 100644 --- a/bin/tests/system/allow_query/ns2/named08.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named08.conf.j2 @@ -10,7 +10,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named09.conf.j2 b/bin/tests/system/allow_query/ns2/named09.conf.j2 index 0abece84892..d0ba3cfdba5 100644 --- a/bin/tests/system/allow_query/ns2/named09.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named09.conf.j2 @@ -10,7 +10,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named10.conf.j2 b/bin/tests/system/allow_query/ns2/named10.conf.j2 index cb3922880dd..16f165eec0e 100644 --- a/bin/tests/system/allow_query/ns2/named10.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named10.conf.j2 @@ -13,7 +13,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named11.conf.j2 b/bin/tests/system/allow_query/ns2/named11.conf.j2 index 638deaa9c6c..ef2b4a6aeb0 100644 --- a/bin/tests/system/allow_query/ns2/named11.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named11.conf.j2 @@ -19,7 +19,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named12.conf.j2 b/bin/tests/system/allow_query/ns2/named12.conf.j2 index 64dfe10f667..23d8edd91ca 100644 --- a/bin/tests/system/allow_query/ns2/named12.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named12.conf.j2 @@ -13,7 +13,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named21.conf.j2 b/bin/tests/system/allow_query/ns2/named21.conf.j2 index cff938b0063..a87bae28180 100644 --- a/bin/tests/system/allow_query/ns2/named21.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named21.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named22.conf.j2 b/bin/tests/system/allow_query/ns2/named22.conf.j2 index 8c22336e6c0..12f5ce20c41 100644 --- a/bin/tests/system/allow_query/ns2/named22.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named22.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named23.conf.j2 b/bin/tests/system/allow_query/ns2/named23.conf.j2 index e5d4ce55d7a..ed767421e31 100644 --- a/bin/tests/system/allow_query/ns2/named23.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named23.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named24.conf.j2 b/bin/tests/system/allow_query/ns2/named24.conf.j2 index 56603ec7172..67a4e312e57 100644 --- a/bin/tests/system/allow_query/ns2/named24.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named24.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named25.conf.j2 b/bin/tests/system/allow_query/ns2/named25.conf.j2 index 7b5e332ab85..bf4ca2e0a0c 100644 --- a/bin/tests/system/allow_query/ns2/named25.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named25.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named26.conf.j2 b/bin/tests/system/allow_query/ns2/named26.conf.j2 index 0c9c2f8f082..5d60e312ca8 100644 --- a/bin/tests/system/allow_query/ns2/named26.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named26.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named27.conf.j2 b/bin/tests/system/allow_query/ns2/named27.conf.j2 index 18aad0d39d0..a25b35c8693 100644 --- a/bin/tests/system/allow_query/ns2/named27.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named27.conf.j2 @@ -9,7 +9,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named28.conf.j2 b/bin/tests/system/allow_query/ns2/named28.conf.j2 index 4b04b4274eb..b2749a63a84 100644 --- a/bin/tests/system/allow_query/ns2/named28.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named28.conf.j2 @@ -9,7 +9,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named29.conf.j2 b/bin/tests/system/allow_query/ns2/named29.conf.j2 index c4cdb3b0841..1b998d4b9e2 100644 --- a/bin/tests/system/allow_query/ns2/named29.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named29.conf.j2 @@ -9,7 +9,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named30.conf.j2 b/bin/tests/system/allow_query/ns2/named30.conf.j2 index 773c4face4a..13707abb22e 100644 --- a/bin/tests/system/allow_query/ns2/named30.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named30.conf.j2 @@ -12,7 +12,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named31.conf.j2 b/bin/tests/system/allow_query/ns2/named31.conf.j2 index bce1ad3cba1..f8052031dc1 100644 --- a/bin/tests/system/allow_query/ns2/named31.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named31.conf.j2 @@ -19,7 +19,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named32.conf.j2 b/bin/tests/system/allow_query/ns2/named32.conf.j2 index ad9d85ad0a1..a8e0b0c060f 100644 --- a/bin/tests/system/allow_query/ns2/named32.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named32.conf.j2 @@ -12,7 +12,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named33.conf.j2 b/bin/tests/system/allow_query/ns2/named33.conf.j2 index 052320f9119..84f3933156f 100644 --- a/bin/tests/system/allow_query/ns2/named33.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named33.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named34.conf.j2 b/bin/tests/system/allow_query/ns2/named34.conf.j2 index c745aa68d8c..703a575f349 100644 --- a/bin/tests/system/allow_query/ns2/named34.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named34.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named40.conf.j2 b/bin/tests/system/allow_query/ns2/named40.conf.j2 index 16b07370c69..f5ea7538792 100644 --- a/bin/tests/system/allow_query/ns2/named40.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named40.conf.j2 @@ -21,7 +21,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named53.conf.j2 b/bin/tests/system/allow_query/ns2/named53.conf.j2 index b8fb4fb68bc..5e94448ed92 100644 --- a/bin/tests/system/allow_query/ns2/named53.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named53.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named54.conf.j2 b/bin/tests/system/allow_query/ns2/named54.conf.j2 index c50b5535991..24c3182c66d 100644 --- a/bin/tests/system/allow_query/ns2/named54.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named54.conf.j2 @@ -8,7 +8,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} zone "." { type hint; diff --git a/bin/tests/system/allow_query/ns2/named55.conf.j2 b/bin/tests/system/allow_query/ns2/named55.conf.j2 index 4d1087082d7..e5c34d98220 100644 --- a/bin/tests/system/allow_query/ns2/named55.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named55.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named56.conf.j2 b/bin/tests/system/allow_query/ns2/named56.conf.j2 index a98fdd832fc..2e3fc9a14ef 100644 --- a/bin/tests/system/allow_query/ns2/named56.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named56.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { diff --git a/bin/tests/system/allow_query/ns2/named57.conf.j2 b/bin/tests/system/allow_query/ns2/named57.conf.j2 index 5ba60146712..15985d9baae 100644 --- a/bin/tests/system/allow_query/ns2/named57.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named57.conf.j2 @@ -7,7 +7,7 @@ options { dnssec-validation no; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} view "internal" { allow-query-on { any; }; diff --git a/bin/tests/system/allow_query/tests_sh_allow_query.py b/bin/tests/system/allow_query/tests_sh_allow_query.py index 0a17c7eea5f..bcc67ed23ab 100644 --- a/bin/tests/system/allow_query/tests_sh_allow_query.py +++ b/bin/tests/system/allow_query/tests_sh_allow_query.py @@ -14,7 +14,6 @@ import pytest pytestmark = pytest.mark.extra_artifacts( [ "dig.out.*", - "ns2/controls.conf", ] ) diff --git a/bin/tests/system/optout/ns2/controls.conf.j2 b/bin/tests/system/optout/ns2/controls.conf.j2 deleted file mode 120000 index f1371a044e1..00000000000 --- a/bin/tests/system/optout/ns2/controls.conf.j2 +++ /dev/null @@ -1 +0,0 @@ -../../_common/controls.conf.in \ No newline at end of file diff --git a/bin/tests/system/optout/ns2/named.conf.j2 b/bin/tests/system/optout/ns2/named.conf.j2 index e0ed51ea59b..7e20723dff3 100644 --- a/bin/tests/system/optout/ns2/named.conf.j2 +++ b/bin/tests/system/optout/ns2/named.conf.j2 @@ -14,7 +14,7 @@ options { sig-signing-signatures 900; }; -include "controls.conf"; +{% include "_common/controls.conf.j2" %} dnssec-policy "optout" { keys { diff --git a/bin/tests/system/optout/tests_optout.py b/bin/tests/system/optout/tests_optout.py index ef157b3e9e4..f7be26d6e90 100755 --- a/bin/tests/system/optout/tests_optout.py +++ b/bin/tests/system/optout/tests_optout.py @@ -34,7 +34,6 @@ pytestmark = [ "ns2/*.signed", "ns2/*.jnl", "ns2/*.jbk", - "ns2/controls.conf", "ns2/dsset-*", "ns2/K*", ]