Commit graph

12829 commits

Author SHA1 Message Date
Mark Andrews
a6ca8407ee
Check notify with bad notify source address and tsig
named was asserting when the notify source address was not available
and TSIG was being used.  Check this scenario by adding a nameserver
to the zone which is configured to uses a non-existent source address
and a blackholed destination address and a TSIG using a server clause
for that destination address.

(cherry picked from commit f99d7f4217)
2026-02-20 10:50:19 +01:00
Mark Andrews
32f802f4ed Return FORMERR for ECS family 0
RFC 7871 only defines family 1 (IPv4) and 2 (IPv6). Additionally
it requires FORMERR to be returned for all unknown families.

(cherry picked from commit 757e503536)
2026-02-19 22:42:26 +11:00
Matthijs Mekking
9101096e1e List 'rndc dnssec' arguments in alphabetic order
Same as rndc usage orderning,

(cherry picked from commit 4a22921936)
2026-02-18 14:20:53 +00:00
Matthijs Mekking
de04328ec7 Add rndc dnssec -step command to usage
The `-step` argument was erroneously omitted from the usage output.

(cherry picked from commit 0dd61d8773)
2026-02-18 14:20:53 +00:00
Mark Andrews
38ca02c7a0 Use shell function 'check_count' to check counts
(cherry picked from commit ea32141e48)
2026-02-17 03:32:47 +00:00
Mark Andrews
b9ba70f9c1 Test forward query/response counts
(cherry picked from commit 591096f131)
2026-02-17 03:32:47 +00:00
Mark Andrews
e8828fb2b1 Add missed ret!=0 checks
(cherry picked from commit 77278beaf3)
2026-02-17 03:32:47 +00:00
Michał Kępień
43eec494dd Use isctest.asyncserver in the "pipelined" test
Replace the custom DNS server used in the "pipelined" system test with
new code based on the isctest.asyncserver module.

(cherry picked from commit 3954025218)
2026-02-13 14:03:58 +00:00
Michał Kępień
5a0e1de2e5 Implement a response handler that forwards queries
Add a new response handler, ForwarderHandler, which enables forwarding
all queries to another DNS server.  To simplify implementation, always
forward queries to the target server via UDP, even if they are
originally received using a different transport protocol.

(cherry picked from commit 10a2fc7f1f)
2026-02-13 14:03:58 +00:00
Michał Kępień
f773a18f40 Log the server socket receiving each query
Extend AsyncDnsServer._log_query() and AsyncDnsServer._log_response() so
that they also log the <address, port> tuple for the socket on which a
given query was received on.  Minimize the signatures of those methods
by taking advantage of all the information contained in the QueryContext
instances passed to them.

(cherry picked from commit d3d9d166ed)
2026-02-13 14:03:58 +00:00
Michał Kępień
442285dce3 Store server socket information in QueryContext
Extend the QueryContext class with a field holding the <address, port>
tuple for the socket on which a given query was received.  This will
enable query handlers to act upon that information in arbitrary ways.

(cherry picked from commit 94a4793596)
2026-02-13 14:03:58 +00:00
Mark Andrews
5149e9abfa Document that query options are order sensitive
(cherry picked from commit 879d2ed480)
2026-02-09 22:47:15 +00:00
Michal Nowak
94a3861776 Rewrite xfer system test to pytest
(cherry picked from commit bf0df8b7f4)
2026-02-06 21:03:52 +01:00
Nicki Křížek
aeb0518239 Allow re-run of kasp test case on all FreeBSDs
Previously, the issue when the kasp.test_kasp_case[secondary.kasp] fails
due to a timeout has been only ocassionally observed on FreeBSD 13
in our CI. It seems to have come back on FreeBSD 15.

(cherry picked from commit e4abb5bd07)
2026-02-06 13:20:03 +00:00
Nicki Křížek
f76fa8ad35 Improve logging for isctest.run.retry_with_timeout
Add more debug messages around the retry function to facilitate
debugging in case of issues.

