]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
10 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)

10 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

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

10 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

10 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

10 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.

10 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

10 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.

10 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.

10 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.

10 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.

10 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.

10 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

10 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.

10 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

10 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.

10 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

10 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.

10 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

10 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.

10 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

10 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).

10 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

10 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.

10 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.

10 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.

10 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

10 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.

10 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

10 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.

10 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

10 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.

10 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

10 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.

10 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.

10 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

10 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).

10 months agoAdd nsX fixtures to system tests
Nicki Křížek [Tue, 8 Jul 2025 13:26:09 +0000 (15:26 +0200)] 
Add nsX fixtures to system tests

Many of our test cases only use a single NamedInstance from the
`servers` fixture. Introduce `nsX` helper fixtures to simplify these
tests and reduce boilterplate code further.

Specifically, the test no longer has to either define its own variable
to extract a single server from the list, or use the longer
servers["nsX"] syntax. While this may seem minor, the amount of times it
is repeated across the tests justifies the change. It also promotes
using more explicit server identification, i.e. `nsX`, rather than
generic `server`. This also improves the clarity of the tests and may be
helpful in traceback during debugging as well.

10 months agochg: test: Split up rollover test cases
Nicki Křížek [Fri, 18 Jul 2025 12:37:08 +0000 (14:37 +0200)] 
chg: test: Split up rollover test cases

Prior to this change, there was a single `rollover` test directory, containing 8 tests. These contained even more test scenarios, that were mostly unrelated to each other. This made debugging or even comprehending the tests difficult, as you'd often have to grasp the importance (or rather lack of it) of thousands of lines of setup, configuration and test code, and debug logs.

Now the tests were split up into 14 different test directories, containing 67 tests in total. This makes it much more comprehensible to understand what's going on in any single of these test cases, as there is no unrelated code. It also allows better parallelization and debugging of individual test cases, because of the improved granularity.

Merge branch 'nicki/split-rollover-test-cases' into 'main'

See merge request isc-projects/bind9!10581

10 months agoClean up rollover test case
Nicki Křížek [Wed, 11 Jun 2025 14:35:03 +0000 (16:35 +0200)] 
Clean up rollover test case

10 months agoIsolate rollover-multisigner test case
Nicki Křížek [Wed, 11 Jun 2025 14:33:53 +0000 (16:33 +0200)] 
Isolate rollover-multisigner test case

10 months agoIsolate rollover-enable-dnssec test case
Nicki Křížek [Wed, 11 Jun 2025 14:26:37 +0000 (16:26 +0200)] 
Isolate rollover-enable-dnssec test case

10 months agoIsolate rollover-zsk-prepub test case
Nicki Křížek [Wed, 11 Jun 2025 14:10:53 +0000 (16:10 +0200)] 
Isolate rollover-zsk-prepub test case

10 months agoIsolate rollover-ksk-3crowd test case
Nicki Křížek [Tue, 10 Jun 2025 14:33:08 +0000 (16:33 +0200)] 
Isolate rollover-ksk-3crowd test case

10 months agoUse common test functions for three-is-a-crowd test
Nicki Křížek [Tue, 10 Jun 2025 14:03:26 +0000 (16:03 +0200)] 
Use common test functions for three-is-a-crowd test

Previously, a lot of the checking was re-implemented and duplicated from
check_rollover_step(). Use that function where possible and only
override the needed checks.

10 months agoIsolate rollover-ksk-doubleksk test case
Nicki Křížek [Mon, 9 Jun 2025 16:39:44 +0000 (18:39 +0200)] 
Isolate rollover-ksk-doubleksk test case

10 months agoIsolate rollover-csk-roll1 test case
Nicki Křížek [Mon, 9 Jun 2025 15:42:08 +0000 (17:42 +0200)] 
Isolate rollover-csk-roll1 test case

10 months agoIsolate rollover-csk-roll2 test case
Nicki Křížek [Mon, 9 Jun 2025 14:33:13 +0000 (16:33 +0200)] 
Isolate rollover-csk-roll2 test case

