Commit graph

12613 commits

Author SHA1 Message Date
Mark Andrews
1e3e61ba53 Update man pages for deprecated algorithms 2025-07-15 23:53:57 +10:00
Mark Andrews
cb6903c55e 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.
2025-07-15 23:53:57 +10:00
Štěpán Balážik
e34e831cab 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.
2025-07-13 10:57:04 +02:00
Štěpán Balážik
72ac1fe234 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
2025-07-13 10:57:04 +02:00
Nicki Křížek
927dc5bc2b 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.
2025-07-10 17:13:05 +02:00
Aram Sargsyan
5d1a8fe755 Fix a possible hang in dig if a send is interrupted/canceled
When send_done() is called with a ISC_R_CANCELED status (e.g. because
of a signal from ctrl+c), dig can fail to shutdown because
check_if_done() is not called in the branch. Add a check_if_done()
call.
2025-07-10 11:16:45 +00:00
Aram Sargsyan
a2685696aa Fix a query reference counting issue in dig
When reusing a TCP connection (because of the '+keepopen' option),
dig detaches from the query after launching it. This can cause a
crash in dig in rare cases when the "receive" callback is called
earlier than the "send" callback.

The '_cancel_lookup()' function detaches a query only if it's
found in the 'lookup->q' list. Before this commit, with one
additional detach happening before recv_done() -> _cancel_lookup()
is called, it didn't cause problems because an earlier _query_detach()
was unlinking the query from 'lookup->q' (because it was the last
reference), so the additional detach and the skipped detach were
undoing each other.

