From: Nicki Křížek Date: Thu, 23 Jul 2026 16:25:04 +0000 (+0000) Subject: Add shared templates for the named.conf options plumbing X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db95d9684dcd32a2920827fdb3ae5c2c8f77d698;p=thirdparty%2Fbind9.git Add shared templates for the named.conf options plumbing Almost every test instance's options block starts with the same seven statements varying only in the instance address: the source-address trio, port, pid-file, and the listen-on pair. Provide them as jinja2 partials in _common/options/ plus two umbrellas built on the auto-injected per-instance `ns` variable: options.conf.j2 for the v4-only case and options-dual.conf.j2 for dual-stack instances. The partials carry no indentation of their own: consumers pull them in with {% include_indented %} at the desired depth, so the templates do not hardcode the block structure they are used in. Semantic options (recursion, dnssec-validation, notify, allow-*) stay in the individual config files by design. Assisted-by: Claude:claude-fable-5 --- diff --git a/bin/tests/system/_common/options-dual.conf.j2 b/bin/tests/system/_common/options-dual.conf.j2 new file mode 100644 index 00000000000..cbe09ecd1f9 --- /dev/null +++ b/bin/tests/system/_common/options-dual.conf.j2 @@ -0,0 +1,3 @@ +{% include "_common/options/sources-dual.conf.j2" %} +{% include "_common/options/server.conf.j2" %} +{% include "_common/options/listen-dual.conf.j2" %} diff --git a/bin/tests/system/_common/options.conf.j2 b/bin/tests/system/_common/options.conf.j2 new file mode 100644 index 00000000000..219e6a2f46e --- /dev/null +++ b/bin/tests/system/_common/options.conf.j2 @@ -0,0 +1,3 @@ +{% include "_common/options/sources.conf.j2" %} +{% include "_common/options/server.conf.j2" %} +{% include "_common/options/listen.conf.j2" %} diff --git a/bin/tests/system/_common/options/listen-dual.conf.j2 b/bin/tests/system/_common/options/listen-dual.conf.j2 new file mode 100644 index 00000000000..078db399c3b --- /dev/null +++ b/bin/tests/system/_common/options/listen-dual.conf.j2 @@ -0,0 +1,2 @@ +listen-on { @ns.ip@; }; +listen-on-v6 { @ns.ip6@; }; diff --git a/bin/tests/system/_common/options/listen.conf.j2 b/bin/tests/system/_common/options/listen.conf.j2 new file mode 100644 index 00000000000..76fd5ef9fb0 --- /dev/null +++ b/bin/tests/system/_common/options/listen.conf.j2 @@ -0,0 +1,2 @@ +listen-on { @ns.ip@; }; +listen-on-v6 { none; }; diff --git a/bin/tests/system/_common/options/server.conf.j2 b/bin/tests/system/_common/options/server.conf.j2 new file mode 100644 index 00000000000..77865fcc789 --- /dev/null +++ b/bin/tests/system/_common/options/server.conf.j2 @@ -0,0 +1,2 @@ +port @PORT@; +pid-file "named.pid"; diff --git a/bin/tests/system/_common/options/sources-dual.conf.j2 b/bin/tests/system/_common/options/sources-dual.conf.j2 new file mode 100644 index 00000000000..7c88fe0c7db --- /dev/null +++ b/bin/tests/system/_common/options/sources-dual.conf.j2 @@ -0,0 +1,2 @@ +{% include "_common/options/sources.conf.j2" %} +{% include "_common/options/sources-v6.conf.j2" %} diff --git a/bin/tests/system/_common/options/sources-v6.conf.j2 b/bin/tests/system/_common/options/sources-v6.conf.j2 new file mode 100644 index 00000000000..6a004bdb393 --- /dev/null +++ b/bin/tests/system/_common/options/sources-v6.conf.j2 @@ -0,0 +1,3 @@ +query-source-v6 address @ns.ip6@; +notify-source-v6 @ns.ip6@; +transfer-source-v6 @ns.ip6@; diff --git a/bin/tests/system/_common/options/sources.conf.j2 b/bin/tests/system/_common/options/sources.conf.j2 new file mode 100644 index 00000000000..3b003b88e03 --- /dev/null +++ b/bin/tests/system/_common/options/sources.conf.j2 @@ -0,0 +1,3 @@ +query-source address @ns.ip@; +notify-source @ns.ip@; +transfer-source @ns.ip@;