Commit graph

45764 commits

Author SHA1 Message Date
Matthijs Mekking
d47aeb96d4 Test ACL from template
Add an acl system test case where the ACL comes from a template. It
should override the ACL from the options.
2026-05-29 06:04:30 +00:00
Michal Nowak
11e204ee00 fix: test: Fix pytest-xdist loadscope splitting on "::" in params
LoadScopeScheduling._split_scope() uses rsplit("::", 1) to
extract the test file scope from a node ID.  When parametrized
test values contain "::" (IPv6 addresses like "cafe:cafe::cafe"
or "::1"), the split lands inside the parameter instead of at
the .py:: boundary.  This creates spurious scopes that get
assigned to different workers, each triggering a full fixture
setup (starting named instances).

Override _split_scope() in conftest.py to split on ".py::"
which is unambiguous.

Six tests in synthrecord/tests_synthrecord.py are affected.
A verification script is included in util/.

Assisted-by: Claude:claude-opus-4-7

Merge branch 'mnowak/fix-xdist-loadscope-split' into 'main'

See merge request isc-projects/bind9!12103
2026-05-28 18:01:39 +02:00
Michal Nowak
4eb893020e Fix pytest-xdist loadscope splitting on "::" in params
LoadScopeScheduling._split_scope() uses rsplit("::", 1) to
extract the test file scope from a node ID.  When parametrized
test values contain "::" (IPv6 addresses like "cafe:cafe::cafe"
or "::1"), the split lands inside the parameter instead of at
the .py:: boundary.  This creates spurious scopes that get
assigned to different workers, each triggering a full fixture
setup (starting named instances).

Override _split_scope() in conftest.py to split on ".py::"
which is unambiguous.

Six tests in synthrecord/tests_synthrecord.py are affected.
A verification script is included in util/.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 18:00:17 +02:00
Michal Nowak
2f2d5462ef fix: ci: Make cross-version-config-tests allow_failure: true
The issue #6007 failed to mark cross-version-config-tests with
allow_failure: true. This should be reverted when the June release is
out.

Closes #6007

Merge branch '6007-allow-failure-cross-version-config-tests' into 'main'

See merge request isc-projects/bind9!12136
2026-05-28 17:59:30 +02:00
Michal Nowak
86b0615aea Make cross-version-config-tests allow_failure: true
The issue #6007 failed to mark cross-version-config-tests with
allow_failure: true. This should be reverted when the June release is
out.
2026-05-28 17:49:22 +02:00
Michal Nowak
63c2b4e4d4 chg: test: Prioritize the 10 slowest system test scopes
Update PRIORITY_TESTS with the 10 longest-running test
scopes measured from CI (job 7468217).  These get scheduled
first so that with --dist=loadscope they land on separate
workers instead of piling up at the end.

Also fix "serve-stale/" to "serve_stale/" to match the
actual directory name, and add a startup check that fails
if any PRIORITY_TESTS entry does not match an existing
directory.

Assisted-by: Claude:claude-opus-4-7

Merge branch 'mnowak/prioritize-slow-system-tests' into 'main'

See merge request isc-projects/bind9!12104
2026-05-28 16:54:58 +02:00
Michal Nowak
5e3c0b8463 Prioritize the 10 slowest system test scopes
Update PRIORITY_TESTS with the 10 longest-running test
scopes measured from CI (job 7468217).  These get scheduled
first so that with --dist=loadscope they land on separate
workers instead of piling up at the end.

Also fix "serve-stale/" to "serve_stale/" to match the
actual directory name, and add a startup check that fails
if any PRIORITY_TESTS entry does not match an existing
directory.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 16:52:53 +02:00
Matthijs Mekking
4f9422a27d fix: dev: Check options in templates that must be non-zero
`named-checkconf` should reject a template that has options that must be non-zero
(`max-refresh-time`, `max-retry-time`, `min-refresh-time`, `min-retry-time`).

`rndc addzone` with a zone that refers to such template should fail cleanly.

Closes #6041

Merge branch '6041-check-nonzero-skips-templates' into 'main'

See merge request isc-projects/bind9!12126
2026-05-28 14:26:03 +00:00
Matthijs Mekking
21791160b3 Check options in templates that must be non-zero
Without this, named-checkconf falsely accepts badly configured zones,
and rndc addzone would abort on adding a zone referring to such
templates.
2026-05-28 14:25:48 +00:00
Matthijs Mekking
c713e83948 Test checkconf and addzone with bad templates
named-checkconf should reject a template that has options that must be
non-zero (max-refresh-time, max-retry-time, min-refresh-time,
min-retry-time).