That is unless the "receive" callback was called earlier than the
"send" callback, in which case the additional detach wasn't destroying
the query (and wasn't unlinking it from 'lookup->q') because the "send"
callback's attachment was still there, and so _cancel_lookup() was
trying to "steal" the "send" callback's attachment and causing an
assertion on 'INSIST(query->sendhandle == NULL);'.

Delete the detachment which caused the described situation.
2025-07-10 11:16:45 +00:00
Petr Špaček
750d8a61b6 Convert DNS_RDATASETATTR_ bitfield manipulation to struct of bools
RRset ordering is now an enum inside struct rdataset attributes. This
was done to keep size to of the structure to its original value before
this MR.

I expect zero performance impact but it should be easier to deal with
attributes in debuggers and language servers.
2025-07-10 11:17:19 +02:00
Alessio Podda
e84704bd55 Improve efficiency of ns_client_t reset
The ns_client_t struct is reset and zero-ed out on every query,
but some fields (query, message, manager) are preserved.

We observe two things:
 - The sendbuf field is going to be overwritten anyway, there's
   no need to zero it out.
 - The fields are copied out when the struct is zero-ed out, and
   then copied back in. For the query field (which is 896 bytes)
   this is very inefficient.

This commit makes the reset more efficient avoiding to unnecessary
zero-ing and copy.
2025-07-10 07:19:47 +02:00
Mark Andrews
28a8933690 Use native shared library extension
For most platforms this is ".so" but for Darwin it is ".dylib".
2025-07-07 23:39:44 +10:00
Nicki Křížek
b98660e93e Remove unstable check from digdelv test
The code which checks for both IPv4 and IPv6 mixed usage is inherently
unstable, since the address family is chosen randomly for each
connection.

Closes #5406
2025-07-07 13:29:15 +02:00
Nicki Křížek
4c487c811d Use pytest.mark.flaky as the flaky marker
It's possible to use pytest.mark.flaky, which achieves the exact same
thing as our custom-defined isctest.mark.flaky -- attempts to rerun the
test on failure, but only is flaky package is available.
2025-07-07 13:29:15 +02:00
Nicki Křížek
126a59cef2 Mark secondary.kasp test case as flaky on freebsd13
The test_kasp_case[secondary.kasp] can sometimes fail on freebsd13. It
appears the test gets stuck on some operation which should be very
quick, but for some reason takes at least a few seconds, causing the
cb_ixfr_is_signed() function to time out.

In one of the cases I investigated, it wasn't a query/response that
caused a timeout, but rather some operation in between. The test
attempts to read from a keyfile/statefile, but I see no reason why that
should block.

In any case, try to increase the timeout for the verification, as that
shouldn't hurt. Also allow the test to be re-run on freebsd13, as it's
likely to be caused by some odd behaviour on that platform -- the issue
doesn't appear anywhere else.
2025-07-07 13:29:15 +02:00
Nicki Křížek
34867e1693 Allow dnstap system test rerun on freebsd13
The check "unix socket message counts" sometimes fails with "dnstap
output file smaller than expected". This only happens on freebsd13 and
can't be reproduced easily. There was an attempt to decrease the
required file size in the past, but apparently, the issue can still
occur.
2025-07-07 13:29:15 +02:00
Nicki Křížek
1e0df480c7 Mark the serve_stale system test as flaky
The serve_stale test has some inherent instabilities affecting many
different checks. While the failure rate isn't too high (about four
failures in past three weeks of nightlies), it gets ignored, because the
test has been unstable for a very long time.
2025-07-07 13:29:15 +02:00
Nicki Křížek
6755d741e4 Remove token deletion check in keyfromlabel test
This removes a leftover check which should've been removed in a prior
change (see #5244). The softhsm2 failures when attempting to delete the
token should be ignored.
2025-07-07 13:29:15 +02:00
Nicki Křížek
87ab198b73 Use proper wait in rndc test
Previously, the one-second sleep was unreliable, as it didn't properly
indicate that the rndc reconfig has been processed. The "test 'rndc
reconfig' with a broken config" check would sometimes fail under TSAN
in CI, because the previous rndc reconfig was still ongoing, and the
subsequent rndc reconfig was ignored.
2025-07-07 13:29:15 +02:00
Nicki Křížek
66f6f4bba9 Allow reruns for test_json and test_xml tests
These tests have been unstable under TSAN in the past, but it appears
that the same failure mode can happen outside of TSAN tests as well.
These tests have produced 12 failures combined in the past three weeks
in nightlies.
2025-07-07 13:29:02 +02:00
Nicki Křížek
ae932eefc5 Increase test reruns for fetchlimit
The fetchlimit test has failed 8 times in the nightly CI over the past
three weeks. That makes the overall failure rate somewhere around 1 %,
which isn't a lot, but is still annoying when lots of testing is going
on.
2025-07-07 13:29:02 +02:00
Mark Andrews
8b7bbda2f1 rndc test: second 'rndc reconfig' happens too soon
Rndc test "test 'rndc reconfig' with a broken config" was failing
intermittently.

Wait for 'running' to be logged rather than just using 'sleep 1' before
calling 'rndc reconfig' a second time to get the expected error message
rather than 'reconfig request ignored: already running'.
2025-07-07 11:42:10 +10:00
Štěpán Balážik
01d1ad7988 Disable DNSSEC validation instead of enabling it with empty TAs in tests
There are many system tests where we set `dnssec-validation yes;` only
to also set `trust-anchors { };` which effectively disables the
validation.

This commit replaces this convoluted setup with just
`dnssec-validation no;`.
2025-07-06 14:18:10 +00:00
Ondřej Surý
de08c0088d
Fix the default interface-interval docs and default value
When the interface-interval parser was changed from uint32 parser to
duration parser, the default value stayed at plain 60 which now means 60
seconds instead of 60 minutes.  Fix the default value and the
documentation to match the reality.
2025-07-01 11:19:57 +02:00
Colin Vidal
b0a33f77dc add startup root DNSKEY refresh system test
Root trust anchors are automatically updated as described in RFC5011.
Add a system test which ensures the root DNSKEYs are always queried by
named during startup.

Because this test uses real internet DNS root servers, it is enabled
only when `CI_ENABLE_LIVE_INTERNET_TESTS` is set.
2025-06-30 13:56:24 +02:00
Ondřej Surý
dd37fd6a49 Add ISC_TID_MAX with default being 512 threads
The ISC_TID_MAX variable allows other units to declare static arrays
with this as size for per-thread/per-loop variables.
2025-06-28 13:32:12 +02:00
Štěpán Balážik
d5874d5df9 Move root zone mirror system test to a separate directory
This test doesn't require artifact checking but when bundled in the same
directory with the shell based tests, the `system:clang:tsan` job was
failing non-deterministically.
2025-06-27 15:19:45 +00:00
Nicki Křížek
fcf31417dd Log assertion failures right after test result
The extra messages are typically traceback from assertion failures.
Previously, they'd be printed only after all individual test case
results have been printed. That made it difficult to pair the traceback
to the failing test in some cases, as the node information (aka test
name) might not always be present.

Instead, log any extra messages related to a particular test failure
directly after reporting its result, making the failure details more
readily available and easy to connect with a particular test case.
2025-06-27 16:31:49 +02:00
Nicki Křížek
9f3f6ec38e Log command stdout when using isctest.run.cmd()
The command's stdout may provide useful debug info, so make sure we log
it by default. It doesn't seem to have a significant impact on the log
size.
2025-06-27 16:31:49 +02:00
Nicki Křížek
56fec9ba04 Log query and response when using isctest.query.*
Make sure the queries and responses are logged at the DEBUG level, which
may provide useful information in case of failing tests.

This doesn't seem to significantly increase the overall artifacts size.
Previously, pytest.log.txt files from all system tests would take around
3 MB, with this change, it's around 8 MB).
2025-06-27 16:31:49 +02:00
Nicki Křížek
51ac5bdd14 Use proper logging in SPNEGO tests
Avoid using print() and use proper logging facility instead.
2025-06-27 16:31:49 +02:00
Nicki Křížek
1e87b5ffc6 Add options for query&response logging to pytest
In some cases, it's useful to log the sent and received DNS messages.
Add options to enable this on demand. Query is only logged the first
time it's sent, since it doesn't change. If response logging is turned
on, then each response is logged, since it might be different every
time.
2025-06-27 16:31:49 +02:00
Nicki Křížek
23e6b49cc5 Indent multiline output in pytest logging
When multiline message is logged, indent all but the first line (which
will be preceeded by the LOG_FORMAT). This improves the clarity of logs,
as it's immediately clear which lines are regular log output, and which
ones are multiline debug output.

Adjust the isctest.run.cmd() stdout/stderr logging to this new format.
2025-06-27 16:31:49 +02:00
Nicki Křížek
0a6b0cf68c Don't log empty test result messages
The messages obtained from test results may contain stuff like detailed
failure/error information, tracebacks etc. In many cases, the message
will be empty, in which case it doesn't need to be logged.

For an example, run test with many test cases, e.g.
verify/test_verify.py, and inspect the tail of the pytest.log.txt before
and after this commit.
2025-06-27 16:31:49 +02:00
Nicki Křížek
4b8998e4ad Replace print statements in checkds test
Use isctest.log logging facility for consistent and predictable logging
output rather than using print(). Remove writes of stderr, as that
output will be logged in the debug log in case the commands called with
isctest.run.cmd() fails.
2025-06-27 16:31:49 +02:00
Štěpán Balážik
a69efc678c Add a system test that ensures root zone mirroring works out of the box
This is a test for #5380.
2025-06-27 13:05:43 +02:00
Štěpán Balážik
3a8ffc74df Add a pytest mark for system tests that require Internet connection
We skip those by default as:

a) we don't want to stress the upstream servers in every CI pipeline
b) system tests need to be runnable in a isolated environment by default
2025-06-27 07:24:48 +00:00
Štěpán Balážik
c7a8f61055 Rename CI_ENABLE_ALL_TESTS to CI_ENABLE_LONG_TESTS
New name is more descriptive and allows us to created more optional
test sets.
2025-06-27 07:24:48 +00:00
Štěpán Balážik
a62fdee97f Remove scripts related to the automake test driver
These were left in in the Meson migration.
2025-06-26 13:24:33 +00:00
Michał Kępień
12829660fc
Fix version description in a startup log message
Commit 5cd6c173ff changed the contents of
the PACKAGE_DESCRIPTION preprocessor macro from " (<description>)" to
just "<description>" and missed a spot while adjusting all uses of this
macro in the code base.  Fix formatting for that malformed log message,
emitted upon named startup.
2025-06-26 12:05:53 +02:00
Petr Menšík
8e789ea62f Do not expect fail in cpu test default configuration
Previous CPU test relied on either missing default named.conf or the
missing permissions to write into its default directory. In short that
default configuration would be unusable with current user. It would hang
indefinitely at cpu test if the named user could write into directory
specified in default configuration.

