]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
9 months agoconvert delv tests to python
Evan Hunt [Thu, 3 Jul 2025 22:32:37 +0000 (15:32 -0700)] 
convert delv tests to python

move all dnssec tests using delv from the shell test to tests_delv.py,
and remove tests.sh and tests_sh_dnssec.py.

9 months agoconvert dnssec signing tests to python
Evan Hunt [Wed, 2 Jul 2025 08:06:19 +0000 (01:06 -0700)] 
convert dnssec signing tests to python

the shell tests that queried servers to check correct signing
behavior (using dnssec-signzone, dnssec-policy and nsupdate),
as well as "rndc signing", private-type records, rndc zonestatus,
offline keys, etc, have been moved to tests_signing.py.

the minimal update test in the dnssec_update_test.pl script
was also moved here and the perl script has been removed.

9 months agoconvert dnssec validation tests to python
Evan Hunt [Fri, 27 Jun 2025 03:29:24 +0000 (20:29 -0700)] 
convert dnssec validation tests to python

begin converting DNSSEC validation tests from shell to python,
and simplify the name servers used in the test.

ns4, the name server used for validation tests, is now configured
using jinja2 templates.

ns8, which was previously used for testing unsupported, disabled
and revoked keys and trust anchors, has been removed.  we now
use a jinja2 configuration in ns5 for this purpose.

the configurations in ns7 and ns6 didn't conflict with one another,
so the two servers have been merged into one.

9 months agoconvert dnssec-policy tests to python
Evan Hunt [Sat, 28 Jun 2025 00:43:13 +0000 (17:43 -0700)] 
convert dnssec-policy tests to python

move the signatures-validity tests to tests_policy.py

9 months agoconvert TAT tests to python
Evan Hunt [Wed, 2 Jul 2025 04:37:58 +0000 (21:37 -0700)] 
convert TAT tests to python

the trust-anchor-telemetry tests have been moved to a new
python subtest, dnssec/tests_tat.py.

9 months agomove some test cases to different system tests
Evan Hunt [Fri, 27 Jun 2025 22:35:11 +0000 (15:35 -0700)] 
move some test cases to different system tests

- dnssec tool tests (i.e., dnssec-signzone, dnssec-keygen, etc) that
  don't require interaction with a running server have been moved
  to a new 'dnssectools' system test directory.
- a dig formatting test has been moved to digdelv.
- a named-rrchecker test has been moved to rrchecker

9 months agomove NTA test cases to a separate python test
Evan Hunt [Thu, 26 Jun 2025 20:05:40 +0000 (13:05 -0700)] 
move NTA test cases to a separate python test

the tests of "rndc nta" behavior have been moved out of the
dnssec shell test, into bin/tests/system/nta, and converted
to python. features of the dnssec test framework that were
needed for NTA testing have been moved to the nta test, and
dnssec has been correspondingly simplified.

9 months agostart converting dnssec system test to python/jinja2
Evan Hunt [Thu, 26 Jun 2025 02:00:22 +0000 (19:00 -0700)] 
start converting dnssec system test to python/jinja2

- changed named.conf.in to named.conf.j2 in all server directories that
  don't currently need to use copy_setports() during the test.
- converted the tests that use ns5 to python, and replaced
  named1.conf.in and named2.conf.in with a jinja2 template instead.
  the only remaining server that still needs copy_setports() is ns4.
- removed ns4/named5.conf.in, and moved its functions to ns5 (which
  is supposed to be for servers with broken trust-anchor configurations,
  so it should have been there in the first place). converted the tests
  that used that ns4 configuration to use ns5 with jinja instead.
- revised the remaining ns4 configurations (named[1-4].conf.in) to
  minimize the differences between them. this will make it easier to
  convert it into a jinja2 template later.

9 months agofix: dev: reintroduce cross version tests
Aydın Mercan [Thu, 31 Jul 2025 11:54:03 +0000 (14:54 +0300)] 
fix: dev: reintroduce cross version tests

Merge branch 'aydin/meson-cross-version-test' into 'main'

See merge request isc-projects/bind9!10792

9 months agoreintroduce cross version config tests
Aydın Mercan [Tue, 29 Jul 2025 12:48:46 +0000 (12:48 +0000)] 
reintroduce cross version config tests

The `cross-version-config-tests` CI job had to be removed due to radical
differences between meson and autoconf. With the release of 9.21.11
this job now can be reintroduced by comparing two meson built BIND
source trees.

9 months agofix: ci: Revert "Capture scripts for Coverity Scan analysis"
Michal Nowak [Thu, 31 Jul 2025 10:35:41 +0000 (12:35 +0200)] 
fix: ci: Revert "Capture scripts for Coverity Scan analysis"

This reverts commit b4a2674d98902983e8096c99b747343482d30673.

The --fs-capture-search option is no more. The ability to analyse Python
scripts in Coverity turned out to be questionable anyways.

Closes #5456

Merge branch '5456-coverity-scan-drop-fs-capture-search-option' into 'main'

See merge request isc-projects/bind9!10808

9 months agoRevert "Capture scripts for Coverity Scan analysis"
Michal Nowak [Thu, 31 Jul 2025 09:37:27 +0000 (11:37 +0200)] 
Revert "Capture scripts for Coverity Scan analysis"

This reverts commit b4a2674d98902983e8096c99b747343482d30673.

The --fs-capture-search option is no more. The ability to analyse Python
scripts in Coverity turned out to be questionable anyways.

9 months agochg: ci: Log packages, test AlmaLinux 9
Petr Špaček [Thu, 31 Jul 2025 08:39:27 +0000 (08:39 +0000)] 
chg: ci: Log packages, test AlmaLinux 9

Merge branch 'pspacek/ci-platforms-and-logging' into 'main'

See merge request isc-projects/bind9!10799

9 months agoLog all installed system packages and Python libraries before build
Petr Špaček [Wed, 30 Jul 2025 12:12:51 +0000 (14:12 +0200)] 
Log all installed system packages and Python libraries before build

