Commit Graph
11372 Commits
Author SHA1 Message Date
Michal Nowak 481989cfa9 Rewrite rrchecker system test to pytest
(cherry picked from commit 6a301c1d35)
2024-03-15 10:07:27 +01:00
Matthijs Mekking a621e035d4 Detect invalid durations
Be stricter in durations that are accepted. Basically we accept ISO 8601
formats, but fail to detect garbage after the integers in such strings.

For example, 'P7.5D' will be treated as 7 days. Pass 'endptr' to
'strtoll' and check if the endptr is at the correct suffix.

(cherry picked from commit e39de45adc)
2024-03-14 11:40:43 +01:00
Mark Andrews 6d43b3011e Check static-stub synthesised NS is not returned
(cherry picked from commit 229bf863e2)
2024-03-14 15:33:25 +11:00
Matthijs Mekking 464950214c Test secure chain that includes inactive KSK
Add a regression test case for the scenario where a secure chain of
trust includes an inactive KSK, that is a KSK that is not signing the
DNSKEY RRset.

(cherry picked from commit f0bfd276e0)
2024-03-12 09:35:46 +01:00
Ondřej Surý 231b2375e5 Create a second pruning task for rbtdb with unlimited quantum
Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.
2024-03-06 17:11:14 +01:00
Evan Hunt 046b62bf02 move RRL broken-config check to checkconf
the RRL test included a test case that tried to start named with
a broken configuration.  the same error could be found with
named-checkconf, so it should have been tested in the checkconf
system test.

(cherry picked from commit 05398c1488)
2024-03-01 15:59:38 -08:00
Mark Andrews 111abe9940 Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4)
2024-02-28 11:38:18 +11:00
Aydın Mercan abc47f5ce4 Expose the TCP client count in statistics channel
The statistics channel does not expose the current number of TCP clients
connected, only the highwater. Therefore, users did not have an easy
means to collect statistics about TCP clients served over time. This
information could only be measured as a seperate mechanism via rndc by
looking at the TCP quota filled.

In order to expose the exact current count of connected TCP clients
(tracked by the "tcp-clients" quota) as a statistics counter, an
extra, dedicated Network Manager callback would need to be
implemented for that purpose (a counterpart of ns__client_tcpconn()
that would be run when a TCP connection is torn down), which is
inefficient. Instead, track the number of currently-connected TCP
clients separately for IPv4 and IPv6, as Network Manager statistics.

(cherry picked from commit 2690dc48d3)
2024-02-27 11:04:28 +03:00
Michal Nowak 195b892bde Watch logs from start in dialup system test
When the first parametrized test takes a bit longer than usual, the zone
transfer in ns3 may succeed before the second parametrized test is even
started, and then watch_log_from_here() won't find the "Transfer status:
success" message in the named log. Using watch_log_from_start() instead
makes sure the test is more stable.

(cherry picked from commit 283a7ab17d)
2024-02-26 12:11:07 +01:00
Mark Andrews 2e224d46d2 Add RESINFO record type
This is a TXT clone using code point 261.

(cherry picked from commit 0651063658)
2024-02-26 13:20:48 +11:00
Michal Nowak 05416a52b8 Rewrite dsdigest system test to pytest
(cherry picked from commit cfb68bda79)
2024-02-23 14:19:22 +01:00
Michal Nowak f4f7827cf9 Add isctest.check.servfail()
(cherry picked from commit 5830ac831f)
2024-02-23 14:19:18 +01:00
Michal Nowak 07bd58d836 Rewrite xferquota system test to pytest
(cherry picked from commit 69bf4432cc)
2024-02-23 11:49:47 +01:00
Michal Nowak b54455e43e Add isctest.check.rrsets_equal function
(cherry picked from commit 1e52a11343)
2024-02-23 11:49:43 +01:00
Michal Nowak 474eb35d59 Add retry_with_timeout() utility function
(cherry picked from commit 5694c52f52)
2024-02-23 11:49:38 +01:00
Michal Nowak eeaf17f5d4 Add RegEx support to wait_for_line() and wait_for_lines()
(cherry picked from commit 6dd1b3ab38)
2024-02-23 11:49:34 +01:00
Michal Nowak 0e92b14cce Make pytest a bit more verbose
The "-vv" option gives us full untruncated diffs of compared data
strustures.