Change it instead to explicitly try non-existent configuration file.
It will still fail immediately, but will not rely on running user or
presence of file at default configuration file path.
2025-06-25 11:35:27 +00:00
Mark Andrews
422b9118e8 Use clang-format-20 to update formatting 2025-06-25 12:44:22 +10:00
Nicki Křížek
c06dc71cd5 Make extra_artifacts check optional
There is an ongoing debate about the usefulness of the extra artifacts
check. While it might be useful to detect unexpected behaviour in some
tests, it feels extraneous in many cases. This change provides a middle
ground by making the artifact checking optional. This might be
especially useful for writing new tests, since the author gets to decide
whether the check is useful -- and can utilize it, or can skip it for
sake of brevity.
2025-06-24 16:56:53 +02:00
Michal Nowak
b890ff46cc Drop empty directory bin/rndc/include/
It should have been removed as part of
9088052225.
2025-06-24 12:38:37 +00:00
Colin Vidal
349cc060f4 wait for reload completed in emptyzones system test
The emptyzones system test ran two consecutive "rndc reload" commands
without waiting for the first one to complete. It used to work because
the commands were serialized, but now an rndc reconfig/reload command is
ignored if another one is already running, so the emptyzones test is
more likely to fail.

Fix this problem by waiting for the log message indicating that all the
zones are loaded before attempting the next reload.
2025-06-23 23:20:30 -07:00
Colin Vidal
209b30d563 log-based test for load/apply config
Add a new system test which checks named output when starting,
reconfiguring and reloading the server. It checks that the steps where
configuration is loaded, when named enters exclusive mode, and when the
configuration is applied are all logged, and that they occur in the
correct order. This adds a guard/warning to keep the parsing of the
named.conf outside of the exclusive mode.
2025-06-23 10:45:31 -07:00
Colin Vidal
d7416bb472 ignore reload request if in a reload process
Ignore an 'rndc reload' or 'rndc reconfig' command if received by named
while the server is currently reloading itself.
2025-06-23 10:45:14 -07:00
Colin Vidal
d7de2ba084 parse user configuration before exclusive mode
The configuration file was parsed when named was in exclusive
(i.e. single-threaded) mode and unable to answer queries. Because
the parsing is a self-contained operation, it is now done before
named enters exclusive mode.

