From: Nicki Křížek Date: Wed, 1 Apr 2026 16:25:28 +0000 (+0200) Subject: Include controls.conf as jinja2 template X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=cefbed18714f518fc715bcc9f5cfd0e2dbd8c4d6;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. (cherry picked from commit f4ca352bc88ab1c766fb4862de118e494fddfb5b) --- 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 fec3ddd66f4..74ce1291dd6 100644 --- a/bin/tests/system/allow_query/ns2/named.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named.conf.j2 @@ -20,7 +20,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 95a78b2ff05..4d999000d43 100644 --- a/bin/tests/system/allow_query/ns2/named02.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named02.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/named03.conf.j2 b/bin/tests/system/allow_query/ns2/named03.conf.j2 index fd6add2b19f..d1265a2e933 100644 --- a/bin/tests/system/allow_query/ns2/named03.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named03.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/named04.conf.j2 b/bin/tests/system/allow_query/ns2/named04.conf.j2 index f6d231dc6af..c6e9c4c7e84 100644 --- a/bin/tests/system/allow_query/ns2/named04.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named04.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/named05.conf.j2 b/bin/tests/system/allow_query/ns2/named05.conf.j2 index fe6cc0c6c0d..535ff1a5d24 100644 --- a/bin/tests/system/allow_query/ns2/named05.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named05.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/named06.conf.j2 b/bin/tests/system/allow_query/ns2/named06.conf.j2 index 1f78f131ce3..958eaac888c 100644 --- a/bin/tests/system/allow_query/ns2/named06.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named06.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/named07.conf.j2 b/bin/tests/system/allow_query/ns2/named07.conf.j2 index 15dca8f1014..9e9d871267e 100644 --- a/bin/tests/system/allow_query/ns2/named07.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named07.conf.j2 @@ -23,7 +23,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 c2eed2dbf2f..ab59d75bec7 100644 --- a/bin/tests/system/allow_query/ns2/named08.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named08.conf.j2 @@ -23,7 +23,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 248da9e7bb3..88277e89095 100644 --- a/bin/tests/system/allow_query/ns2/named09.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named09.conf.j2 @@ -23,7 +23,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 1dbafbd7735..0425b951cac 100644 --- a/bin/tests/system/allow_query/ns2/named10.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named10.conf.j2 @@ -26,7 +26,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 4d961a57768..62ba892898d 100644 --- a/bin/tests/system/allow_query/ns2/named11.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named11.conf.j2 @@ -32,7 +32,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 75ab352676e..867d983655e 100644 --- a/bin/tests/system/allow_query/ns2/named12.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named12.conf.j2 @@ -26,7 +26,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 b120f2aaa5f..173eff84bd7 100644 --- a/bin/tests/system/allow_query/ns2/named21.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named21.conf.j2 @@ -20,7 +20,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 37ccedcc8d8..b589c0a538e 100644 --- a/bin/tests/system/allow_query/ns2/named22.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named22.conf.j2 @@ -20,7 +20,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 c43e232f16c..cca3f2b055b 100644 --- a/bin/tests/system/allow_query/ns2/named23.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named23.conf.j2 @@ -20,7 +20,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 6cdbeec18b8..3441ca5ad9a 100644 --- a/bin/tests/system/allow_query/ns2/named24.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named24.conf.j2 @@ -20,7 +20,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 51e247ca924..ecdc77cc303 100644 --- a/bin/tests/system/allow_query/ns2/named25.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named25.conf.j2 @@ -20,7 +20,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 a72136c8794..5f20c6d62ab 100644 --- a/bin/tests/system/allow_query/ns2/named26.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named26.conf.j2 @@ -20,7 +20,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 4c3f958d0b5..d1a414385e9 100644 --- a/bin/tests/system/allow_query/ns2/named27.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named27.conf.j2 @@ -22,7 +22,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 8db4555f8d9..618643faadb 100644 --- a/bin/tests/system/allow_query/ns2/named28.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named28.conf.j2 @@ -22,7 +22,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 2031a6ea515..67d2745f82c 100644 --- a/bin/tests/system/allow_query/ns2/named29.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named29.conf.j2 @@ -22,7 +22,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 0a90219efa7..3e64bd36e8a 100644 --- a/bin/tests/system/allow_query/ns2/named30.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named30.conf.j2 @@ -25,7 +25,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 faec50e6a2a..6636da1ddf1 100644 --- a/bin/tests/system/allow_query/ns2/named31.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named31.conf.j2 @@ -32,7 +32,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 dcd663ba0a0..94ff36dac56 100644 --- a/bin/tests/system/allow_query/ns2/named32.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named32.conf.j2 @@ -25,7 +25,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 3721e62f386..e2b49900b72 100644 --- a/bin/tests/system/allow_query/ns2/named33.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named33.conf.j2 @@ -21,7 +21,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 09125ef0218..96d1f99207e 100644 --- a/bin/tests/system/allow_query/ns2/named34.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named34.conf.j2 @@ -21,7 +21,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 2349d923579..388de212ff7 100644 --- a/bin/tests/system/allow_query/ns2/named40.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named40.conf.j2 @@ -34,7 +34,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 d3463b27967..4a5f19fde14 100644 --- a/bin/tests/system/allow_query/ns2/named53.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named53.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/named54.conf.j2 b/bin/tests/system/allow_query/ns2/named54.conf.j2 index 5dddf8998eb..57fc8f9f16e 100644 --- a/bin/tests/system/allow_query/ns2/named54.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named54.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/named55.conf.j2 b/bin/tests/system/allow_query/ns2/named55.conf.j2 index 4a0880fed3e..8793c1e39ac 100644 --- a/bin/tests/system/allow_query/ns2/named55.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named55.conf.j2 @@ -20,7 +20,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 564063b17ec..4f8c1d7fd5f 100644 --- a/bin/tests/system/allow_query/ns2/named56.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named56.conf.j2 @@ -20,7 +20,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 db5f3d08006..6bb685b9a8e 100644 --- a/bin/tests/system/allow_query/ns2/named57.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named57.conf.j2 @@ -20,7 +20,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 6bfe881451e..ee069605f2e 100644 --- a/bin/tests/system/optout/ns2/named.conf.j2 +++ b/bin/tests/system/optout/ns2/named.conf.j2 @@ -27,7 +27,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*", ]