9 months agoRun MR pipelines also on AlmaLinux 9
Petr Špaček [Wed, 30 Jul 2025 12:03:40 +0000 (14:03 +0200)] 
Run MR pipelines also on AlmaLinux 9

Turns out Python version there is older than elsewhere.

9 months agochg: dev: Check meson.build formatting in CI
Michał Kępień [Wed, 30 Jul 2025 15:41:13 +0000 (17:41 +0200)] 
chg: dev: Check meson.build formatting in CI

Add a new CI job that checks whether all meson.build files in the
repository are formatted in the exact same way as "muon fmt" would
format them.  This enforces formatting consistency across all
meson.build files in the repository and enables updating their contents
using dedicated tools, e.g. "meson rewrite".

See #5379

Merge branch '5379-check-meson.build-formatting-in-ci' into 'main'

See merge request isc-projects/bind9!10770

9 months agoCheck meson.build formatting in CI
Michał Kępień [Wed, 30 Jul 2025 15:37:38 +0000 (17:37 +0200)] 
Check meson.build formatting in CI

Add a new CI job that checks whether all meson.build files in the
repository are formatted in the exact same way as "muon fmt" would
format them.  This enforces formatting consistency across all
meson.build files in the repository and enables updating their contents
using dedicated tools, e.g. "meson rewrite".

9 months agoFix system test compatibility with old Python
Petr Špaček [Wed, 30 Jul 2025 14:35:45 +0000 (14:35 +0000)] 
Fix system test compatibility with old Python

Merge branch 'pspacek/test-compatibility' into 'main'

See merge request isc-projects/bind9!10797

9 months agoFix compatibility with Python < 3.10
Petr Špaček [Wed, 30 Jul 2025 08:10:59 +0000 (10:10 +0200)] 
Fix compatibility with Python < 3.10

Dataclass kw_only argument was added only in Python 3.10 but EL9 image
has only 3.9.21.

9 months agoFix minimal dnspython version test
Petr Špaček [Wed, 30 Jul 2025 07:49:27 +0000 (09:49 +0200)] 
Fix minimal dnspython version test

Wrong version number was uncovered by Ubuntu 22.04 Jammy which actually
has dnspython 2.1.0.

9 months agofix: test: fix macOS build for plugin unit test
Colin Vidal [Wed, 30 Jul 2025 10:11:46 +0000 (12:11 +0200)] 
fix: test: fix macOS build for plugin unit test

MR !10753 breaks macOS build for plugin unit test as its linker doesn't
supports `--wrap` option, which is used in in order to mock the function
`isc_file_exits()`.

To work around the problem, a mocked `isc_file_exits()` is implemented
inside the plugin test as a static function before inlining the file
using it, which effectively links to this version rather than the isclib
one.

Closes #5455

Merge branch '5455-fix-macos-build-plugintest' into 'main'

See merge request isc-projects/bind9!10796

9 months agofix ns_plugin_expandpath tests with no extension
Colin Vidal [Wed, 30 Jul 2025 08:35:26 +0000 (10:35 +0200)] 
fix ns_plugin_expandpath tests with no extension

Parts of ns_plugin_expandpath() test expected the plugin extension to be
appened automatically (the plugin name/path is provided without the
extension), this enable to test the logic which adds the correct
extension based on the platfrom.

But the expected expanded paths from the test were hard coded with the
`.so` extension, so the test can't pass on macOS platform. This fixes
the test by using the macro providing the current-platform extension.

9 months agofix macOS build for plugin unit test
Colin Vidal [Wed, 30 Jul 2025 07:54:05 +0000 (09:54 +0200)] 
fix macOS build for plugin unit test

MR !10753 breaks macOS build for plugin unit test as its linker doesn't
supports `--wrap` option, which is used in in order to mock the function
`isc_file_exits()`.

To work around the problem, a mocked `isc_file_exits()` is implemented
inside the plugin test as a static function before inlining the file
using it, which effectively links to this version rather than the isclib
one.

9 months agonew: test: add helper functions to isctest
Evan Hunt [Tue, 29 Jul 2025 22:56:53 +0000 (22:56 +0000)] 
new: test: add helper functions to isctest

added some helper functions in isctest to reduce code repetition
in dnssec-related tests:

- isctest.check.adflag() - checks that a response contains AD=1
- isctest.check.noadflag() - checks that a response contains AD=0

- isctest.check.rdflag() - checks that a response contains RD=1
- isctest.check.nordflag() - checks that a response contains RD=0

- isctest.check.raflag() - checks that a response contains RA=1
- isctest.check.noraflag() - checks that a response contains RA=0

- isctest.check.rr_count_eq() - checks the number of RRsset in a section

- isctest.check.same_data() - checks that two message have the
                              same rcode and data
- isctest.check.same_answer() - checks that two message have the same
                                rcode and answer

- isctest.query.create() - a wrapper for dns.message.make_query() that
                           creates a query message similar to dig +dnssec

Merge branch 'each-isctest-helpers' into 'main'

See merge request isc-projects/bind9!10760

9 months agoUse isctest.query.create across system tests
Nicki Křížek [Mon, 14 Jul 2025 12:58:51 +0000 (14:58 +0200)] 
Use isctest.query.create across system tests

Rather than using the dnspython's facilities and defaults to create the
queries, use the isctest.query.create function in all the cases that
don't require special handling to have consistent defaults.

9 months agoAdd RA flag checks to isctest.check
Nicki Křížek [Fri, 25 Jul 2025 09:19:46 +0000 (11:19 +0200)] 
Add RA flag checks to isctest.check

9 months agoRefactor and move query helper to isctest.query.create
Nicki Křížek [Fri, 25 Jul 2025 08:30:54 +0000 (10:30 +0200)] 
Refactor and move query helper to isctest.query.create

Make the query helper function more universal and reusable across our
system tests -- default to using EDNS and sending AD=1.