(cherry picked from commit d237048de2)
2026-02-06 13:20:03 +00:00
Mark Andrews
fb34eb11e9 Fix timing in tests_nsec3_change.py
The zone file is updated too soon causing the reload to fail.
Add a 1 second sleep to ensure the modification time has changed.

(cherry picked from commit 8f413fd589)
2026-02-06 10:38:47 +00:00
Matthijs Mekking
440ada653d Add a regression test for the BRID/HHIT crash
Add two short records to example.com.db that cause assertion failures
when converted to wire form.

The checks added to tests.sh are technically not required: the relevant
assertion failures are already hit when the zone is transferred out of
ns1.

Update the relevant unit tests with 1-byte records.

Co-authored-by: Mark Andrews <marka@isc.org>
(cherry picked from commit ce1d68cbc5)
2026-02-05 18:23:49 +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
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
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
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
ad212589bf Silence incorrect pylint warnings for hypothesis.assume()
With hypothesis>6.148.3, pylint generates

W0101: Unreachable code (unreachable)

when any code is present after hypothesis.assume(). Silence these until
it is fixed upstream.

See https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217

(cherry picked from commit 08630ca744)
2026-01-21 16:29:34 +01:00
Nicki Křížek
fe1b33fb7e Remove hypothesis version checks
The minimum required hypothesis version has been set in requirements.txt
and no longer needs to be checked at runtime.

Since the hypothesis package is now a mandatory prerequisite, include it
in isctest as the other subpackages.

(cherry picked from commit 1291fa1a6d)
2026-01-21 16:29:14 +01:00
Nicki Křížek
5c931d8045 Remove compatibility hacks for dnspython<2.7.0
The minimum required dnspython version is now 2.7.0 and those
compatibility hacks can be dropped.

(cherry picked from commit ce385d8100)
2026-01-21 16:29:01 +01:00
Nicki Křížek
a78d19c597 Bump the minimum required python version to 3.10
Drop support of EoL python versions for running system tests. The
maintenance cost of supporting end of life ecosystem, especially Python
3.6 on EL8 and the related outdated packages (pytest, dnspython, ...),
has become unreasonable.

(cherry picked from commit ac8e2905b8)
2026-01-21 16:28:52 +01:00
Nicki Křížek
1830df3fc5 Remove pytest<7 compatibility hacks
Minimum pytest version has been bumped to 7.0.0, thus these are no
longer needed.

(cherry picked from commit e276c3d5bd)
2026-01-21 16:28:43 +01:00
Nicki Křížek
7c2a8e63f6 Add support for pytest>=9.0.0
Use collection_path rather than the deprecated path argument for
pytest_ignore_collect() hook.

The collection_path argument was added in pytest 7.0.0, which is the
minimum supported pytest version from now on.

(cherry picked from commit 093bef9211)
2026-01-21 16:28:33 +01:00
Nicki Křížek
6e98ed3b2b Add requirements.txt for system tests
This file lists the required Python packages and versions for running
system tests. The easiest way to obtain them is:

    pip install -r requirements.txt

The minimum dnspython version is 2.7.0 because it supports TSIG parsing
without validation (for tsig/tests_tsig_hypothesis.py) and wire() (for
names/tests_names.py).

The minimum pytest version was bumped to 7.0.0 because it supports the
collection hook API required by pytest 9.

The minimum hypothesis version was set to 4.41.2 as prior versions might
have issues on FIPS systems.

(cherry picked from commit 628e16d057)
2026-01-21 16:26:25 +01:00
Mark Andrews
8dc183f598 Fix timing issues in nsec3/tests_nsec3_reconfig.py
ns3/nsec3-ent.kasp.db is regenerated too fast resulting in
the subsequent 'rndc reload' call failing.  This has been
fixed.