rndc addzone with a zone that refers to such template should fail
cleanly.
2026-05-28 14:25:48 +00:00
Michal Nowak
3a206cae5b fix: ci: Drop ccache support from CI
The population of the compile cache is so slow, that a BIND 9 build can
take 20 minutes.

Assisted-by: Claude:claude-opus-4-7

Merge branch 'mnowak/drop-ccache-support' into 'main'

See merge request isc-projects/bind9!12127
2026-05-28 14:21:39 +02:00
Michal Nowak
cbc8664567 Drop ccache support from CI
The population of the compile cache is so slow, that a BIND 9 build can
take 20 minutes.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 14:20:55 +02:00
Colin Vidal
71e8d16357 fix: usr: Restore delegdb size after rndc flush
When the delegation database was flushed using `rndc flush`, its size was also reset but not restored. As a result, after `rndc flush` was used at least once, the delegation database size could grow unbounded. This has now been fixed.

Merge branch 'colin/delegdb-config' into 'main'

See merge request isc-projects/bind9!12101
2026-05-28 13:59:46 +02:00
Colin Vidal
ad92081c5b Add system test for delegdb size preservation across rndc flush
Test that flushing the delegdb via `rndc flush` preserves its
configured size limit.  The test checks delegdb watermarks after
`named` startup, flushes caches, and verifies that the delegdb
watermarks are correctly restored afterwards.

To distinguish between the previous `delegdb` memory contexts and the
new ones, we need to know exactly when the previous `delegdb` memory
contexts are removed (this is not immediate, since those are removed
during RCU reclamation phase). A trace is therefore added when a memory
context is destroyed, if `ISC_MEM_DEBUGTRACE` is set.
2026-05-28 13:59:38 +02:00
Colin Vidal
2f9ba05178 Fix delegdb flush API
The `rndc flush` command flushes the delegdb by deleting the
existing database and creating a new one. In the process, the
delegdb was losing its configured size limit; as a result, once
flushed, the delegdb size became unbounded.

This is now fixed by using `dns_delegdb_getconfig()` to back up the
current configuration before instantiating a new delegdb, then
restoring it with `dns_delegdb_setconfig()`.
2026-05-28 13:59:38 +02:00
Colin Vidal
3610fd2df9 Add delegdb configuration struct
Instead of having independent APIs to configure various aspects of the
delegdb (i.e. cache size, other settings that may come up later), a
single configuration struct is passed to `dns_delegdb_setconfig()`, which
internally does all the plumbing. To avoid relying on
atomics/synchronization, `dns_delegdb_setconfig()` must be called from
exclusive mode (for now).

The configuration can be retrieved at any time (not necessarily from
exclusive mode) using `dns_delegdb_getconfig()`. This is useful, for
instance, to flush the delegdb without losing its parameters.
2026-05-28 13:59:38 +02:00
Ondřej Surý
ac342bf652 rem: usr: Remove legacy special handling for SIG, NXT, and KEY records
BIND no longer applies legacy RFC 2535 handling to the obsolete ``SIG``, ``NXT``
and ``KEY`` record types; they are now served as plain zone data. Zones with
both a ``CNAME`` and a ``KEY`` and or ``NXT`` at the same name — invalid under
:rfc:`2181` — will now fail to load and must be corrected.

Closes #6007

Merge branch '6007-remove-SIG-and-NXT-special-handling' into 'main'

See merge request isc-projects/bind9!12056
2026-05-28 13:21:07 +02:00
Ondřej Surý
b9c1b90b50 Drop RFC 2535 special-casing of the KEY record type
After SIG and NXT lost their special handling, KEY remained the only
RFC 2535-era type still receiving coexistence allowances: KEY
alongside CNAME at the same owner, KEY answered from the parent side
of a zone cut, KEY kept across CNAME eviction in the cache.  RFC 3755
retains type 25 only for SIG(0) and TKEY transaction signatures, and
neither relies on those allowances in practice.  The in-tree comment
that flagged the RFC 3007 parent-side carve-out as "unclear" predicted
this cleanup.

Zones that publish CNAME and KEY at the same owner — already invalid
under RFC 2181 — now fail to load.  System test fixtures are updated
accordingly, and a new test asserts that SIG, NXT, and KEY records
pick up covering RRSIGs when their zone is signed.
2026-05-28 13:21:00 +02:00
Ondřej Surý
2de202a6b7 Stop treating SIG and NXT records specially
RFC 3755 retired SIG and NXT in favour of RRSIG and NSEC.  BIND still
warned about them at zone load, refused them in dynamic updates,
parsed SIG with a non-zero "type covered" field as a signature on an
RRset, and tracked them via dns_rdatatype_issig().  Those carve-outs
were the sole path that made the GL#5818 crash class reachable.