10 months agoIsolate rollover-algo-csk test
Nicki Křížek [Fri, 6 Jun 2025 14:49:14 +0000 (16:49 +0200)] 
Isolate rollover-algo-csk test

10 months agoIsolate rollover-algo-ksk-zsk test
Nicki Křížek [Fri, 6 Jun 2025 14:09:55 +0000 (16:09 +0200)] 
Isolate rollover-algo-ksk-zsk test

10 months agoIsolate rollover-straight2none test
Nicki Křížek [Fri, 6 Jun 2025 11:25:46 +0000 (13:25 +0200)] 
Isolate rollover-straight2none test

10 months agoIsolate rollover-lifetime test
Nicki Křížek [Fri, 6 Jun 2025 09:03:43 +0000 (11:03 +0200)] 
Isolate rollover-lifetime test

10 months agoIsolate rollover-going-insecure test case
Nicki Křížek [Thu, 5 Jun 2025 15:51:40 +0000 (17:51 +0200)] 
Isolate rollover-going-insecure test case

10 months agoIsolate rollover-dynamic2inline test
Nicki Křížek [Fri, 6 Jun 2025 09:38:33 +0000 (11:38 +0200)] 
Isolate rollover-dynamic2inline test

10 months agoSeparate common templates and test code for rollover tests
Nicki Křížek [Thu, 5 Jun 2025 15:05:38 +0000 (17:05 +0200)] 
Separate common templates and test code for rollover tests

This is a preparation to split up and further isolate the various
rollover tests in a subsequent commits.

10 months agoMove shared test code into isctest.kasp module
Nicki Křížek [Mon, 2 Jun 2025 15:20:06 +0000 (17:20 +0200)] 
Move shared test code into isctest.kasp module

Move key calculations and rollover step checks into the shared
isctest.kasp module. Deduplicate the key interval calculations.

10 months agoUse a single named.conf template in rollover test
Nicki Křížek [Fri, 30 May 2025 15:21:36 +0000 (17:21 +0200)] 
Use a single named.conf template in rollover test

Rather than using multiple slightly modified named.conf files, use a
single template which can be rendered differently based on an input
argument -- in this case, csk_roll.

10 months agochg: test: Refactor configloading test
Nicki Křížek [Fri, 18 Jul 2025 11:27:41 +0000 (13:27 +0200)] 
chg: test: Refactor configloading test

- Use WatchLog.wait_for_sequence() for the configloading test.
- Omit artifacts check, as it seems quite useless for this test case.
- Join all the tests together. The test case is fairly simple here and
  this is the easiest way to ensure the log will be in a predictable
  state for all tests. Previously, there was no way to ensure
  test_configloading_loading() won't be executed after the other tests,
  which would render the check moot. It could also be separated into
  its own module, but that seems excessive for a simple test case like
  this.
- Use jinja2 template for named.conf and remove setup.sh.
- Remove README and put the relevent comment directly next to the test.
- Remove _sh_ from the test filename to uphold the naming convention.

Merge branch 'nicki/refactor-configloading-test' into 'main'

See merge request isc-projects/bind9!10748

10 months agoRefactor configloading test
Nicki Křížek [Thu, 26 Jun 2025 15:28:11 +0000 (17:28 +0200)] 
Refactor configloading test

- Use WatchLog.wait_for_sequence() for the configloading test.
- Omit artifacts check, as it seems quite useless for this test case.
- Join all the tests together. The test case is fairly simple here and
  this is the easiest way to ensure the log will be in a predictable
  state for all tests. Previously, there was no way to ensure
  test_configloading_loading() won't be executed after the other tests,
  which would render the check moot. It could also be separated into
  its own module, but that seems excessive for a simple test case like
  this.
- Use jinja2 template for named.conf and remove setup.sh.
- Remove README and put the relevent comment directly next to the test.
- Remove _sh_ from the test filename to uphold the naming convention.

10 months agochg: test: Improve WatchLog API for pytest
Nicki Křížek [Fri, 18 Jul 2025 10:13:12 +0000 (12:13 +0200)] 
chg: test: Improve WatchLog API for pytest