9 months agoUnify RR counting in isctest.check helper
Nicki Křížek [Fri, 25 Jul 2025 09:09:30 +0000 (11:09 +0200)] 
Unify RR counting in isctest.check helper

Use a common function to count the number of RRs in any section of the
DNS message. For the ADDITIONAL section, stick with the dnspython
convention of not including OPT and TSIG.

9 months agoRefactor isctest.check.section_equal comparison
Nicki Křížek [Thu, 10 Jul 2025 14:23:48 +0000 (16:23 +0200)] 
Refactor isctest.check.section_equal comparison

Use the same logic as dnspython uses in dns.message.Message.

9 months agoadd helper functions to isctest
Evan Hunt [Thu, 26 Jun 2025 22:19:45 +0000 (15:19 -0700)] 
add helper functions to isctest

added some helper functions in isctest to reduce code repetition
in dnssec-related tests:

- isctest.check.adflag() - checks that a response contains AD=1
- isctest.check.noadflag() - checks that a response contains AD=0

- isctest.check.rdflag() - checks that a response contains RD=1
- isctest.check.nordflag() - checks that a response contains RD=0

- isctest.check.answer_count_eq() - checks the answer count is correct
- isctest.check.additional_count_eq() - same for authority count
- isctest.check.authority_count_eq() - same for additional count

- isctest.check.same_data() - check that two message have the
                              same rcode and data
- isctest.check.same_answer() - check that two message have the same
                                rcode and answer

- isctest.dnssec.msg() - a wrapper for dns.message.make_query() that
                         creates a query message similar to dig +dnssec:
                         use_edns=True, want_dnssec=True,
                         and flags are set to (RD|AD) by default, but
                         options exist to disable AD or enable CD.
                         (to generate non-DNSSEC queries, use
                         message.make_query() directly.)

9 months agofix: test: Improve key collision detection in ksr system test alessio/aligned-atomics-baseline
Matthijs Mekking [Tue, 29 Jul 2025 12:46:20 +0000 (12:46 +0000)] 
fix: test: Improve key collision detection in ksr system test

MR !10238 added key collision detection in the ksr system test but it was flawed because for every "collide" in the output we also log
"Generating an new key" and for each "Generating" we add the counter by one, nullifying the subtract by one.

Fix by splitting the output on ':' rather than on the default whitespace. Also make the substring matching more strict.

Closes #5229 (again)

Merge branch '5229-ksr-key-collision' into 'main'

See merge request isc-projects/bind9!10775

9 months agoImprove key collision detection in ksr system test
Matthijs Mekking [Fri, 25 Jul 2025 09:05:41 +0000 (11:05 +0200)] 
Improve key collision detection in ksr system test

MR !10238 added key collision detection in the ksr system test but it
was flawed because for every "collide" in the output we also log
"Generating an new key" and for each "Generating" we add the counter
by one, nullifying the subtract by one.

Use regular expressions to search in the output and make the string
expression more strict.

9 months agonew: test: Robust tests for NSEC3 nonexistent QNAME proof
Petr Špaček [Tue, 29 Jul 2025 08:54:27 +0000 (08:54 +0000)] 
new: test: Robust tests for NSEC3 nonexistent QNAME proof

Related to #5292

Merge branch '5292-wrong' into 'main'

See merge request isc-projects/bind9!10416

9 months agoAdjust type hints for the "nsec3-answer" test
Michał Kępień [Fri, 25 Jul 2025 12:50:49 +0000 (14:50 +0200)] 
Adjust type hints for the "nsec3-answer" test

Add missing type hints in the tests_nsec3.py module.  Tweak the syntax
used for type hints for better consistency with other Python code in
bin/tests/system/.

9 months agoAdd more empty non-terminals to test zone
Petr Špaček [Fri, 11 Jul 2025 11:33:46 +0000 (13:33 +0200)] 
Add more empty non-terminals to test zone

I don't know exactly why, I just have a feeling there might be
interesting corner cases somewhere.

9 months agoRandomize NSEC3 salt
Petr Špaček [Fri, 11 Jul 2025 09:17:05 +0000 (11:17 +0200)] 
Randomize NSEC3 salt

This should prevent the case where are are unlucky enough that static
values hash 'just right' for the test to pass, but only accidentally.

9 months agoTest proof of nonexistance of DS in insecure referrals
Petr Špaček [Fri, 11 Jul 2025 08:22:33 +0000 (10:22 +0200)] 
Test proof of nonexistance of DS in insecure referrals

Currently this test is limited only to auth because currently BIND
resolver does not send DS proof of nonexistence for RD=0 queries.

9 months agoTest dangling DNAME answers come with NXDOMAIN proofs
Petr Špaček [Thu, 10 Jul 2025 13:14:06 +0000 (15:14 +0200)] 
Test dangling DNAME answers come with NXDOMAIN proofs

Simplistic test. Ignores the possibility of DNAME chain going through
multiple zones and/or wildcard expansions.

9 months agoTest dangling CNAMEs come with NXDOMAIN proofs
Petr Špaček [Thu, 10 Jul 2025 11:13:02 +0000 (13:13 +0200)] 
Test dangling CNAMEs come with NXDOMAIN proofs

Simplistic test. Ignores the possibility of CNAME chain going through
multiple zones and/or wildcard expansions.

9 months agoMove query outside of check_() functions
Petr Špaček [Thu, 10 Jul 2025 12:45:35 +0000 (14:45 +0200)] 
Move query outside of check_() functions

This allows better check() code reuse.

9 months agoSeparate test into a new directory
Petr Špaček [Mon, 30 Jun 2025 15:03:50 +0000 (17:03 +0200)] 
Separate test into a new directory

The test actually needs just two servers - auth and resolver. The rest
was not needed and made test setup only slower and harder to debug.

9 months agoTest simple NODATA answers with NSEC3
Petr Špaček [Mon, 9 Jun 2025 09:15:04 +0000 (11:15 +0200)] 
Test simple NODATA answers with NSEC3