Treat both types as ordinary unknown rdata: they load, transfer, sign
and answer like any other record, and dynamic updates carry them
through the generic path.  SIG(0) is unaffected; its message-parsing
carve-out is preserved.
2026-05-28 13:21:00 +02:00
Nicki Křížek
81b78d6c10 new: test: Add isctest.mark.with_developer pytest mark
Merge branch 'nicki/systest-with-developer' into 'main'

See merge request isc-projects/bind9!12118
2026-05-28 11:37:56 +02:00
Nicki Křížek
f957b63010 Add isctest.mark.with_developer pytest mark
Tests that exercise instrumentation, log output, or other behaviour
that only exists in developer builds (the gcc:almalinux9:amd64 CI job
sets -Ddeveloper=disabled to guard against such accidental coupling)
can now decorate themselves with isctest.mark.with_developer to skip on
non-developer builds.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 11:37:14 +02:00
Nicki Křížek
950dc9945c Add FEATURE_DEVELOPER variable to isctest
System tests can check FEATURE_DEVELOPER in the environment, but the
recommended pattern is the with_developer pytest marker added next.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 11:37:14 +02:00
Nicki Křížek
113980d4b0 Add --enable-developer probe to feature-test
System tests that depend on log output, instrumentation, or other
behaviour only present in developer builds can use this probe to detect
the build configuration at runtime.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 11:37:14 +02:00
Nicki Křížek
d9aeee7901 Define DEVELOPER_MODE in developer-mode builds
So that build-time consumers (e.g. feature-test) can detect developer
mode through a single dedicated symbol rather than proxying through
implementation-detail defines like ISC_MEM_TRACKLINES.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 11:37:14 +02:00
Ondřej Surý
be4f6ad202 fix: usr: Fix nxdomain-redirect combined with dns64
When a resolver was configured with both `nxdomain-redirect` and `dns64`
in the same view, an AAAA query for a nonexistent name could abort
`named`. The combination failed whenever the redirect zone held A
records but no AAAA records.  The server now serves the empty AAAA
response from the redirect zone as-is, instead of attempting DNS64
synthesis on top of it.

Closes #5789

Merge branch '5789-fix-nxdomain-redirect-dns64-assert' into 'main'

See merge request isc-projects/bind9!12059
2026-05-28 11:11:57 +02:00
Ondřej Surý
4bfd18d08d Skip DNS64 synthesis when answering a redirected response
redirect2() swaps qctx->db to the redirect zone before
query_nodata() runs. The DNS64 fallback there issues an A lookup
for the original query name, which is out of zone for the
redirect db, and the resulting query_notfound() trips
INSIST(!is_zone). The cached NCACHENXRRSET variant trips a
REQUIRE in dns_rdataset_first() on a disassociated rdataset.
The synth-from-dnssec entry reaches the same fallback via
query_coveringnsec(). Guarding the fallback with
!qctx->redirected leaves the nxdomain-redirect NXRRSET answer to
be served as-is.
2026-05-28 11:11:17 +02:00
Ondřej Surý
739a067de8 System test for nxdomain-redirect combined with dns64
An AAAA query for a non-existent name into a view that combines
nxdomain-redirect with dns64 used to abort named via the DNS64
fallback in query_nodata(). The new module exercises all three
documented entry paths into query_redirect(): the authoritative
NXDOMAIN path (ns7, tripping INSIST(!is_zone) in
query_notfound()), the recursive NCACHENXRRSET path (ns8,
tripping REQUIRE in dns_rdataset_first() on a disassociated
rdataset), and the synth-from-dnssec path (ns10 validating
against ns9's signed root, with a primer A query so the second
AAAA reaches query_redirect() via query_coveringnsec()). ns9
serves as a neutral upstream so the cached and synthesized
negatives land real NXRRSETs.

Assisted-by: Claude:claude-opus-4-7
2026-05-28 11:11:17 +02:00
Ondřej Surý
d61fef7c10 rem: dev: Remove useless PR-Agent jobs
Some checks failed
CodeQL / Analyze (push) Has been cancelled
SonarCloud / Build and analyze (push) Has been cancelled
The experiment was a failure, the PR-Agent doesn't send a full context
to the AI Agents and the results are abysmal because of that.

Merge branch 'ondrej/remove-useless-pr-agent' into 'main'