- Refactor and extend the `WatchLog.wait_for_line()` API:
    1. To allow for usage of one or more FlexPatterns, i.e. either plain
       strings to be matched verbatim, or regular expressions. Both can be
       used interchangeably to provide the caller to write simple and
       readable test code, while allowing for increased complexity to allow
       special cases.
    2. Always return the regex match, which allows the caller to identify
       which line was matched, as well as to extract any additional
       information, such as individual regex groups.
- Add `WatchLog.wait_for_sequence()` and `WatchLog.wait_for_all()` helper functions

Merge branch 'nicki/watchlog-improvements' into 'main'

See merge request isc-projects/bind9!10618

10 months agoTurn on doctest in CI
Nicki Křížek [Mon, 16 Jun 2025 13:51:51 +0000 (15:51 +0200)] 
Turn on doctest in CI

Run doctests for the isctest module in a dedicated CI job.

10 months agoChange NamedInstance.rndc() doctest into doc example
Nicki Křížek [Mon, 23 Jun 2025 15:36:08 +0000 (17:36 +0200)] 
Change NamedInstance.rndc() doctest into doc example

The test is troublesome, because NamedInstance(identifier) expects that
a directory with such a name exists. While it'd be possible to mock
those directories as well, it'd make the doctest overly long and
complex, which isn't justified, given that it's only testing a couple of
options. Turn it into regular documentation instead.

10 months agoSeparate LineReader functionality from WatchLog
Nicki Křížek [Fri, 4 Jul 2025 15:28:06 +0000 (17:28 +0200)] 
Separate LineReader functionality from WatchLog

The buffered reading of finished lines deserves its own class to make
its function clearer, rather than bundling it within the WatchLog class.

Co-Authored-By: Michał Kępień <michal@isc.org>
10 months agoRefactor WatchLog for better readability
Nicki Křížek [Fri, 4 Jul 2025 14:21:30 +0000 (16:21 +0200)] 
Refactor WatchLog for better readability

Various improvements for typing, naming, code deduplication and better
code organization to make the code easier to read.

10 months agoUse custom WatchLog timeout exception
Nicki Křížek [Mon, 23 Jun 2025 15:23:26 +0000 (17:23 +0200)] 
Use custom WatchLog timeout exception

The TimeoutError is raised when system functions time out. Define a
custom WatchLogTimeout to improve clarity.

10 months agoAdd wait_for_all() and wait_for_sequence() to WatchLog
Nicki Křížek [Mon, 23 Jun 2025 13:50:29 +0000 (15:50 +0200)] 
Add wait_for_all() and wait_for_sequence() to WatchLog

Extend the WatchLog API with a couple of new matching options.

wait_for_sequence() can be used to check a specific sequence of lines
appears in the log file in the given order.

wait_for_all() ensure that all the provided patterns appear in the log
at least once.

Co-authored-by: Colin Vidal <colin@isc.org>
10 months agoSplit up waiting for match to a separate WatchLog method
Nicki Křížek [Mon, 23 Jun 2025 12:37:09 +0000 (14:37 +0200)] 
Split up waiting for match to a separate WatchLog method

To allow re-use in upcoming functions, isolate the line matching logic
into a separate function. Use an instance-wide deadline attribute, which
is set by the calling function.

10 months agoAllow WatchLog.wait_for_line() to be called more than once
Nicki Křížek [Mon, 23 Jun 2025 12:24:34 +0000 (14:24 +0200)] 
Allow WatchLog.wait_for_line() to be called more than once

In some cases, it can be useful to be able to re-use the same WatchLog
to wait for another line.

10 months agoUnify the WatchLog.wait_for_line/s() API
Nicki Křížek [Mon, 16 Jun 2025 16:39:56 +0000 (18:39 +0200)] 
Unify the WatchLog.wait_for_line/s() API

Rather than using two distinct functions for matching either one pattern
(wait_for_line()), or any of multiple patterns (wait_for_lines()), use a
single function that handles both in the same way.

Extend the wait_for_line() API:
1. To allow for usage of one or more FlexPatterns, i.e. either plain
   strings to be matched verbatim, or regular expressions. Both can be
   used interchangeably to provide the caller to write simple and
   readable test code, while allowing for increased complexity to allow
   special cases.