9 months agoDetect extraneous NSEC3 RRs in responses
Petr Špaček [Mon, 9 Jun 2025 09:01:27 +0000 (11:01 +0200)] 
Detect extraneous NSEC3 RRs in responses

We expect minimal possible answers which prove what they have to
according to DNSSEC protocol.

9 months agoMove proof checking into a NSEC3Checker class
Petr Špaček [Mon, 9 Jun 2025 08:46:34 +0000 (10:46 +0200)] 
Move proof checking into a NSEC3Checker class

9 months agoAdd consistency checks to responses with NSEC3
Petr Špaček [Fri, 6 Jun 2025 15:10:42 +0000 (17:10 +0200)] 
Add consistency checks to responses with NSEC3

Basic sanity checks - limited to responses from a single zone:
- NSEC3 type cannot be present in type bitmap:
  By definition, the type bitmap describes state of the unhashed name
  but NSEC3 RR is present at a different owner name. RFC 7129 section 5
- NSEC3 owner names cannot be duplicated:
  Unless the response crosses zone boundary, parent zone has insecure
  delegation for child, but child is signed ... don't do that.
- All parameters are consistent across all RRs present in answer:
  RFC 5155 section 7.2, last paragraph - at least when we don't cross
  zone boundary.

9 months agoSplit NXDOMAIN/NOERROR/NODATA test cases
Petr Špaček [Thu, 5 Jun 2025 13:15:08 +0000 (15:15 +0200)] 
Split NXDOMAIN/NOERROR/NODATA test cases

Untangling individual cases allows for clearer documentation and makes
it easier to build similar but slightly different test cases.  Wildcard
NODATA answer was added.

9 months agoExtract closest encloser and source of synthesis logic into ZoneAnalyzer
Petr Špaček [Tue, 3 Jun 2025 15:20:54 +0000 (17:20 +0200)] 
Extract closest encloser and source of synthesis logic into ZoneAnalyzer

As a side-effect, we now have set of all existing names in a zone with a
test, too. These parts should be shared with new NSEC tests.

9 months agoUse isctest library to check hypothesis version
Petr Špaček [Mon, 2 Jun 2025 11:06:54 +0000 (13:06 +0200)] 
Use isctest library to check hypothesis version

Side-effect of importing from isctest.hypothesis first is a version
check and clean Pytest skip if version is too old.

9 months agoGenerate comprehensive tests for ZoneAnalyzer utility class
Petr Špaček [Fri, 23 May 2025 07:07:02 +0000 (09:07 +0200)] 
Generate comprehensive tests for ZoneAnalyzer utility class

Test all combinations of wildcard, ENT, DNAME, NS, and ordinary
TXT records.

Test zone and expected outputs are generated by another script which
encodes node content into node name. This encoding removes 'node
content' level of indirection and thus enables simpler implementation of
same logic which needs to be in ZoneAnalyzer itself.

For humans the generated zone file also lists expected 'categories' a
name belongs to as dot-separated list on right hand side of a generated
RR.

9 months agoTest ZoneAnalyzer utility class
Petr Špaček [Wed, 21 May 2025 15:58:17 +0000 (17:58 +0200)] 
Test ZoneAnalyzer utility class

I've considered writing hypothesis test for this but I would have to
reimplement the same thing, which would probably have the same logic
bugs, so I will leave it as an exercise for someone else.

9 months agoSeparate zone analyzer from NSEC3 test
Petr Špaček [Wed, 21 May 2025 14:40:01 +0000 (16:40 +0200)] 
Separate zone analyzer from NSEC3 test

Code to generate ENTs, detect wildcards, occlusion etc. is generic
enough to be in an utility module.

9 months agoShorten syntax to access Name object
Petr Špaček [Wed, 21 May 2025 13:19:25 +0000 (15:19 +0200)] 
Shorten syntax to access Name object

dns.name all over the place does not make it easier to read the code at
all, and I'm going to add lot more code here.

9 months agoMove multi-subdomain name generator into shared utilities
Petr Špaček [Wed, 21 May 2025 12:55:45 +0000 (14:55 +0200)] 
Move multi-subdomain name generator into shared utilities

9 months agoAdd property based test for nsec3hash utility
Evan Hunt [Wed, 30 Apr 2025 00:03:47 +0000 (17:03 -0700)] 
Add property based test for nsec3hash utility

Check the correctness of NSEC3 hash generation by generating random
combinations of name, salt, and iterations and comparing the outputs
of the nsec3hash tool against the dnspython nsec3_hash function
for the same inputs.

9 months agoTest also with subdomains of existing names
Petr Špaček [Wed, 7 May 2025 13:45:24 +0000 (15:45 +0200)] 
Test also with subdomains of existing names

Composite strategy makes sure we always test with a subdomain of an
existing name.

9 months agoDedup NSEC3 get_next_name function
Petr Špaček [Wed, 7 May 2025 14:58:08 +0000 (16:58 +0200)] 
Dedup NSEC3 get_next_name function

9 months agoAdd a property based test for NSEC3 proofs for non-existent QNAMEs
Matthijs Mekking [Tue, 29 Apr 2025 13:01:53 +0000 (15:01 +0200)] 
Add a property based test for NSEC3 proofs for non-existent QNAMEs

For any given NSEC3 signed zone, when doing queries for non-existent
names, the response must contain:
- NSEC3 RR that matches the closest encloser,
- NSEC3 RR that covers the next closer name,
- NSEC3 RR that covers the wildcard.

9 months agoCheck that correct NSEC3 proofs are returned
Mark Andrews [Tue, 22 Apr 2025 08:47:19 +0000 (18:47 +1000)] 
Check that correct NSEC3 proofs are returned

9 months agochg: usr: plugin extension in plugin path is now optional
Colin Vidal [Mon, 28 Jul 2025 21:43:11 +0000 (23:43 +0200)] 
chg: usr: plugin extension in plugin path is now optional