See merge request isc-projects/bind9!12119
2026-05-28 09:50:56 +02:00
Ondřej Surý
d3dbcd21df
Remove useless PR-Agent jobs
The experiment was a failure, the PR-Agent doesn't send a full context
to the AI Agents and the results are abysmal because of that.
2026-05-28 09:35:13 +02:00
Nicki Křížek
67bf433c0f chg: test: Improve pytest jinja2 templates
Some checks are pending
CodeQL / Analyze (push) Waiting to run
SonarCloud / Build and analyze (push) Waiting to run
- Enable rendering ns-specific data in jinja2 templates using the `ns` varible.
- Add common zone/config snippets an `_common` templates.
- Allow jinja2 imports from `_common`.
- Improve the `_common/controls.conf.j2` snippet to render ns-specific IP rather than hardocded one.

Merge branch 'nicki/pytest-template-improvements' into 'main'

See merge request isc-projects/bind9!11805
2026-05-27 17:54:34 +02:00
Nicki Křížek
c2c2be9be0 Restrict cross-test jinja2 includes to _common/
The previous loader was a FileSystemLoader rooted at $srcdir, which
allowed any system test to include any other test's templates -- a
wider scope than intended. Every existing cross-test include already
targets _common/, so make that the only path.

ChoiceLoader + PrefixLoader keeps the existing '_common/foo.j2' path
convention working without changes to call sites. The '_common/'
prefix is deliberately kept rather than dropping it by rooting the
FileSystemLoader at _common/ directly:

  - It signals at the include site that the file is a shared
    template, not a sibling of the current test; readers don't need
    to know the loader configuration to understand where the file
    lives.
  - It prevents shadowing: a test-local 'controls.conf.j2' would
    not collide with the shared one, and the unqualified name keeps
    its test-local meaning.
  - It makes the dependency greppable: 'grep -rl _common/'
    identifies every test that consumes shared snippets.

Assisted-by: Claude:claude-opus-4-7
2026-05-27 16:25:44 +02:00
Nicki Křížek
317cd12779 Create common templates for test zones
Add commonly used zone-related data (config snippet and zone file
snippets) as templates which can be reused by filling in different data.

Adjust the isctest.template.Zone to use filepath argument rather than
filename for clarity.
2026-05-27 16:25:44 +02:00
Nicki Křížek
f4ca352bc8 Include controls.conf as jinja2 template
Rather than using named.conf include, render the controls directly into
the config using jinja2 template include.
2026-05-27 16:25:43 +02:00
Nicki Křížek
e34c3252d9 Add _common dir to jinja2 template loader
This allows include of template snippets from _common/ directory.
2026-05-27 16:25:43 +02:00
Nicki Křížek
4f8e3774bb Reduce whitespace in jinja2 templates
Omit extra newlines when combining and including templates.

Adjust the xfer/ns8/small.db.j2 so it doesn't trim the endline twice
(as that would join the two subsequent records on the same line).
2026-05-27 14:19:31 +00:00
Nicki Křížek
dddb067351 Allow instantiating template dataclasses in jinja2 templates
In some cases, the template data might need to be set directly in the
jinja2 templates using `{% set %}`. Expose the template dataclasses to
the templates so we can use these existing classes, rather than creating
ad-hoc data containers.
2026-05-27 14:19:31 +00:00
Nicki Křížek
aa435b2e03 Add a directory-specific nameserver data to templates
If a template is being rendered into a directory that represents a
nameserver (e.g. "ns1"), include a nameserver-specific information in
the data - variable called "ns" which has information about the
nameserver this file belongs to.

Ensure the "ns" variable is only exposed to the template when rendered,
without affecting the environment variables (always work with a copy of
the env_vars).
2026-05-27 14:19:31 +00:00
Nicki Křížek
fa3a59e70c Improve isctest.template dataclasses' defaults
Extend the Nameserver to generate the default IPv4/IPv6 values, add NSX
values for the predefined nameservers (there are 11 of them, as per
bin/tests/system/ifconfig.sh.in max value). Add the missing ns11
fixture.

Extend the Zone to derive the zone filename by default, unless
specified.

Adjust the existing uses of these classes to utilize the simplified
defaults.
2026-05-27 14:19:31 +00:00
Matthijs Mekking
a97e5c3031 fix: usr: Fix crash on badly configured secondary signer
A badly configured secondary signer that was missing the 'file' entry caused the server to crash, rather than to reject the configuration. This has been fixed.

Closes #5993

Merge branch '5993-fix-bump-in-the-wire-crash' into 'main'