2. Always return the regex match, which allows the caller to identify
   which line was matched, as well as to extract any additional
   information, such as individual regex groups.

10 months agoSet timeout for WatchLog per-instance rather than per-call
Nicki Křížek [Mon, 16 Jun 2025 15:12:47 +0000 (17:12 +0200)] 
Set timeout for WatchLog per-instance rather than per-call

To simplify usage of multiple wait_for_*() calls, configure the timeout
value for the WatchLog instance, rather than specifying it for each
call.

This is a preparation/cleanup for implementing multiple wait_for_*()
calls in subsequent commits.

10 months agoAbstract WatchLog line buffering to a separate function
Nicki Křížek [Mon, 16 Jun 2025 13:35:43 +0000 (15:35 +0200)] 
Abstract WatchLog line buffering to a separate function

Move the line buffering functionality into _readline() to improve the
readability of code. This also allows reading the file contents from
other functions, since the line buffer is now an attribute of the class.

10 months agofix watchlog.py doctest
Colin Vidal [Wed, 11 Jun 2025 13:45:52 +0000 (15:45 +0200)] 
fix watchlog.py doctest

Fix some broken doctest in watchlog.py (no semantic error, but API
slightly changed and broke some output messags). Also add a test for a
missing failure case.

10 months agochg: nil: Remove unused link field from rdatacommon
Alessio Podda [Thu, 17 Jul 2025 11:45:39 +0000 (11:45 +0000)] 
chg: nil: Remove unused link field from rdatacommon

The field link in rdatacommon is unused. This change should save 16 bytes for
each rdata we keep in a zone or cache.

Merge branch 'alessio/remove-unused-rdata-link' into 'main'

See merge request isc-projects/bind9!10731

10 months agoRemove unused link field from rdatacommon
Alessio Podda [Fri, 11 Jul 2025 07:15:23 +0000 (09:15 +0200)] 
Remove unused link field from rdatacommon

The field link in rdatacommon is unused. This change should save 16
bytes for each rdata we create.

10 months agorem: dev: Remove obsolete scripts across the repo
Štěpán Balážik [Thu, 17 Jul 2025 05:52:47 +0000 (05:52 +0000)] 
rem: dev: Remove obsolete scripts across the repo

All are unmaintained, dysfunctional, or both.

Merge branch 'stepan/remove-obsolete-scripts' into 'main'

See merge request isc-projects/bind9!10712

10 months agoFix broken markup in doc/arm/dlz.inc.rst
Michał Kępień [Wed, 16 Jul 2025 05:06:09 +0000 (07:06 +0200)] 
Fix broken markup in doc/arm/dlz.inc.rst

Commit a6cce753e2b1096c4db64555d2aee096ba8236ae erroneously used
Markdown syntax in doc/arm/dlz.inc.rst.  Replace it with proper
reStructuredText so that the relevant section of the ARM is rendered
correctly.

10 months agoUpdate broken reference to dlz_minimal.h
Michał Kępień [Wed, 16 Jul 2025 05:06:09 +0000 (07:06 +0200)] 
Update broken reference to dlz_minimal.h

Commit a6cce753e2b1096c4db64555d2aee096ba8236ae missed a spot in
lib/dns/include/dns/clientinfo.h.  Replace the outdated file reference
with the URL used in all similar cases.

10 months agoRemove contrib/scripts
Štěpán Balážik [Tue, 8 Jul 2025 13:34:42 +0000 (15:34 +0200)] 
Remove contrib/scripts

The scripts are ancient, trivial and/or unmaintained.
Since switching to Meson, we don't even build `*.in` ones.

10 months agoRemove leftover references to contrib/dlz/
Štěpán Balážik [Tue, 8 Jul 2025 13:31:54 +0000 (15:31 +0200)] 
Remove leftover references to contrib/dlz/

The DLZ modules have been moved to a separate Git repository in commit
a6cce753e2b1096c4db64555d2aee096ba8236ae.  Remove leftover references to
the contrib/dlz/ directory from the main BIND 9 repository.