Plugin configuration no longer requires the library file extension, so it is now possible to invoke a plugin using the syntax `plugin query "library"` instead of `plugin query "libary.so"`.

Closes #5377

Merge branch '5377-implicit-plugin-ext' into 'main'

See merge request isc-projects/bind9!10753

9 months agoupdate ARM plugin documentation
Colin Vidal [Thu, 24 Jul 2025 08:51:32 +0000 (10:51 +0200)] 
update ARM plugin documentation

Update the ARM documentation of plugin usage as the extension in the
plugin library path is now optional.

9 months agoupdate test_hooks system tests
Colin Vidal [Tue, 22 Jul 2025 12:43:26 +0000 (14:43 +0200)] 
update test_hooks system tests

Add the case where the plugin name is provided without the extension in
the test_hooks system tests.

9 months agons_plugin_expandpath() auto-extension unit-tests
Colin Vidal [Mon, 21 Jul 2025 13:58:31 +0000 (15:58 +0200)] 
ns_plugin_expandpath() auto-extension unit-tests

Update existing ns_plugin_expandpath() unit test to cover the logic
appending the plugin extension if missing.

Because ns_plugin_expandpath() now relies on isc_file_exists() API, a
mocked version has been added in tests/ns/plugin_test.c and relies on the
linker --wrap mechanism.

9 months agoplugin expand path automatically adds extension
Colin Vidal [Mon, 21 Jul 2025 13:06:11 +0000 (15:06 +0200)] 
plugin expand path automatically adds extension

If a plugin is configured without the extension,
`ns_plugin_expandpath()` automatically take cares of appending the
suffix to the path. The way it works is by checking if a file exists at
the expanded path. If it doesn't, it assumes the plugin path (or name)
doesn't have the extension and append the extension (which is
platform-specific) to the actual path.

9 months agoExport plugin extension in config.h
Colin Vidal [Mon, 21 Jul 2025 12:38:30 +0000 (14:38 +0200)] 
Export plugin extension in config.h

Dynamically loadable libraries all use the `.so` extension on
BIND9-supported platforms, except for macOS. Export the dynamic library
extension of the current build platform in the generated `config.h`
file, in order to let the plugin code building plugin path based on a
simple plugin name. (which then would be platform-independent)

9 months agonew: ci: Add AlmaLinux 10 FIPS
Michal Nowak [Mon, 28 Jul 2025 17:29:55 +0000 (19:29 +0200)] 
new: ci: Add AlmaLinux 10 FIPS

Merge branch 'mnowak/add-almalinux-10-fips' into 'main'

See merge request isc-projects/bind9!10722

9 months agoAdd AlmaLinux 10 FIPS
Michal Nowak [Wed, 9 Jul 2025 15:39:51 +0000 (17:39 +0200)] 
Add AlmaLinux 10 FIPS

9 months agoDo not add AlmaLinux 8 FIPS unit and system test in MR pipelines
Michal Nowak [Wed, 9 Jul 2025 15:41:24 +0000 (17:41 +0200)] 
Do not add AlmaLinux 8 FIPS unit and system test in MR pipelines

9 months agofix: dev: Fix one-definition-rule violation in the loop unit test
Ondřej Surý [Thu, 24 Jul 2025 15:34:23 +0000 (17:34 +0200)] 
fix: dev: Fix one-definition-rule violation in the loop unit test

Rename isc__loopmgr when including the loop.c into loop_test.c to prevent odr-violation over isc__loopmgr.

Merge branch 'ondrej/prevent-odr-violation-in-loop-unit-test' into 'main'

See merge request isc-projects/bind9!10772

9 months agoFix one-definition-rule violation in the loop unit test
Ondřej Surý [Thu, 24 Jul 2025 09:43:14 +0000 (11:43 +0200)] 
Fix one-definition-rule violation in the loop unit test

Locally, clang reported following odr-violation:

    =================================================================
    ==1132009==ERROR: AddressSanitizer: odr-violation (0x555555589280):
      [1] size=8 'isc__loopmgr' ../lib/isc/loop.c:52:16 in /home/ondrej/Projects/bind9/build/tests/isc/loop
      [2] size=8 'isc__loopmgr' ../lib/isc/loop.c:52:16 in /home/ondrej/Projects/bind9/build/tests/isc/../../libisc.so
    These globals were registered at these points:
      [1]:
#0 0x7ffff785306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x55555556abce in _sub_I_00099_1 (/home/ondrej/Projects/bind9/build/tests/isc/loop+0x16bce) (BuildId: e7c586e966e6986532a3da40df41223ae16e55c9)
#2 0x7ffff702a303 in call_init ../csu/libc-start.c:145
#3 0x7ffff702a303 in __libc_start_main_impl ../csu/libc-start.c:347
#4 0x5555555622e4 in _start (/home/ondrej/Projects/bind9/build/tests/isc/loop+0xe2e4) (BuildId: e7c586e966e6986532a3da40df41223ae16e55c9)

      [2]:
#0 0x7ffff785306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x7ffff75335b9 in _sub_I_00099_1 (/home/ondrej/Projects/bind9/build/tests/isc/../../libisc.so+0x1335b9) (BuildId: 33ab72bc676e9ef9111b3db1fc4347595069cd29)
#2 0x7ffff7fca71e in call_init elf/dl-init.c:74
#3 0x7ffff7fca823 in call_init elf/dl-init.c:120
#4 0x7ffff7fca823 in _dl_init elf/dl-init.c:121
#5 0x7ffff7fe459f  (/lib64/ld-linux-x86-64.so.2+0x1f59f) (BuildId: 281ac1521b4102509b1c7ac7004db7c1efb81796)

    ==1132009==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
    SUMMARY: AddressSanitizer: odr-violation: global 'isc__loopmgr' at ../lib/isc/loop.c:52:16 in /home/ondrej/Projects/bind9/build/tests/isc/loop
    ==1132009==ABORTING
    Aborted (core dumped)

Rename isc__loopmgr when including the loop.c into loop_test.c to
prevent odr-violation over isc__loopmgr.

