Commit graph

43640 commits

Author SHA1 Message Date
Alessio Podda
1124a10f97 Clean up ixfr transaction API
Make the API tighter. The idea of this commit is to highlight the
distinction between a database transaction and a journal transaction,
and ensure we run dns_zone_verifydb on error.

Done to simplify a later refactor.

(cherry picked from commit 399f0c191a)
2026-01-29 09:13:02 +01:00
Mark Andrews
11db6feb45 [9.20] fix: test: ISC_RUN_TEST_IMPL should use a static declaration
These functions don't need to be called from multiple places and
by making them static we will detect when they are not added to the
list functions to be tested.

Closes #5715

Backport of MR !11480

Merge branch 'backport-5715-isc_run_test_impl-should-use-a-static-declaration-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11502
2026-01-29 01:06:54 +11:00
Mark Andrews
84f955a972 ISC_RUN_TEST_IMPL should use a static declaration
These functions don't need to be called from multiple places and
by making them static we will detect when they are not added to the
list functions to be tested.

(cherry picked from commit 22d664aa15)
2026-01-29 00:26:35 +11:00
Mark Andrews
47b8ca5ac7 [9.20] chg: dev: Use enum rather than numbers for isc_base64_tobuffer and isc_hex_tobuffer
Use isc_one_or_more and isc_zero_or_more rather than (-2) and
(-1) when calling isc_base64_tobuffer. Similarly for
isc_hex_tobuffer. This should help reduce the probability
that the wrong number is used and it makes the intent clearer.

Closes #5713

Backport of MR !11479

Merge branch 'backport-5713-use-macros-with-isc_base64_tobuffer-and-isc_hex_tobuffer-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11498
2026-01-28 08:40:42 +11:00
Mark Andrews
37e03b004e Add spatch for isc_one_or_more and isc_zero_or_more
(cherry picked from commit d92369cc8f)
2026-01-28 08:02:06 +11:00
Mark Andrews
5bb645a24c Use isc__zero_or_more when calling isc_base64_tobuffer
(cherry picked from commit 5843289550)
2026-01-28 08:02:06 +11:00
Mark Andrews
f4e04e098a Use isc_one_or_more when calling isc_base64_tobuffer
(cherry picked from commit 62fd89d4a1)
2026-01-28 08:02:06 +11:00
Mark Andrews
e8f2bae031 Use isc_one_or_more when calling isc_hex_tobuffer
(cherry picked from commit 7feb0f5b53)
2026-01-28 08:02:06 +11:00
Mark Andrews
fd76b90126 Add enum for use with isc_base64_tobuffer and isc_hex_tobuffer
This adds the following enum isc_one_or_more and isc_zero_or_more
which specify if one or more or zeror or more bytes are required
when reading the unbounded base64 / hex encoded data.

(cherry picked from commit 07610f8566)
2026-01-28 08:02:00 +11:00
Arаm Sаrgsyаn
3d0823ee68 [9.20] fix: usr: Fix a possible issue with reponse policy zones and catalog zones
If a response policy zone (RPZ) or a catalog zone contained an
`$INCLUDE` directive, then manually reloading that zone could
fail to process the changes in the response policy or in the
catalog, respectively. This has been fixed.

Closes #5714

Backport of MR !11489

Merge branch 'backport-5714-zone_loaddone-rpz-and-catz-bugfix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11496
2026-01-27 13:28:33 +00:00
Aram Sargsyan
074a152c4f Add a new check in the RPZ system test
Check that reloading a response policy zone which has an '$INCLUDE'
directive defined is working as expected.

(cherry picked from commit d81a2457d6)
2026-01-27 12:45:48 +00:00
Aram Sargsyan
0ae305c952 Fix a bug in zone_loaddone()
The zone_loaddone() function disables database notifications for
a catalog zones and response policy zones (RPZ) when loading had
failed. Howerer, the 'result != ISC_R_SUCCESS' check is insufficient,
because the DNS_R_SEENINCLUDE result also indicates success.