10 months agoRemove util/git-replay-merge.sh
Štěpán Balážik [Tue, 8 Jul 2025 13:14:11 +0000 (15:14 +0200)] 
Remove util/git-replay-merge.sh

This is superceded by the auto-backport scripts in bind9-qa repo.

10 months agoRemove obsolete include checks
Štěpán Balážik [Tue, 8 Jul 2025 13:11:19 +0000 (15:11 +0200)] 
Remove obsolete include checks

These will not pass on today's code anyway.

10 months agoRemove util/nanny.pl and contrib/scripts/nanny.pl
Štěpán Balážik [Tue, 8 Jul 2025 13:10:34 +0000 (15:10 +0200)] 
Remove util/nanny.pl and contrib/scripts/nanny.pl

I doubt that anyone is using it after 25 years.

10 months agofix: test: Fix ifconfig.sh script
Mark Andrews [Wed, 16 Jul 2025 22:12:59 +0000 (08:12 +1000)] 
fix: test: Fix ifconfig.sh script

Add missing test for the variable 'a' being empty on linux.

Closes #5423

Merge branch '5423-fix-ifconfig-sh-script' into 'main'

See merge request isc-projects/bind9!10740

10 months agoFix ifconfig.sh script
Mark Andrews [Wed, 16 Jul 2025 02:27:24 +0000 (12:27 +1000)] 
Fix ifconfig.sh script

Add missing test for the variable 'a' being empty on linux.

10 months agoMerge tag 'v9.21.10'
Andoni Duarte Pintado [Wed, 16 Jul 2025 15:16:27 +0000 (17:16 +0200)] 
Merge tag 'v9.21.10'

10 months agofix: pkg: Fix plugin loading
Michał Kępień [Wed, 16 Jul 2025 05:24:00 +0000 (07:24 +0200)] 
fix: pkg: Fix plugin loading

Loading plugins specified using just the shared library name (i.e.
without using an absolute path or a relative path) did not work. This
has been fixed.

See #5379

Merge branch '5379-fix-plugin-loading' into 'main'

See merge request isc-projects/bind9!10734

10 months agoFix plugin loading
Michał Kępień [Wed, 16 Jul 2025 05:22:53 +0000 (07:22 +0200)] 
Fix plugin loading

Plugins are built as shared libraries and are therefore installed into
$libdir/bind.  Meanwhile, the build system sets the NAMED_PLUGINDIR
preprocessor variable to $datadir/bind instead.  This prevents loading
plugins specified in the configuration file using just the shared
library name (i.e. without using an absolute path or a relative path).
Fix by setting NAMED_PLUGINDIR to the path that plugins are actually
installed into.

10 months agochg: usr: Add deprecation warnings for RSASHA1, RSASHA1-NSEC3SHA1 and DS digest type 1
Mark Andrews [Tue, 15 Jul 2025 14:38:53 +0000 (00:38 +1000)] 
chg: usr: Add deprecation warnings for RSASHA1, RSASHA1-NSEC3SHA1 and DS digest type 1

RSASHA1 and RSASHA1-NSEC-SHA1 DNSKEY algorithms have been deprecated
by the IETF and should no longer be used for DNSSEC. DS digest type
1 (SHA1) has also been deprecated. Validators are now expected
to treat these algorithms and digest as unknown, resulting in
some zones being treated as insecure when they were previously treated
as secure. Warnings have been added to named and tools when these
algorithms and this digest are being used for signing.

Zones signed with RSASHA1 or RSASHA1-NSEC-SHA1 should be migrated
to a different DNSKEY algorithm.

Zones with DS or CDS records with digest type 1 (SHA1) should be
updated to use a different digest type (e.g. SHA256) and the digest
type 1 records should be removed.

Related to #5358

Merge branch '5358-add-sha1-deprecation-warnings' into 'main'

See merge request isc-projects/bind9!10559

10 months agoRemove leftover test development echo
Mark Andrews [Wed, 2 Jul 2025 13:27:39 +0000 (23:27 +1000)] 
Remove leftover test development echo