9 months agochg: test: Use isctest.asyncserver in the "dispatch" test
Štěpán Balážik [Thu, 24 Jul 2025 13:15:44 +0000 (13:15 +0000)] 
chg: test: Use isctest.asyncserver in the "dispatch" test

Replace the custom DNS server used in the "dispatch" system test with
new code based on the isctest.asyncserver module.

Merge branch 'stepan/dispatch-asyncserver' into 'main'

See merge request isc-projects/bind9!10689

9 months agoAccount for idle timeouts in the "dispatch" test
Michał Kępień [Wed, 23 Jul 2025 10:16:25 +0000 (12:16 +0200)] 
Account for idle timeouts in the "dispatch" test

When the tests-connreset.py module was initially implemented in commit
5c17919019ef0af8226e5bb61214b805bb3e2451, the dispatch code did not
properly apply the idle timeout to TCP connections.  This allowed the
check in that test module to reset the TCP connection after 5 seconds as
named did not attempt to tear the connection down earlier than that.
However, as the dispatch code was improved, the idle timeout started
being enforced for TCP dispatches; the exact value it is set to in the
current code depends on a given server's SRTT, but it defaults to about
1.2 seconds for responsive servers.  This means that the code paths
triggered by the "dispatch" system test are now different than the ones
it was originally supposed to trigger because it is now named itself
that shuts the TCP connection down cleanly before the ans3 server gets a
chance to reset it.

Account for the above by lowering the amount of time after which the
ans3 server in the "dispatch" system test resets TCP connections to just
1 second, so that the test actually does what its name implies.

9 months agoUse isctest.asyncserver in the "dispatch" test
Štěpán Balážik [Thu, 3 Jul 2025 12:27:33 +0000 (14:27 +0200)] 
Use isctest.asyncserver in the "dispatch" test

Replace the custom DNS server used in the "dispatch" system test with
new code based on the isctest.asyncserver module.

9 months agoEnable resetting TCP connections
Michał Kępień [Wed, 23 Jul 2025 10:16:25 +0000 (12:16 +0200)] 
Enable resetting TCP connections

Add a TCP connection handler, ConnectionReset, which enables closing TCP
connections without emptying the client socket buffer, causing the
kernel to send an RST segment to the client.  This relies on a horrible
asyncio hack that can break at any point in the future due to abusing
implementation details in the Python Standard Library.  Despite the eye
bleeding this code may cause, the approach it takes was still deemed
preferable to implementing an asyncio transport from scratch just to
enable triggering connection resets.

9 months agoAdd support for TCP connection handlers
Štěpán Balážik [Sat, 19 Jul 2025 14:44:51 +0000 (16:44 +0200)] 
Add support for TCP connection handlers

Add a new abstract class, ConnectionHandler, instances of which can be
installed on AsyncDnsServer to manipulate TCP connections upon
accepting.

9 months agoEnable requesting TCP connections to be closed
Michał Kępień [Tue, 15 Jul 2025 10:16:32 +0000 (12:16 +0200)] 
Enable requesting TCP connections to be closed

In response to client queries, AsyncDnsServer users can currently only
make the server either send a reply or silently ignore the query.  In
the case of TCP queries, neither of these actions causes the client's
connection to be closed - the onus of doing that is on the client.
However, in some cases the server may be required to close the
connection on its own, so AsyncDnsServer users need to have some way of
requesting such an action.

Add a new ResponseAction subclass, ResponseDropAndCloseConnection, which
enables AsyncDnsServer users to conveniently request TCP connections to
be closed.  Instead of returning the response to send,
ResponseDropAndCloseConnection raises a custom exception that
AsyncDnsServer._handle_tcp() handles accordingly.

9 months agofix: dev: Fix one-definition-rule violation in the tests/ns
Ondřej Surý [Thu, 24 Jul 2025 09:29:20 +0000 (11:29 +0200)] 
fix: dev: Fix one-definition-rule violation in the tests/ns

Move the client_addrs and client_refs to libtest to prevent this.

Merge branch 'ondrej/fix-odr-violation' into 'main'

See merge request isc-projects/bind9!10771

9 months agoFix one-definition-rule violation in the tests/ns
Ondřej Surý [Thu, 24 Jul 2025 06:41:38 +0000 (08:41 +0200)] 
Fix one-definition-rule violation in the tests/ns

Locally, clang reported odr-violation:

    =================================================================
    ==588371==ERROR: AddressSanitizer: odr-violation (0x55555556a060):
      [1] size=256 'client_addrs' ../tests/ns/netmgr_wrap.c:36:18 in /home/ondrej/Projects/bind9/build/tests/ns/query
      [2] size=256 'client_addrs' ../tests/ns/netmgr_wrap.c:36:18 in /home/ondrej/Projects/bind9/build/tests/ns/../libbindtest.so
    These globals were registered at these points:
      [1]:
#0 0x7ffff785306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x7ffff6a2a303 in call_init ../csu/libc-start.c:145
#2 0x7ffff6a2a303 in __libc_start_main_impl ../csu/libc-start.c:347
#3 0x55555555a084 in _start (/home/ondrej/Projects/bind9/build/tests/ns/query+0x6084) (BuildId: fbe4a3fcf1a249c7d7da69ee8b255a1dbb610c7a)

      [2]:
#0 0x7ffff785306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x7ffff7fca71e in call_init elf/dl-init.c:74
#2 0x7ffff7fca823 in call_init elf/dl-init.c:120
#3 0x7ffff7fca823 in _dl_init elf/dl-init.c:121
#4 0x7ffff7fe459f  (/lib64/ld-linux-x86-64.so.2+0x1f59f) (BuildId: 281ac1521b4102509b1c7ac7004db7c1efb81796)

    ==588371==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
    SUMMARY: AddressSanitizer: odr-violation: global 'client_addrs' at ../tests/ns/netmgr_wrap.c:36:18 in /home/ondrej/Projects/bind9/build/tests/ns/query
    ==588371==ABORTING