See merge request isc-projects/bind9!12045
2026-05-27 09:45:23 +00:00
Matthijs Mekking
77649ea8e2 Fix startup crash on bump in the wire signer
A secondary server that is configured as a bump in the wire signer
with inline-signing implicitly enabled via dnssec-policy requires
a 'file' entry.
2026-05-27 09:45:11 +00:00
Matthijs Mekking
43bbfbeb3c Check conf dnssec-policy inline-signing secondary
Add a variant of checking configuration where inline-signing is
enabled on the secondary, requiring the 'file' entry. This time,
inline-signing is implicitly enabled via dnssec-policy.
2026-05-27 09:45:11 +00:00
Michal Nowak
c62cff5aef fix: doc: Ignore gitlab.gnome.org links in Sphinx linkcheck
Merge branch 'mnowak/linkcheck-fix' into 'main'

See merge request isc-projects/bind9!12109
2026-05-27 11:20:49 +02:00
Michal Nowak
a126c6a489 Clean up OpenSSL/BoringSSL/LibreSSL reference URLs in changelog
Drop the #Lxxx-Lyyy fragments (replaced with prose line numbers) and
unwrap the line-broken URLs so Sphinx linkcheck can validate them.

Assisted-by: Claude:claude-opus-4-7
2026-05-27 10:56:08 +02:00
Michal Nowak
2850dc9d71 Ignore gitlab.gnome.org links in Sphinx linkcheck
GNOME GitLab returns HTTP 406 to Sphinx's linkcheck requests, the
same behavior already worked around for gitlab.isc.org.

Assisted-by: Claude:claude-opus-4-7
2026-05-27 10:56:08 +02:00
Andoni Duarte
e230886e61 chg: ci: Add rule for stable tags in CI and use it in the update-stable-tag job
Add a rule to match open source stable tags in CI and apply it to the
update-stable-tag job.

Merge branch 'andoni/show-update-stable-tag-job-in-stable-versions' into 'main'

See merge request isc-projects/bind9!11646
2026-05-27 08:24:38 +00:00
Andoni Duarte Pintado
38e80f542e Add rule for the stable tags in CI and use for job update-stable-tag
The update-stable-tag job should only be run for the stable tag, which
is used by Read the Docs to build the docs for the "stable" version.

A new rule called rule_tag_open_source_stable is introduced, in order to
prevent the job from appearing in the pipeline for non-stable versions.
Having this rule in YAML is necessary, because if it were in the script
itself, the job would show up in the pipeline.

Besides, the new rule allows other jobs to be run only for the stable
tag in the future, without modifying their internal logic.

The CI variable STABLE_VERSION contains a regular expression in
Gitlab CI sense[1]: it uses the RE2 syntax[2] and must be enclosed by
slashes (i.e. /.../). It must be updated every time the minor version
is changed: releasing v9.22 will require changing STABLE_VERSION from
"/v9.20/" to "/v9.22/".

The variable is imported from common Gitlab CI YAML in the project
isc-projects/bind9-qa, so as to maintain it in a central place.

[1]: https://docs.gitlab.com/ci/jobs/job_rules/#compare-a-variable-to-a-regular-expression
[2]: https://github.com/google/re2/wiki/Syntax
2026-05-27 08:23:12 +00:00
Andoni Duarte Pintado
1c31e6fea9 Include common Gitlab CI YAML from isc-projects/bind9-qa
The template file .gitlab-ci-common.yml is to be used across ISC
projects, while it is maintained in the isc-projects/bind9-qa project.
2026-05-27 08:23:12 +00:00
Štěpán Balážik
3e32c55213 chg: test: Move requirement checks to pytest_configure hook
Some checks are pending
CodeQL / Analyze (push) Waiting to run
SonarCloud / Build and analyze (push) Waiting to run
This leads to nicer logging if requirements aren't met.

Merge branch 'stepan/dont-run-system-tests-without-requirements' into 'main'

See merge request isc-projects/bind9!11551
2026-05-26 17:04:05 +00:00
Štěpán Balážik
b31f058ad0 Move pytest requirements check to pytest_configure hook
Logging from a pytest hook looks better.

Reorder the check for presence of `featuretest` before `init_vars` to
produce more sensible errors.
2026-05-26 15:24:07 +00:00
Michal Nowak
982c7441d0 chg: ci: Run unit tests with PKCS#11-aware OpenSSL
Some checks are pending
CodeQL / Analyze (push) Waiting to run
SonarCloud / Build and analyze (push) Waiting to run
Closes isc-projects/bind9#4958

Closes isc-projects/bind9#4957

Merge branch 'mnowak/pkcs11-aware-unit-gcc-ossl3-amd64' into 'main'

See merge request isc-projects/bind9!9543
2026-05-26 17:01:06 +02:00