Add a second condition for the "if" block.

(cherry picked from commit 31290eccb1)
2026-01-27 12:45:48 +00:00
Nicki Křížek
08c6ecd442 [9.20] fix: test: Resolve the system_test_dir in pytest
If the system_test_dir contains a symlink, then it might cause issues
further down when using relative_to(), unless it is resolved first. This
has been observed on FreeBSD13 in CI where /home is a symlink to
/usr/home.

Backport of MR !11490

Merge branch 'backport-nicki/pytest-freebsd13-artifacts-path-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11494
2026-01-27 13:20:24 +01:00
Nicki Křížek
566f15b039 Resolve the system_test_dir in pytest
If the system_test_dir contains a symlink, then it might cause issues
further down when using relative_to(), unless it is resolved first. This
has been observed on FreeBSD13 in CI where /home is a symlink to
/usr/home.

(cherry picked from commit b1e3469059)
2026-01-27 12:32:37 +01:00
Štěpán Balážik
07695728ca [9.20] chg: test: Use isctest.asyncserver in the "resolver" system test
Depends on !11403, !11419

Backport of MR !11411

Merge branch 'backport-stepan/resolver-asyncserver-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11486
2026-01-27 11:29:38 +00:00
Štěpán Balážik
7a70608cfd Fix bugs in 'resolver/ans2' and 'resolver/ans3'
There were multiple typos and omissions regarding query minimization.

(cherry picked from commit c336c1feab)
2026-01-27 11:49:34 +01:00
Štěpán Balážik
a190f65c43 Reimplement 'resolver/ans10' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.

(cherry picked from commit cef851740b)
2026-01-27 11:48:57 +01:00
Štěpán Balážik
fabad54501 Reimplement 'resolver/ans8' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.

(cherry picked from commit 8f2526a27d)
2026-01-27 11:48:57 +01:00
Štěpán Balážik
fdcdcbc0e2 Reimplement 'resolver/ans3' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.

(cherry picked from commit 5004d278e4)
2026-01-27 11:48:57 +01:00
Štěpán Balážik
aa658f80d7 Reimplement 'resolver/ans2' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.

(cherry picked from commit d203a39314)
2026-01-27 11:48:48 +01:00
Štěpán Balážik
c11a7877b9 Add common parts of resolver test custom servers
These will be shared by all the ans*/ans.py files.

(cherry picked from commit 23d9055617)
2026-01-27 11:02:31 +01:00
Štěpán Balážik
e466fedcc4 Add StaticResponseHandler to isctest.asyncserver
It is used to prepare and yield one DNS response and avoid the
`get_responses` boiler-plate.

(cherry picked from commit eba89fd38b)
2026-01-27 11:02:31 +01:00
Štěpán Balážik
faec3cb1e1 Add QnameQtypeHandler for matching QNAME, QTYPE pairs
This is a pattern in the resolver system test and also elsewhere.

(cherry picked from commit 8a45f5b485)
2026-01-27 11:02:31 +01:00
Štěpán Balážik
9acda27250 Delete unused ResponseHandlers from statistics ans server
Turns out the original ans.pl implementation before (!10928) was a copy
of an old version of the ans2 server from the resolver system test.

I reimplemented it fully, even though only two ResponseHandlers are
actually used in the statistics test.

(cherry picked from commit 7d5ec7167b)
2026-01-27 11:02:31 +01:00
Štěpán Balážik
f82168a994 Store the most specific matched domain in DomainHandler
Store the most specific matching domain in DomainHandler and
expose it through the `matched_domain` property for subclasses
to use in their implementations of `get_responses`.

(cherry picked from commit b89cc2bd86)
2026-01-27 11:02:31 +01:00
Mark Andrews
f73ef3b24f [9.20] fix: usr: Fix brid and hhit implementation
Fix bugs in BRID and HHIT implementation and enable
the unit tests.

Closes #5710

Backport of MR !11491