Move the client_addrs and client_refs to libtest to prevent this.

9 months agochg: dev: Refactor the network manager to be a singleton
Ondřej Surý [Wed, 23 Jul 2025 20:45:59 +0000 (22:45 +0200)] 
chg: dev: Refactor the network manager to be a singleton

Refactor the network manager to be a single object which is not exposed to the caller.

Merge branch 'ondrej/refactor-isc_netmgr-to-be-singleton' into 'main'

See merge request isc-projects/bind9!10735

9 months agoRefactor the network manager to be a singleton
Ondřej Surý [Mon, 14 Jul 2025 15:12:35 +0000 (17:12 +0200)] 
Refactor the network manager to be a singleton

There is only a single network manager running on top of the loop
manager (except for tests).  Refactor the network manager to be a
singleton (a single instance) and change the unit tests, so that the
shorter read timeouts apply only to a specific handle, not the whole
extra 'connect_nm' network manager instance.

9 months agochg: dev: Change the loopmgr to be singleton
Ondřej Surý [Wed, 23 Jul 2025 20:44:50 +0000 (22:44 +0200)] 
chg: dev: Change the loopmgr to be singleton

All the applications built on top of the loop manager were required to
create a single instance of the loop manager.  Refactor the loop
manager not to expose this instance to the callers, and keep the loop
manager object internal to the `isc_loop` compilation unit.

This significantly simplifies a number of data structures and calls to
the `isc_loop` API.

Merge branch 'ondrej/refactor-isc_loopmgr-to-be-singleton' into 'main'

See merge request isc-projects/bind9!10733

9 months agoChange the loopmgr to be singleton
Ondřej Surý [Mon, 14 Jul 2025 08:50:21 +0000 (10:50 +0200)] 
Change the loopmgr to be singleton

All the applications built on top of the loop manager were required to
create just a single instance of the loop manager.  Refactor the loop
manager to not expose this instance to the callers and keep the loop
manager object internal to the isc_loop compilation unit.

This significantly simplifies a number of data structures and calls to
the isc_loop API.

9 months agochg: usr: Reword the 'shut down hung fetch while resolving' message
Ondřej Surý [Wed, 23 Jul 2025 20:38:22 +0000 (22:38 +0200)] 
chg: usr: Reword the 'shut down hung fetch while resolving' message

The log message 'shut down hung fetch while resolving' may be confusing
because no detection of hung fetches actually takes place, but rather
the timer on the fetch context expires and the resolver gives up.

Change the log message to actually say that instead of the original
cryptic message about hung fetch.

Closes #3148

Merge branch '3148-rename-shut-down-hung-fetch' into 'main'

See merge request isc-projects/bind9!10759

9 months agoReword the 'shut down hung fetch while resolving' message
Ondřej Surý [Tue, 22 Jul 2025 18:39:00 +0000 (20:39 +0200)] 
Reword the 'shut down hung fetch while resolving' message

The log message 'shut down hung fetch while resolving' may be confusing
because no detection of hung fetches actually takes place, but rather
the timer on the fetch context expires and the resolver gives up.

Change the log message to actually say that instead of the original
cryptic message about hung fetch.

9 months agochg: test: Use isctest.asyncserver in the "zero" test
Štěpán Balážik [Wed, 23 Jul 2025 11:23:38 +0000 (11:23 +0000)] 
chg: test: Use isctest.asyncserver in the "zero" test

The original `ans.pl` server was a copy of the one in `fetchlimit`, so
there are some changes:

- The server now only responds with A replies (which is the only thing
  needed).
- The incrementing of the IP address goes beyond the least significant
  octet (so, after 192.0.2.255 it will yield 192.0.3.0).

Merge branch 'stepan/zero-asyncserver' into 'main'

See merge request isc-projects/bind9!10597

9 months agoUse isctest.asyncserver in the "zero" test
Štěpán Balážik [Wed, 18 Jun 2025 10:13:37 +0000 (12:13 +0200)] 
Use isctest.asyncserver in the "zero" test

The original `ans.pl` server was based on a copy of the one in
`fetchlimit`, so there are some changes:

- The server now only responds with A replies (which is the only thing
  needed).
- The incrementing of the IP address goes beyond the least significant
  octet (so, after 192.0.2.255 it will yield 192.0.3.0).

9 months agofix: usr: Stale RRsets in a CNAME chain were not always refreshed
Matthijs Mekking [Wed, 23 Jul 2025 07:19:20 +0000 (07:19 +0000)] 
fix: usr: Stale RRsets in a CNAME chain were not always refreshed

With serve-stale enabled, a CNAME chain that contains a stale RRset, the refresh query doesn't always properly refresh the stale RRsets. This has been fixed.

Closes #5243

Merge branch '5243-stale-refresh-as-prefetch' into 'main'

See merge request isc-projects/bind9!10720

9 months agoAdd reproducer as test case
Matthijs Mekking [Thu, 10 Jul 2025 12:47:06 +0000 (14:47 +0200)] 
Add reproducer as test case

The issue provided a reproducer that can be easily converted into a
test case.

9 months agoSpecial case refresh stale ncache data
Matthijs Mekking [Wed, 9 Jul 2025 12:21:44 +0000 (14:21 +0200)] 
Special case refresh stale ncache data

When refreshing stale ncache data, the qctx->rdataset is NULL and
requires special processing.

9 months agoMake serve-stale refresh behave as prefetch
Matthijs Mekking [Wed, 9 Jul 2025 10:40:34 +0000 (12:40 +0200)] 
Make serve-stale refresh behave as prefetch

A serve-stale refresh is similar to a prefetch, the only difference
is when it triggers. Where a prefetch is done when an RRset is about
to expire, a serve-stale refresh is done when the RRset is already
stale.

This means that the check for the stale-refresh window needs to
move into query_stale_refresh(). We need to clear the
DNS_DBFIND_STALEENABLED option at the same places as where we clear
DNS_DBFIND_STALETIMEOUT.

