Commit Graph

11348 Commits

Author SHA1 Message Date
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 Krizek
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ń
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ń
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ń
93b4b110a7 Refactor string matching loop for readability
(cherry picked from commit 831c5d34f9)
2024-01-15 17:14:06 +01:00
Tom Krizek
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
Artem Boldariev
a76e304f5e Add a system test to verify listener transport change functionality
This commit adds a system test that helps to verify that changing a
listener transport by editing "listen-on" statements before
reconfiguration works as expected.

(cherry picked from commit 211f12ff85)
2024-01-15 14:31:06 +02:00
Michał Kępień
77b611be7c Add reconfiguration support to NamedInstance
Reconfiguring named using RNDC is a common action in BIND 9 system
tests.  It involves sending the "reconfig" RNDC command to a named
instance and waiting until it is fully processed.  Add a reconfigure()
method to the NamedInstance class in order to simplify and standardize
named reconfiguration using RNDC in Python-based system tests.

TODO:

  - full reconfiguration support (w/templating *.in files)

  - add an "rndc null" before every reconfiguration to show which file
    is used (NamedInstance.add_mark_to_log() as it may be generically
    useful?)

(cherry picked from commit fdc45c70e8)
2024-01-13 11:31:51 +01:00
Michał Kępień
c56b8136a0 Clean up the "checkds" system test
The "checkds" system test contains a lot of duplicated code despite
carrying out the same set of actions for every tested scenario
(zone_check() → wait for logs to appear → keystate_check()).  Extract
the parts of the code shared between all tests into a new function,
test_checkds(), and use pytest's test parametrization capabilities to
pass distinct sets of test parameters to this new function, in an
attempt to cleanly separate the fixed parts of this system test from the
variable ones.  Replace format() calls with f-strings.

(cherry picked from commit aa31a872d0)
2024-01-13 11:31:51 +01:00
Michał Kępień
ab058db54c Drop use of dns.resolver.Resolver from "checkds"
The "checkds" system test only uses dns.resolver.Resolver objects to
access their 'nameservers' and 'port' attributes.  Instances of the
NamedInstance class also expose that information via their attributes,
so only pass NamedInstance objects around instead of needlessly
depending on dns.resolver.Resolver.

(cherry picked from commit cf338a7ca3)
2024-01-13 11:31:51 +01:00
Michał Kępień
2d297fc8b3 Use helper Python classes for watching log files
Make log file watching in Python-based system tests consistent by
employing the helper Python classes designed for that purpose.  Drop the
custom code currently used.

(cherry picked from commit 2c35b839a5)
2024-01-13 11:31:51 +01:00
Michał Kępień
b8b0686222 Add helper Python classes for watching log files
Waiting for a specific log line to appear in a named.run file is a
common action in BIND 9 system tests.  Implement a set of Python classes
which intend to simplify and standardize this task in Python-based
system tests.

Co-authored-by: Štěpán Balážik <stepan@isc.org>
(cherry picked from commit bf92f33f94)
2024-01-13 11:31:51 +01:00
Michał Kępień
4cba5c1a02 Simplify use of RNDC in Python-based tests
The "addzone" and "shutdown" system tests currently invoke rndc using
test-specific helper code.  Rework the relevant bits of those tests so
that they use the helper classes from bin/tests/system/isctest.py.

(cherry picked from commit 00003e497c)
2024-01-13 11:31:51 +01:00
Michał Kępień
4eadaca4b0 Implement Python helpers for using RNDC in tests
Controlling named instances using RNDC is a common action in BIND 9
system tests.  However, there is currently no standardized way of doing
that from Python-based system tests, which leads to code duplication.
Add a set of Python classes and pytest fixtures which intend to simplify
and standardize use of RNDC in Python-based system tests.

For now, RNDC commands are sent to servers by invoking the rndc binary.
However, a switch to a native Python module able to send RNDC commands
without executing external binaries is expected to happen soon.  Even
when that happens, though, having the capability to invoke the rndc
binary (in order to test it) will remain useful.  Define a common Python
interface that such "RNDC executors" should implement (RNDCExecutor), in
order to make switching between them convenient.