10 months agoRedirect named-checkzone output to file
Mark Andrews [Wed, 2 Jul 2025 02:49:16 +0000 (12:49 +1000)] 
Redirect named-checkzone output to file

10 months agoDigest type GOST is also deprecated
Mark Andrews [Wed, 2 Jul 2025 13:23:01 +0000 (23:23 +1000)] 
Digest type GOST is also deprecated

10 months agoCheck deprecated algorithms in dnssec-policy
Mark Andrews [Mon, 30 Jun 2025 05:56:21 +0000 (15:56 +1000)] 
Check deprecated algorithms in dnssec-policy

10 months agoCheck that named-checkzone reports deprecated digests
Mark Andrews [Mon, 30 Jun 2025 05:26:10 +0000 (15:26 +1000)] 
Check that named-checkzone reports deprecated digests

10 months agoCheck that named-checkzone reports deprecated algorithms
Mark Andrews [Mon, 30 Jun 2025 05:09:32 +0000 (15:09 +1000)] 
Check that named-checkzone reports deprecated algorithms

10 months agoUpdate man pages for deprecated algorithms
Mark Andrews [Thu, 5 Jun 2025 05:33:35 +0000 (15:33 +1000)] 
Update man pages for deprecated algorithms

10 months agoWarn about deprecated DNSKEY and DS algorithms / digest types
Mark Andrews [Thu, 5 Jun 2025 04:49:10 +0000 (14:49 +1000)] 
Warn about deprecated DNSKEY and DS algorithms / digest types

DNSKEY algorithms RSASHA1 and RSASHA-NSEC3-SHA1 and DS digest type
SHA1 are deprecated.  Log when these are present in primary zone
files and when generating new DNSKEYs, DS and CDS records.

10 months agochg: test: Use isctest.asyncserver in the "tsig" test
Štěpán Balážik [Sun, 13 Jul 2025 09:31:43 +0000 (09:31 +0000)] 
chg: test: Use isctest.asyncserver in the "tsig" test

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

Changes to isctest.asyncserver are required, previously it did not
handle TSIG signed queries at all. Now, with some hacking around
a [dnspython bug](https://github.com/rthalley/dnspython/issues/1205) it does.

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

See merge request isc-projects/bind9!10566

10 months agoUse isctest.asyncserver in the "tsig" test
Štěpán Balážik [Tue, 10 Jun 2025 22:33:39 +0000 (00:33 +0200)] 
Use isctest.asyncserver in the "tsig" test

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

10 months agoLet queries with TSIG parse in isctest.asyncserver.AsyncDnsServer
Štěpán Balážik [Mon, 23 Jun 2025 14:43:56 +0000 (16:43 +0200)] 
Let queries with TSIG parse in isctest.asyncserver.AsyncDnsServer

Previously, upon receiving a query with TSIG, the server would log
an error and timeout. As there is no way to set up the keyring in the
class anyway (and I believe we don't need it), this commit lets such
queries parse but logs the fact that the query has TSIG.

However, there is a bug [1] in dnspython, which causes `make_response`
and `to_wire` to crash on messages constructed by `from_wire` with
`keyring=False`, so the hack with `message.__class__` is needed to work
around this.

This makes just enough changes for the tsig system test to work with
dnspython >= 2.0.0. On older version the server gives up.

[1] https://github.com/rthalley/dnspython/issues/1205

10 months agochg: test: Check for FEATURETEST before running pytest alessio/experimental-swar-qpkey-cmp-baseline
Nicki Křížek [Thu, 10 Jul 2025 15:13:28 +0000 (17:13 +0200)] 
chg: test: Check for FEATURETEST before running pytest

When compiling with meson, it may be easy to forget to compile system
test dependencies before running the tests. In that case, the test
results would be quite incosistent and unpredictable, with some tests
ending up with ERROR, some with FAILURE and others PASS, without a clear
indication that something is off before running the entire machinery.

Add a check to fail early on if the FEATURETEST binary isn't available,
indicating that system test dependencies were most likely not compiled.

Merge branch 'nicki/system-test-check-featuretest' into 'main'

See merge request isc-projects/bind9!10715