(cherry picked from commit bcbe34e22d)
2024-02-23 10:59:09 +01:00
Michal Nowak b7bc0e8117 Rewrite sortlist system test to pytest
(cherry picked from commit e7b5cf7f79)
2024-02-23 10:59:05 +01:00
Michal Nowak 16f950e86b Support "source" parameter in isctest.query.(tcp|udp)
(cherry picked from commit 4a203dcb93)
2024-02-23 10:59:01 +01:00
Tom Krizek b27ac8d1bd Don't include temp testdir on each log line
This was mostly an artifact to tell which log lines belong to which test
from the time when the test output could be all mingled together. Now
this info is reduntant, because the pytest logger already includes both
the system test name, and the specific test.

(cherry picked from commit 8058140b67)
2024-02-16 16:03:53 +01:00
Tom Krizek 51bd0f2949 Add utility logging functions to isctest.log
Unify the different loggers (conftest, module, test) into a single
interface. Remove the need to select the proper logger by automatically
selecting the most-specific logger currently available.

This also removes the need to use the logger/mlogger fixtures manually
and pass these around. This was especially annoying and unwieldy when
splitting the test cases into functions, because logger had to always be
passed around. Instead, it is now possible to use the
isctest.log.(debug,info,warning,error) functions.

(cherry picked from commit c60975f108)
2024-02-16 16:03:50 +01:00
Tom Krizek 7a1869c23f Move watchlog module into isctest.log package
Preparation for further logging improvements - keep the watchlog
contents in a separate module inside isctest.log. Export the names in
the log package so the imports don't change for the users of these
classes.

(cherry picked from commit 52f9e6f557)
2024-02-16 16:01:09 +01:00
Tom Krizek 1f987a6c49 Remove accidentally duplicated RNDCExecutor code
This code has probably been accidentally added during some rebase. The
actual RNDCExecutor and related classes are in isctest/rndc.py. Remove
the duplicated and unused code from isctest/log.py, as it doesn't belong
there.

(cherry picked from commit f8fa528cdd)
2024-02-16 16:01:07 +01:00
Michal Nowak 60c5f6f972 Accommodate black 24.2.0
(cherry picked from commit 70163a8b3f)
2024-02-14 15:45:17 +01:00
Ondřej Surý 14e435b814 Add a system test for mixed-case data for the same owner
We were missing a test where a single owner name would have multiple
types with a different case.  The generated RRSIGs and NSEC records will
then have different case than the signed records and message parser have
to cope with that and treat everything as the same owner.
2024-02-11 09:39:19 +01:00
Tom Krizek 6af67e028e Support older junit XML format in test result processing
When running `make check` on a platform which has older (but still
supported) pytest, e.g. 3.4.2 on EL8, the junit to trs conversion would
fail because the junit format has different structure. Make the junit
XML processing more lenient to support both the older and newer junit
XML formats.

(cherry picked from commit bec3dd10b3)
2024-02-08 14:58:11 +01:00
Tom Krizek 26356ea078 Use a single local port for ditch.pl
The ditch.pl script is used to generate burst traffic without waiting
for the responses. When running other tests in parallel, this can result
in a ephemeral port clash, since the ditch.pl process closes the socket
immediately. In rare occasions when the message ID also clashes with
other tests' queries, it might result in an UnexpectedSource error from
dnspython.

Use a dedicated port EXTRAPORT8 which is reserved for each test as a
source port for the burst traffic.

(cherry picked from commit 339fa5690a)
2024-02-08 13:43:02 +01:00
Ondřej Surý d43a955d0c Optimize cname_and_other_data to stop as earliest as possible
Stop the cname_and_other_data processing if we already know that the
result is true.  Also, we know that CNAME will be placed in the priority
headers, so we can stop looking for CNAME if we haven't found CNAME and
we are past the priority headers.

(cherry picked from commit 3f774c2a8a)
2024-02-08 08:48:09 +01:00
Tom KrizekandMark Andrews 1b6c96a8ed Re-enable rndc shutdown test
The issue preventing a proper rndc shutdown was recently fixed and
the test now passes.

(cherry picked from commit fb70c4d475)
2024-02-07 12:09:03 +11:00
Mark Andrews 84078b96c0 Capture the resolver's startup and shutdown logging
Also set the debugging to 99.

(cherry picked from commit 3651c58a6a)
2024-02-07 12:09:02 +11:00
Matthijs Mekking f58bf29cad Put reference to RFC 2845 in tsig-keygen man page
(cherry picked from commit 8a8c573be6)
2024-02-01 12:03:42 +01:00
Matthijs Mekking b94bb41e59 dnssec-keygen man page still says it can do TSIG
Remove text in man page that says the program can also be used for
generate TSIG keys, this was removed in 9.13.0 but this text was still
not yet removed.