Co-authored-by: Štěpán Balážik <stepan@isc.org>
(cherry picked from commit c38c29e84d)
2024-01-13 11:31:51 +01:00
Mark Andrews
2268ee2955 Update expected DNSKEY TTL to match dnssec-policy
csk.kasp and csk-nosep.kasp use the default policy which has a 3600
second dnskey-ttl.
2024-01-12 19:56:54 +11:00
Mark Andrews
e5bfe1e540 Set the DNSKEY TTLs to match the dnssec policy
This prevents the DNSKEY records being updated and the statistics
not matching as a consequence

(cherry picked from commit 882b1a4449)
2024-01-12 19:56:19 +11:00
Mark Andrews
e30652e33a Make $TTL match dnskey-ttl
(cherry picked from commit 16a720357b)
2024-01-12 19:56:19 +11:00
Matthijs Mekking
2a6ee4a9a0 Write new DNSKEY TTL to key file
When the current DNSKEY TTL does not match the one from the policy,
write the new TTL to disk.

(cherry picked from commit b770740b44)
2024-01-12 19:56:19 +11:00
Mark Andrews
9cab1eafee Test dnssec-policy dnskey-ttl behaviour
If the dnskey-ttl in the dnssec-policy doesn't match the DNSKEY's
ttl then the DNSKEY, CDNSKEY and CDS rrset should be updated by
named to reflect the expressed policy.  Check that named does this
by creating a zone with a TTL that does not match the policy's TTL
and check that it is correctly updated.

(cherry picked from commit f894bf661f)
2024-01-12 19:56:19 +11:00
Aram Sargsyan
086f569f52 Print a dig comment about the failed query consistently
Dig failed to print a comment about the reason of the unacceptable
query reply got from a server when there was no other query to
start in the lookup's chain.

Add an "else" block to print out the comment even when not starting
up the next query.

(cherry picked from commit 913b20abf8)
2024-01-11 10:30:40 +00:00
Aram Sargsyan
11e85d15f9 Fix a possible dig/host crash in "NS search" mode
When getting a SERVFAIL reply from a query, 'host' tries to start
the next query in the lookup's list (also true for 'dig  +nofail').
However, when running with the '-C' switch (or +nssearch for 'dig'),
all the queries in the lookup start from the beginning, so that logic
brings to a crash because of the attempted start of the query which
was already started.

Don't start the next query in the affected code path when in +nssearch
mode.

(cherry picked from commit f6658b333e)
2024-01-11 10:28:22 +00:00
Tom Krizek
7dff007ccd Allow nsupdate test rerun on FreeBSD
The "exceeded time limit waiting for literal 'too many DNS UPDATEs
queued' in ns1/named.run" is prone to fail due to a timing issue.
Despite out efforts to stabilize it, the check still often fails on
FreeBSD in our CI. Allow the test to be re-run on this platform.

(cherry picked from commit 124882476b)
2024-01-10 14:52:40 +01:00
Tom Krizek
7132f6b998 Allow statistics test rerun
This test has been unstable for a long while, especially the check
"statistics:verifying active sockets output in named.stats". Allow the
statistics test to be re-run to avoid frequent false positives.
2024-01-10 11:02:55 +01:00
Aram Sargsyan
cdb16a737e Make digdelv test work in different network envs (continued)
This commit complements the 1e7d832342
commit.

(cherry picked from commit 96f63a9f0b)
2024-01-09 14:53:21 +00:00
Tom Krizek
339143e3fc Handle dig timing out gracefully in upforwd
(cherry picked from commit 7b77574b6d)
2024-01-09 10:17:49 +01:00
Tom Krizek
a1b67ff038 Handle dig timing out gracefully in staticstub
(cherry picked from commit cc7c4760aa)
2024-01-09 10:17:49 +01:00
Tom Krizek
d061e2d6ba Handle dig timing out gracefully in sortlist
(cherry picked from commit 2341934f7d)
2024-01-09 10:17:48 +01:00
Tom Krizek
b690a44e55 Handle dig timing out gracefully in rpz
(cherry picked from commit 99799fba60)
2024-01-09 10:17:48 +01:00
Tom Krizek
b51c74f0bb Handle dig timing out gracefully in rootkeysentinel
(cherry picked from commit de569ad97a)
2024-01-09 10:17:48 +01:00
Tom Krizek
9a803cc227 Handle dig timing out gracefully in qmin
(cherry picked from commit 606985d775)
2024-01-09 10:17:48 +01:00