This reduces the amount of time named can't answer queries when
reloading the configuration when the configuration file is large.
Note that exclusive mode is still used for applying the
configuration changes to the server.

Also, simplify the configuration logic by parsing the built-in
configuration only once at server start time.
2025-06-23 10:35:31 -07:00
Colin Vidal
8685ebdb99 renamed named_g_config/defaults
For better clarity, the global variables named_g_config and
named_g_defaults have been changed to named_g_defaultconfig
and named_g_defaultoptions.
2025-06-23 10:35:17 -07:00
Aydın Mercan
3bb88f847a
Remove the configblock sphinx extension
The `configblock` extension doesn't work with RHEL 8. However, this
extension isn't needed anymore after the RTD fix and can be safely
removed.
2025-06-23 13:45:09 +03:00
Mark Andrews
c19956b3cb verify-axfr.db gets updated too fast in mirror test
Add a 1 second wait before updating verify-axfr.db so that the
modification time of the file changes.
2025-06-19 15:49:29 +00:00
Nicki Křížek
e786a2e950 Ignore softhsm2 errors when deleting token in keyfromlabel test
In some rare cases, the softhsm2 utility reports failure to delete the
token directory, despite the token being found. Subsequent attempts to
delete the token again indicate that the token was deleted.

Ignore this cleanup error, as it doesn't prevent our tests from working
properly. There is also an attempt to delete the token before the test
starts which ensures a clean state before the test is executed, in case
there's actually a leftover token.
2025-06-19 13:49:34 +00:00