Now that serve-stale refresh acts the same as prefetch, there is no
worry that the same rdataset is added to the message twice. This makes
some code obsolete, specifically where we need to clear rdatasets from
the message.

9 months agofix: nil: Disable clang-format for Local IPv6 Unicast Addresses strings
Ondřej Surý [Wed, 23 Jul 2025 05:47:32 +0000 (07:47 +0200)] 
fix: nil: Disable clang-format for Local IPv6 Unicast Addresses strings

The LSP server (using clangd) was always complaining about:

    Suspicious string literal, probably missing a comma

for the two Local IPv6 Unicast Addresses strings that spanned
across multiple lines.  Disable clang-format for these two lines.

Merge branch 'ondrej/fix-suspicious-string-literal-probably-missing-comma' into 'main'

See merge request isc-projects/bind9!10764

9 months agoDisable clang-format for Local IPv6 Unicast Addresses strings
Ondřej Surý [Wed, 23 Jul 2025 05:40:41 +0000 (07:40 +0200)] 
Disable clang-format for Local IPv6 Unicast Addresses strings

The LSP server (using clangd) was always complaining about:

    Suspicious string literal, probably missing a comma

for the two Local IPv6 Unicast Addresses strings that spanned
across multiple lines.  Disable clang-format for these two lines.

9 months agofix: dev: Rename variable called 'free' to prevent the clash with free()
Ondřej Surý [Tue, 22 Jul 2025 12:22:38 +0000 (14:22 +0200)] 
fix: dev: Rename variable called 'free' to prevent the clash with free()

Merge branch 'ondrej/rename-variable-called-free' into 'main'

See merge request isc-projects/bind9!10756

9 months agoRename 'free' variable to 'nfree' to not clash with free()
Ondřej Surý [Tue, 22 Jul 2025 07:32:56 +0000 (09:32 +0200)] 
Rename 'free' variable to 'nfree' to not clash with free()

The beauty and horrors of the C - the compiler properly detects variable
shadowing, but you can freely shadow a standard function 'free()' with
variable called 'free'.  And if you reference 'free()' just as 'free'
you get the function pointer which means you can do also pointer
arithmetics, so 'free > 0' is always valid even when you delete the
local variable.

Replace the local variables 'free' with a name that doesn't shadow the
'free()' function to prevent future hard to detect bugs.

9 months agochg: test: Use isctest.asyncserver in the "fetchlimit" test
Štěpán Balážik [Tue, 22 Jul 2025 07:06:41 +0000 (07:06 +0000)] 
chg: test: Use isctest.asyncserver in the "fetchlimit" test

Replace the custom DNS server used in the "fetchlimit" system test
with new code based on the isctest.asyncserver module.

Merge branch 'stepan/fetchlimit-asyncserver' into 'main'

See merge request isc-projects/bind9!10614

9 months agoUse isctest.asyncserver in the "fetchlimit" test
Štěpán Balážik [Thu, 19 Jun 2025 07:15:03 +0000 (09:15 +0200)] 
Use isctest.asyncserver in the "fetchlimit" test

Replace the custom DNS server used in the "fetchlimit" system test
with new code based on the isctest.asyncserver module.

9 months agofix: usr: synth-from-dnssec was not working in some scenarios
Mark Andrews [Mon, 21 Jul 2025 15:42:54 +0000 (01:42 +1000)] 
fix: usr: synth-from-dnssec was not working in some scenarios

Aggressive use of DNSSEC-Validated cache with NSEC was not working in scenarios when no parent NSEC was not in cache.  This has been fixed.

Closes #5422

Merge branch '5422-aggressive-nsec-not-working' into 'main'

See merge request isc-projects/bind9!10736

9 months agotest synth-from-dnssec with no cached parent NSECs
Mark Andrews [Tue, 15 Jul 2025 05:17:46 +0000 (15:17 +1000)] 
test synth-from-dnssec with no cached parent NSECs

Add \007.no-apex-covering as an owner name so that the cache does
not get primed with a parent NSEC RRset to test the case where
dns_qp_lookup returns ISC_R_NOTFOUND.

9 months agoFix find_coveringnsec in qpcache.c
Mark Andrews [Tue, 15 Jul 2025 05:14:23 +0000 (15:14 +1000)] 
Fix find_coveringnsec in qpcache.c

dns_qp_lookup was returning ISC_R_NOTFOUND rather than DNS_R_PARTIALMATCH
when there wasn't a parent with a NSEC record in the cache.  This was
causing find_coveringnsec to fail rather than returing the covering NSEC.

9 months agofix: test: Add wait_for_keymgr_done() util function to tests
Nicki Křížek [Fri, 18 Jul 2025 13:30:32 +0000 (15:30 +0200)] 
fix: test: Add wait_for_keymgr_done() util function to tests

The kasp test cases assume that keymgr operations on the zone under test
have been completed before the test is executed. These are typically
quite fast, but the logs need to be explicitly checked for the messages,
otherwise there's a possibility of race conditions causing the
kasp/rollover tests to become unstable.

Call the wait function in all the kasp/rollover tests where it is
expected (which is generally in each test, unless we're dealing with
unsigned zones).

Closes #5371

Merge branch '5371-wait-keymgr-done-rollover-kasp-tests' into 'main'

See merge request isc-projects/bind9!10717

9 months agoAdd wait_for_keymgr_done() util function to tests
Nicki Křížek [Tue, 8 Jul 2025 11:46:01 +0000 (13:46 +0200)] 
Add wait_for_keymgr_done() util function to tests

The kasp test cases assume that keymgr operations on the zone under test
have been completed before the test is executed. These are typically
quite fast, but the logs need to be explicitly checked for the messages,
otherwise there's a possibility of race conditions causing the
kasp/rollover tests to become unstable.

Call the wait function in all the kasp/rollover tests where it is
expected (which is generally in each test, unless we're dealing with
unsigned zones).