Merge branch 'backport-5710-fix-hhit-and-brid-issues-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11492
2026-01-27 17:30:48 +11:00
Mark Andrews
016baaa06c Fix brid and hhit unit tests
These tests were not being run.

(cherry picked from commit 97af8fc519)
2026-01-27 05:46:17 +00:00
Mark Andrews
9f7577f207 Remove extraneous space at start of brid and hhit records
(cherry picked from commit 10366e4f4e)
2026-01-27 05:46:17 +00:00
Mark Andrews
651e3c32f2 Fix isc_base64_tobuffer call for brid and hhit
Zero length records were not being rejected.

(cherry picked from commit bdb9c838a8)
2026-01-27 05:46:17 +00:00
Mark Andrews
d192c7c33a [9.20] fix: test: unit test tsig_badsig was not being called
Additionally, the test was badly implemented. This has been fixed.

Closes #5712

Backport of MR !11478

Merge branch 'backport-5712-unit-test-tsig_badsig-was-not-being-called-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11485
2026-01-24 09:08:36 +11:00
Mark Andrews
1c32c8dba2 Fix and call tsig_badsig unit test
(cherry picked from commit 8da2310511)
2026-01-24 07:29:59 +11:00
Mark Andrews
bd9f73c705 [9.20] fix: usr: DSYNC record incorrectly used two octets for the Scheme Field
When creating the `DSYNC` record from a structure, `uint16_tobuffer` was used instead of `uint8_tobuffer` when adding the scheme, causing a `DSYNC` record that was one octet too long. This has been fixed.

Closes #5711

Backport of MR !11477

Merge branch 'backport-5711-dsync_fromstruct-produces-an-invalid-record-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11483
2026-01-24 02:19:23 +11:00
Mark Andrews
5b4e36fbfc Fix dsync unit test
The dsync unit test was not being run and the domain names in
the test data should have been fully qualified.

(cherry picked from commit 2159f74a1f)
2026-01-23 14:24:27 +00:00
Mark Andrews
19cf7bb2cd dsync_from struct produced an invalid record
uint16_tobuffer was used instead of uint8_tobuffer when adding the
scheme to the buffer.  This produced a record that was one octet
too long.  This has been fixed.

(cherry picked from commit 3180e50459)
2026-01-23 14:24:27 +00:00
Andoni Duarte
963737fa3f [9.20] chg: ci: Use a small always-on runner for lightweight CI jobs
Some CI jobs spend more time pulling the docker image and setting up their environment than running the script. This MR adds a tag `smalljob` to jobs considered lightweight in order to run them on a dedicated small VM.

Backport of MR !11266

Merge branch 'backport-andoni/try-small-vm-for-lightweight-ci-jobs-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11481
2026-01-23 12:38:56 +00:00
Andoni Duarte Pintado
b9106402cb
Add smalljob tag to small jobs not in the quick-checks stage
Jobs using the "post_merge" and "manual_release_job_qa" anchors also
complete in less than a minute, so they now include the "smalljob" tag.

Since the "release" job is also a fast one, but without an anchor, the
"smalljob" tag is added to its definition.

The "autoconf_job" definion also includes the tag and it is kept in its
own stage.

(cherry picked from commit e9f2b7944e)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
760f95bafa
De-duplicate yaml for "other-checks" jobs
In .gitlab-ci.yml, since "&other_checks_job" has "needs: []", remove
that line from the jobs that use that anchor.

(cherry picked from commit 66175b448c)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
5b087d8964
Move "needs: []" to the "quick_checks_job" anchor
Most jobs in this stage have it by default, so it makes sense to
add it to their common anchor. Jobs with different "needs:" will
override it.

(cherry picked from commit 432b7d7954)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
5044be551c
Group CI jobs in "quick-checks" stage together
Move the jobs in the "quick-checks" stage to the same place in
.gitlab-ci.yml.

(cherry picked from commit b3ac6b47d9)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
292951be90
Add faster CI jobs to the "quick-checks" stage
Given the short runtime (<1min) of the "linkcheck" and
"generate-tsan-stress-test-configs" CI jobs, move them to the
"quick-checks" stage.