(cherry picked from commit aabb452953)
2024-02-01 12:03:36 +01:00
Michal Nowak 816d26eb0d Rewrite dialup system test to pytest
(cherry picked from commit bc4c29888b)
2024-01-24 13:48:10 +01:00
Michal Nowak 03155da31e Speed up test by lowering "heartbeat-interval" to 1
(cherry picked from commit 6c6580ea83)
2024-01-24 13:48:10 +01:00
Tom Krizek e5403f39c1 Delete unused config file in dnssec system test
(cherry picked from commit f69df830c6)
2024-01-19 15:24:08 +01:00
Tom Krizek d9fd971231 Ensure tests use mock root server if configured
These tests have ns1 configured as a mock root server. Make sure it is
used in all config files of those tests, otherwise some queries could
leak to root nameservers.

(cherry picked from commit 088fcf9a61)
2024-01-19 15:24:07 +01:00
Tom Krizek 1997c36ce4 Blackhole queries to root servers in tests
Some tests don't have a mock root server configured, because they don't
need one. However, these tests might still leak queries to actual name
servers. Add a shared root hints file which can serve as a blackhole for
these queries.

(cherry picked from commit 8434e5abfc)
2024-01-19 15:24:07 +01:00
Tom Krizek b025e8dd2d Don't use root server in addzone test
(cherry picked from commit 7037eb96d4)
2024-01-19 15:24:05 +01:00
Michal Nowak b1fc4f7dee Drop queryperf support from rpz system test
The queryperf support in the rpz system test is not utilized in the CI,
is likely not unused at all, and should be dropped.

(cherry picked from commit eaab796310)
2024-01-19 12:08:23 +01:00
Tom Krizek 575728dee8 Remove extraneous dnsrps-secondary.conf from rpz tests
The contents of the dnsrps-secondary.conf file are identical to the
contents of dnsrps.conf. Remove it since it's redundant.
2024-01-18 17:05:11 +01:00
Tom Krizek cd6c9590f1 Remove obsolete ckdnsrps.sh script
As dnsrps and native test cases have been properly split up, the
ckdnsrps.sh script is no longer used anywhere, as the logic for
selecting these test cases is handled by pytest.

(cherry picked from commit b1d71c4d26)
2024-01-18 17:05:10 +01:00
Tom Krizek bb5b41ad95 Split up the dnsrps and native variants of rpz system tests
Previously, dnsrps test was executed as an optional part of the rpz and
rpzrecurse system tests. This was conceptually problematic, as the test
took the responsibility of running parts of the test framework -
cleaning files and setting up servers again.

Instead, allow these tests to execute either the native variant, or the
dnsrps one. To ensure the same test coverage, trigger both of these
variants as separate test cases from pytest.

(cherry picked from commit cb55fb2cae)
2024-01-18 17:05:09 +01:00
Tom Krizek a1af755a14 Allow the fetchlimit test to be re-run
The test is known to be unstable due to timing issues. Prevent frequent
false positives by allowing the test to be re-run by the flaky pytest
plugin.

(cherry picked from commit 10827fe96c)
2024-01-17 16:36:03 +01:00
Tom Krizek 4679bfe604 Don't type-check the flaky plugin with mypy
Since we execute mypy for bin/tests/system/isctest package, this is now
needed because the flaky package doesn't have type hints.

(cherry picked from commit a65b654a23)
2024-01-17 16:36:03 +01:00
Tom Krizek af12ce03f3 Move custom pytest markers into isctest module
Keep our pytest code more organized by moving the shared code for custom
pytest markers into a dedicated isctest/mark.py module.

(cherry picked from commit f314f1b432)
2024-01-17 16:36:03 +01:00
Michal Nowak dfe31f7395 Rewrite spf system test to pytest
(cherry picked from commit e67d770432)
2024-01-15 17:14:06 +01:00
Michał KępieńandMichal Nowak 24fd30f7eb Add wait_for_zones_loaded fixture
The wait_for_zones_loaded fixture waits for the "all zones loaded"
message in the named log file before the test function can proceed.

(cherry picked from commit 662a88055c)
2024-01-15 17:14:06 +01:00
Michał KępieńandMichal Nowak b09835a5d1 Ensure wait_for_line() is not called with timeout=0
(cherry picked from commit 1770b37095)
2024-01-15 17:14:06 +01:00
Michał KępieńandMichal Nowak 93b4b110a7 Refactor string matching loop for readability
(cherry picked from commit 831c5d34f9)
2024-01-15 17:14:06 +01:00
Tom KrizekandMichal Nowak f45e777b9f Add LogFile helper
LogFile class contains a log path and has means to find a string in the
log file.

(cherry picked from commit 05b0ebac0f)
2024-01-15 17:14:06 +01:00