(cherry picked from commit f01497e05b)
2026-01-21 10:26:46 +00:00
Mark Andrews
31bdd01227 Use const pointer with strchr of const pointer
C23 now has qualifier preserving standard functions for strchr,
bsearch, strpbrk, strrchr, strstr, memchr.  There where a few places
where the return value was not assigned to a const qualified pointer.
These have been fixed.

(cherry picked from commit af379e10cc)
2026-01-20 06:00:50 +00:00
Michal Nowak
2cd2f82c15 Portions of two dnssec-malformed-dnskey tests need querytrace
Without querytrace set, test_malformed_ecdsa and test_multiple_rrsigs
fail on the log_validation_failed string.

(cherry picked from commit d03b3f5a1d)
2026-01-15 13:08:03 +00:00
Štěpán Balážik
ecbce10790 Use isctest.asyncserver in the "ixfr" system test
Replace the usage of the `bin/tests/system/ans.pl` server with an
instance of ControllableAsyncServer.

(cherry picked from commit 46ecbbed0a)
2026-01-14 12:22:06 +00:00
Štěpán Balážik
8a088183e6 Add SwitchControlCommand for ControllableAsyncServer
To provide feature parity with `bin/tests/system/ans.pl` add a control
command to allow easy switching between different sequences of
ResponseHandlers.

(cherry picked from commit 2302fe1235)
2026-01-14 12:22:06 +00:00
Štěpán Balážik
5284dfd4fe Use variadic positional parameters for plural install_* methods
It saves an indent and brackets on the call sites.

Also sort the handlers alphabetically where their order doesn't matter
and split the fallback handlers into a separate call to signify that
their position in the end matters.

(cherry picked from commit 7e587201a4)
2026-01-14 12:22:06 +00:00
Aram Sargsyan
0004175c64 Ignore case for some messages in the catz system test
RBT and QP builds output some log messages in different cases. Ignore
the case of the affected log messages.
2026-01-12 15:52:35 +00:00
Aram Sargsyan
e2bfce435f Test that catalog zones' entry names are case-insensitive
(cherry picked from commit 4e9d97b4f7)
2026-01-12 13:01:53 +00:00
Aram Sargsyan
5a00d2ffe0 Test that catalog zone names are case-insensitive
Change one of the existing catalog zone names to test that
catalog zones are now case-insensitive.

(cherry picked from commit 6d0e6454ac)
2026-01-12 13:01:53 +00:00
Nicki Křížek
5e02d42a23 Renumber ans7->ans6 and ans8->ans7 in digdelv test
Since there was no 10.53.0.6 server in the test, renumber the remaining
ones so that there's no gap in the server names.

This commit simply moves the ans.py files without any changes and
renumbers the IP addresses in tests.

(cherry picked from commit 9b63187a99)
2026-01-12 10:53:23 +00:00
Nicki Křížek
25540fdead Add dnspython>=2.0.0 requirement for digdelv
Now that the test uses AsyncDnsServer, require the appropriate dnspython
version for the test.

(cherry picked from commit 6c69abf783)
2026-01-12 10:53:23 +00:00
Nicki Křížek
5c2dc5ad3b Replace digdelv/ans8 with AsyncDnsServer
Previously, the ans8 server had different response modes that applied to
all queries. Replace it with AsyncDnsServer that has serves the different
response modes under different domains without the need to change the
server behaviour at runtime.

Add the new queries that require an ns3 fallback to the ns3/example.db
zone.

(cherry picked from commit 0b7a089c7f)
2026-01-12 10:53:23 +00:00
Nicki Křížek
4a1f4d67a9 Replace digdelv/ans5 with ControllableAsyncDnsServer
The server has three modes of operation - either no response, a partial
AXFR or a complete AXFR. To test the fallback behaviour of dig, these
actions are be combined in a specific sequences. To set up the desired
server behaviour, use the _control queries for the server.

(cherry picked from commit 575f0e3916)
2026-01-12 10:53:23 +00:00