(cherry picked from commit ae76829157)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
9694a1a06e
Move CI stage "other-checks" right after "quick-checks"
Move CI stage "other-checks" right after "quick-checks" and get the jobs
in it as close to each other as possible in .gitlab-ci.yml.

Since no job is allowed to depend (via "needs") on any job that is
assigned to a stage later than its own, move the "tsan:stress" and
"gcov" jobs to the "system" stage.

(cherry picked from commit 4f89d32bff)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
00e7621cd1
Move slower CI jobs out of "quick-checks" stage
Jobs with more than one minute of runtime are not considered for the
small VM.

The "tarball-create" job goes to the more appropriate "build" stage.

"coccinelle" and "checkbashisms" are moved to the generic
"other-checks".

(cherry picked from commit ba5844a1de)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
d2b9831950
Create "other_checks_job" anchor in CI yaml
Use an anchor for the common parts of "other-checks" jobs in CI yaml.

(cherry picked from commit e61bc3ad72)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
18b8517350
Rename the "postcheck" stage to "other-checks" in CI
Rename the "postcheck" CI stage to the more generic "other-checks".
Slower jobs that still run in autoscaled runners belong here, as opposed
to the lightweight ones in "quick-checks".

(cherry picked from commit 6d442c4a06)
2026-01-23 12:50:50 +01:00
Andoni Duarte Pintado
001bd6f361
Rename the "precheck" stage in CI to "quick-checks"
Most jobs in the "precheck" stage spend more time setting up their
environment than running the script (seconds), this allows us to add a
small always on dedicated runner instead of the autoscaled ones.

Hence, the stage is renamed to "quick-checks", and a tag "smalljob" is
added to the anchor so that these jobs are picked by the dedicated
runner.

(cherry picked from commit 9aa5041a88)
2026-01-23 12:50:50 +01:00
Andoni Duarte
80b2e49414 [9.20] fix: ci: Read the Docs picking old version when stable tag is updated
Read the Docs fails to pick the latest version when updating the `stable` tag, i.e. a build is triggered but it takes the previous version of it. This is a known bug in RtD: https://github.com/readthedocs/readthedocs.org/issues/10838.

The only approach that seems to solve this on our end, is to wait some time and trigger the build again so that it picks the latest version of the tag.

Backport of MR !11475

Merge branch 'backport-andoni/fix-rtd-picking-old-version-when-stable-branch-update-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11476
2026-01-22 19:17:49 +00:00
Andoni Duarte Pintado
aaed535171 Fix Read the Docs stable branch update bug
Read the Docs fails to pick the latest version of the stable tag when
updated, i.e. a build is triggered but it takes the previous version.
This commit triggers a second build after 5 minutes to ensure that the
correct tag version is used for the documentation.

This is a known bug in RtD:
https://github.com/readthedocs/readthedocs.org/issues/10838.

(cherry picked from commit 168b15cfd9)
2026-01-22 18:41:21 +00:00
Nicki Křížek
384ed04b84 [9.20] fix: ci: Apply black formatting changes
Generated by black 26.1.0 which got updated in CI.

Merge branch 'nicki/python-black-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11472
2026-01-22 09:44:36 +01:00
Nicki Křížek
bf303c793e Apply black formatting changes
Generated by black 26.1.0 which got updated in CI.
2026-01-21 22:39:09 +01:00
Nicki Křížek
a2a9b1b878 [9.20] chg: pkg: Update requirements for system test suite
Python 3.10 or newer is now required for running the system test suite. The required python packages and their version requirements are now tracked in `bin/tests/system/requirements.txt`.

Support for pytest 9.0.0 has been added its minimum supported version has been raised to 7.0.0. The minimum supported dnspython version has been raised to 2.3.0.

Closes #5690 

Closes #5614

Backport of MR !11415

Merge branch 'backport-nicki/pytest-9-compat-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11469
2026-01-21 16:36:52 +01:00