Commit graph

5737 commits

Author SHA1 Message Date
Michal Nowak
d03b3f5a1d
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.
2026-01-15 13:03:19 +01:00
Štěpán Balážik
46ecbbed0a Use isctest.asyncserver in the "ixfr" system test
Replace the usage of the `bin/tests/system/ans.pl` server with an
instance of ControllableAsyncServer.
2026-01-14 12:29:59 +01:00
Štěpán Balážik
2302fe1235 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.
2026-01-14 12:29:59 +01:00
Štěpán Balážik
7e587201a4 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.
2026-01-14 12:29:59 +01:00
Aram Sargsyan
4e9d97b4f7 Test that catalog zones' entry names are case-insensitive 2026-01-12 12:58:57 +00:00
Aram Sargsyan
6d0e6454ac 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.
2026-01-12 12:58:57 +00:00
Nicki Křížek
9b63187a99 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.
2026-01-12 11:09:14 +01:00
Nicki Křížek
6c69abf783 Add dnspython>=2.0.0 requirement for digdelv
Now that the test uses AsyncDnsServer, require the appropriate dnspython
version for the test.
2026-01-12 11:08:31 +01:00
Nicki Křížek
0b7a089c7f 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.
2026-01-12 11:08:26 +01:00
Nicki Křížek
575f0e3916 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.
2026-01-12 11:08:26 +01:00
Nicki Křížek
20887ff80f Rename ResponseDropAndCloseConnection action
The action can be used to close the connection even after some response
was sent, depending on the ordering of actions in the handler that uses
it. Rename it to CloseConnection to use a more fitting name.
2026-01-12 11:08:26 +01:00
Nicki Křížek
c50a7d2de1 Replace digdelv/ans7 with AsyncDnsServer
ans7 server always replies with an UPDATE opcode in the message.
2026-01-12 11:08:22 +01:00
Nicki Křížek
648f2534b1 Replace digdelv/ans4 with AsyncDnsServer
Configure the AsyncDnsServer to ignore all queries to ensure the same
behaviour as with "//" command for ans.pl.
2026-01-12 11:05:48 +01:00
Nicki Křížek
3a6b977a92 Remove unused digdelv/ans6 server
This server receives no queries during the test and doesn't affect the
test outcome.
2026-01-12 11:05:48 +01:00
Štěpán Balážik
1fc206556b Avoid sending manually created responses in asyncserver
If at all possible, all the responses should be created by
AsyncDnsServer's internal methods. To ensure this, mark them with a
magic attribute and check it on send and crash the server if a manually
created response is detected.

Fix the qmin test server which uses `make_response`.
2026-01-09 14:22:16 +00:00
Colin Vidal
588de09145 add strict bound check tests
Add checkconf system test covering the strict boundary checks for
`edns-version`, `edns-udp-size`, `max-udp-size`, `no-cookie-udp-size`
and `padding`.
2026-01-07 07:01:59 +00:00
Michal Nowak
b4c0408d81
Add ans10 blackhole server to xfer system test
On FreeBSD 15.0, sending requests to non-existent address produces
unexpected results. Add a blackhole server instead.
2026-01-06 21:17:48 +01:00
Nicki Křížek
0ddfa108a7 Test zone with truncated revoked DNSKEY
Ensure that named can handle a situation where the zone is signed with a
truncated, self-signed revoked DNSKEY. The signatures are inevitably
bogus and a SERVFAIL is expected. However, prior to CVE-2025-8677 fix,
this could trigger an assertion failure.
2026-01-05 14:04:58 +01:00
Nicki Křížek
1a2e46d364 Test that DNSSEC validation is aborted on malformed DNSKEY
Create a signed zone file that contains malformed ZSKs with colliding
key tags. The ZSKs don't represent valid ECDSA keys and will cause a
crypto failure when attempting to use them. Sign the zone with KSK, with
the exception of one record which is "signed" with the invalid ZSKs.

Check that the resolver aborts the DNSSEC verification after
encountering the first crypto failure, indicating malformed DNSKEY.
2026-01-05 14:04:58 +01:00
Štěpán Balážik
dc58c73264 Set default_aa on AsyncDnsServer to False by default
In 6e684d44 I mistakenly set the default for `default_aa` for
`AsyncDnsServer()` to `True` and then explicitly set it to True in
cases where all the `ResponseHandlers` said
`yield DnsResponseSend(..., authoritative=True)` as if the default was
`False`.

Also the rest of `AsyncDnsServer` code (namely `_prepare_responses`)
reads like `default_aa` is `False` by default.

This accidentally changed the behavior of servers which don't set the
`default_aa` and where AA is not set from the zone data
(e.g. `dispatch/ans3`).
2026-01-05 13:27:57 +01:00
Matthijs Mekking
22c02a4df9 Wait for "sending notifies" for step3.zsk-prepub
Commit c17ac42608 changed some tests to
wait for "zone_needdump" messages instead of "sending notifies", because
notifies are rate limited and "zone_needdump" happen on every change.

However, inspecting the logs, the "zone_needdump" changes happen more
than once (likely because the re-signing is done in batches):

    received control channel command 'sign step3.zsk-prepub.manual'
    zone_journal: zone step3.zsk-prepub.manual/IN (signed): enter
    zone_needdump: zone step3.zsk-prepub.manual/IN (signed): enter
    zone_journal: zone step3.zsk-prepub.manual/IN (signed): enter
    zone_needdump: zone step3.zsk-prepub.manual/IN (signed): enter
    zone_journal: zone step3.zsk-prepub.manual/IN (signed): enter
    zone_needdump: zone step3.zsk-prepub.manual/IN (signed): enter
    zone step3.zsk-prepub.manual/IN (signed): sending notifies

This means we are running the rollover step checks too fast in some
test runs.

Revert the wait for log change for the rollover-zsk-prepub test.
2025-12-31 11:40:42 +01:00
Matthijs Mekking
52c940551d Change notify-cds option to notify-cfg CDS
Change the notify configuration to be more flexible for other types
of generalized DNS notifications.

Also allow for notify-cfg SOA.
2025-12-29 10:06:16 +01:00
Petr Špaček
e223ee7097
Test that spoofed DNAME is not accepted via spoofable transport
A single spoofed DNAME answer can impact many names, and because of the
nature of DNAME, the attacker can use randomized query names to get
unlimited number of tries to spoof the answer.  To limit impact, we
should not be accepting DNAME over insecure transport, like UDP without
cookies etc.

In short, the attacker tries to spoof at least one answer that has the
following form:

    opcode QUERY
    rcode NOERROR
    flags QR AA
    ;QUESTION
    trigger$RANDOM.test. IN A
    ;ANSWER
    trigger$RANDOM.test. 3600 IN CNAME trigger$RANDOM.attacker.net.
    test. 3600 IN DNAME attacker.net.
    ;AUTHORITY
    ;ADDITIONAL

This has been discovered internally.

Co-authored-by: Michał Kępień <michal@isc.org>
2025-12-22 11:58:39 +01:00
Petr Špaček
b5dc46fe6e
Test that fake child delegation cannot overwrite parent's glue RR
In short, the attacker tries to spoof at least one answer that has the
following form:

    rcode NOERROR
    flags QR
    ;QUESTION
    trigger$RANDOM.victim. IN TXT
    ;ANSWER
    ;AUTHORITY
    trigger$RANDOM.victim. 3600 IN NS ns.victim.
    ;ADDITIONAL
    ns.victim. 3600 IN A 10.53.0.3

This attack was originally reported as "test case 2".

Co-authored-by: Michał Kępień <michal@isc.org>
2025-12-22 11:58:39 +01:00
Petr Špaček
658d2e9f8e
Test that unsolicited NS in positive answer cannot overwrite current NS
Before the fixes for CVE-2025-40778, an unsolicited in-bailiwick NS
record was accepted from a (spoofed) answer, enabling a single spoofed A
query/response to redirect traffic for a whole delegation.

In short, the attacker tries to spoof at least one answer that has the
following form:

    rcode NOERROR
    flags QR AA
    ;QUESTION
    trigger$RANDOM.victim. IN TXT
    ;ANSWER
    trigger$RANDOM.victim. 3600 IN TXT "spoofed answer with extra NS"
    ;AUTHORITY
    victim. 3600 IN NS ns.attacker.
    ;ADDITIONAL

This attack was originally reported as "test case 1".

Co-authored-by: Michał Kępień <michal@isc.org>
2025-12-22 11:58:39 +01:00
Petr Špaček
26eed16d61
Test that positive answer cannot overwrite sibling NS RRs
Before the fixes for CVE-2025-40778, a positive answer was allowed to
overwrite sibling NS RRs.  The answer had to be a positive AA=1 answer
with a fake NS along with it.  This combination of conditions avoided
the code path with "unrelated <RRTYPE>" detection logic.

If it were some other answer, named from the main branch would detect
the attempt and log:

    DNS format error from 10.53.0.1#16386 resolving trigger/A for <unknown>: unrelated NS victim in trigger authority section

In short, the attacker tries to spoof at least one answer that has the
following form:

    opcode QUERY
    rcode NOERROR
    flags QR AA
    ;QUESTION
    trigger$RANDOM. IN A
    ;ANSWER
    trigger$RANDOM. 3600 IN A 10.53.0.3
    ;AUTHORITY
    victim. 3600 IN NS ns.attacker.
    ;ADDITIONAL
    ns.attacker. 3600 IN A 10.53.0.3

This attack was originally reported as "test case 1c".

Co-authored-by: Michał Kępień <michal@isc.org>
2025-12-22 11:58:39 +01:00
Petr Špaček
607974b1bc
Add a common base for CVE-2025-40778 tests
Add the zone files, configuration, and code that will be reused by all
tests related to CVE-2025-40778.

Co-authored-by: Michał Kępień <michal@isc.org>
2025-12-22 11:58:39 +01:00
Michał Kępień
440e510f75
Add a reusable, bare-bones AsyncDnsServer
Add bin/tests/system/ans.py, a bare-bones DNS server that can be used in
system tests instead of full-blown named instances when a server is only
required to return zone-based data.  Where applicable, this reduces load
on the test host and the amount of generated logs.
2025-12-22 11:58:39 +01:00
Matthijs Mekking
f6749a432b Add isctest.kasp.SettimeOptions
This Class sets settime parameters and these can be called with key.settime()
that runs dnssec-settime on the given key with the given parameters.
2025-12-22 09:04:46 +00:00
Michał Kępień
1acde358ea
Prevent garbage-collecting ignored TCP connections
Due to the way various asyncio-related objects (tasks, streams,
transports, selectors) are referencing each other, pausing reads for a
TCP transport (which in practice means removing the client socket from
the set of descriptors monitored by a selector) can cause the client
task (AsyncDnsServer._handle_tcp()) to be prematurely garbage-collected,
causing asyncio code to raise a "Task was destroyed but it is pending!"
exception.  Who knew that solutions as elegant as the one introduced by
e407888507 could cause unexpected trouble?

Fix by making a horrible hack even more horrible, specifically by
keeping a reference to each incoming TCP connection to protect its
related asyncio objects from getting garbage-collected.  This prevents
AsyncDnsServer from closing any of the ignored TCP connections
indefinitely, which is obviously a pretty brain-dead idea for a
production-grade DNS server, but AsyncDnsServer was never meant to be
one and this hack reliably solves the problem at hand.

Only apply this change for the IgnoreAllConnections handler as the
ConnectionReset handler triggers a connection reset immediately after
pausing reads for an incoming TCP connection.

As pointed out in e407888507, the proper
solution would require implementing a custom asyncio transport from
scratch and that is still deemed to be too much work for the purpose at
hand.  Let's see how much longer we can limp along with the existing
approach.
2025-12-21 06:25:56 +01:00
Michał Kępień
0ec94e501a
Make exception/signal handlers idempotent
Calling asyncio.Future.set_exception() or asyncio.Future.set_result()
more than once for a given Future object raises an
asyncio.InvalidStateError exception.

In the case of AsyncServer:

  - it is enough to capture the first exception raised by higher-level
    logic as no exceptions at all are expected to be raised in the first
    place,

  - no distinction is made between SIGINT and SIGTERM; the only purpose
    of the signal handler is to make the server exit cleanly.

Given the above, make both AsyncServer._handle_exception() and
AsyncServer._signal_done() idempotent by ignoring
asyncio.InvalidStateError exceptions raised by the relevant
asyncio.Future.set_*() calls.
2025-12-21 06:25:56 +01:00
Matthijs Mekking
3679bd4888 Update optout test to reconfig to NSEC
If we change from NSEC3 to NSEC we should not produce a zone with
missing NSEC records.

The code only considered having seen a record if there was previously
a signature present at the owner name. However with opt-out, insecure
delegations don't have a RRSIG record. Reconfiguring to NSEC causes
all insecure delegations to have a missing NSEC record.

Add a DNAME record to the test zone to also cover DNAME delegations.
2025-12-19 16:55:18 +01:00
Michal Nowak
9e7b5a4ad4 Revert "Add ans6 blackhole server to notify system test"
This reverts commit 21295bc188.

In a sense, the ans6 black holeserver, based on asyncserver, "does
nothing". In our case, it won't respond to any query, and if the
IgnoreAllConnections connection handler was installed, it would not read
anything from the client socket.

Previously, sending notifications to an unconfigured address resulted in
no communication from the target (10.53.10.53); hence, the ns3
configuration comment requested a "non-responsive notify recipient (no
reply, no ICMP errors)".

However, examining the PCAP of ans6 reveals some communication from the
10.53.0.6 server to the 10.53.0.3 client, including ICMP Destination
Unreachable (Port Unreachable), and TCP SYN/ACK.

The ans6 communication seems to be sufficiently different to touch
different code paths in named, resulting in the BIND 9.20 backport
failing in the "checking notify retries expire within 30 seconds" test.
But we better revert it from "main" as well.
2025-12-19 16:15:32 +01:00
Matthijs Mekking
e69eb0528a Test invalid DSYNC RRset is rejected
The RFC says There MUST NOT be more than one DSYNC record for each
combination of RRtype and Scheme. If we encounter more we should drop
the response, as the DSYNC RRset is invalid.
2025-12-19 15:01:49 +01:00
Matthijs Mekking
35a7024e8c Test sending NOTIFY(CDS) messages during rollover
When doing rollover and the CDS/CDNSKEY RRset is updated, test that a
NOTIFY(CDS) message is sent. For other steps in the rollover, prohibit
any dsyncfetch activity.
2025-12-19 15:01:36 +01:00
Matthijs Mekking
e344fe18bc Test sending NOTIFY(CDS) messages
When starting up the services, send notifies for the existing CDS RRset.
This requires setting up a chain of trust for the test, so the DSYNC
records can be retrieved and validated.

This feature requires enabling 'notify-cds' and 'dnssec-validation'.

In this test, the scanner is pointed to ns2. Since there is no code
for receiving NOTIFY(CDS) messages for delegations, this is treated
as "not authoritative". Checking for this log message ensures us that
the NOTIFY(CDS) message was actually sent.
2025-12-19 15:01:36 +01:00
Matthijs Mekking
9fa0493a94 Adjust tests to new notify logs
Now that we log the type of the notify, some expected log messages
in the system tests need to be adjusted accordingly.

The bin/tests/system/nsec3/tests_nsec3_retransfer.py log is changed
to zone_needdump because it is more reliable.  Other tests were
adjusted similar in MR !11265, but !11226 introduced a new
"sending notify" log line.
2025-12-19 14:08:15 +01:00
Matthijs Mekking
6554a5f9f7 Add new 'notify-cds' configuration option
Add a new configuration option to enable/disable sending NOTIFY(CDS)
messages.
2025-12-19 14:08:15 +01:00
Matthijs Mekking
594ff0816a Drop and replace CmdHelper with EnvCmd
A generic helper that calls environment-specified binaries has been added,
drop and replace the introduced CmdHelper for the more generic method.
2025-12-19 11:49:00 +01:00
Matthijs Mekking
e172b4ff1a rollover-zsk-prepub: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
da04c75cec rollover-straight2none: From setup.sh to pytest bootstrap
Similar to rollover-going-insecure.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
0016791c91 rollover-lifetime: Update templates
This test does not require a trust chain. Merely update the template
zone files to not point to the common template.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
b6c091d113 rollover-multisigner: Update templates
This test does not require a trust chain. However, it does have a setup
script. Rewrite the setup shell script to a pytest bootstrap method.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
4ed35f02b1 rollover-ksk-3crowd: From setup.sh to pytest bootstrap
Similar to rollover-ksk-doubleksk.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
08236f4bd6 rollover-ksk-doubleksk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
cc4244f384 rollover-going-insecure: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.

Now we have to fake different lifetimes, so adjust fake_lifetime
to update a single key.

Note that we have changed the setup slightly: We also sign the
step2 zones, but with post validation disabled. This is more
accurate because we need to test that the public keys and signatures
are being removed from the zone.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
ef2a824df6 rollover-enable-dnssec: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM_NUMBER@ in ns3/kasp.conf.j2 to
13 and rename to ns3/kasp.conf.

This test introduces an unsigned delegation, adjust render_and_sign_zone
and configure_tld accordingly.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
281f71be60 rollover-dynamic2inline: Update templates
This test does not require a trust chain. Merely update the template
zonefile to not point to the common template.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
ef7d617e3f rollover-csk-roll2: From setup.sh to pytest bootstrap
Similar to rollover-csk-roll1.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
1635bcf1ef rollover-csk-roll1: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/kasp.conf.j2 to
ecdsa256 and rename to ns3/kasp.conf.

Write a python method to set the key predecessor/successor relationship
into the key state files.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
72d3551355 rollover-algo-ksk-zsk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

The RSASHA256 keys are generated with dnssec-keygen, without a policy
provided. Thus we have to fake the lifetime for these keys.

Signing has to be done without the -z option, because the KSK should
not sign all records in case of a KSK/ZSK split. Update the signing
code to allow for extra options when signing with CSK only.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
3a6ed195fa rollover-algo-csk: From setup.sh to pytest bootstrap
Symlink ns1 and ns2 to rollover/ns1 and rollover/ns2.
Symlink ns3/template.db.j2.manual to rollover/ns3/template.db.j2.manual.

Since the bootstrapping is done before the templates are rendered
automatically, replace @DEFAULT_ALGORITHM@ in ns3/csk2.conf.j2 to
ecdsa256 and rename to ns3/csk2.conf.
2025-12-19 11:47:50 +01:00
Matthijs Mekking
f31514e658 rollover: From setup.sh to pytest bootstrap
Introduce rollover/setup.py for all setup related test code.

Introduce rollover/ns1 and rollover/ns2 to create a chain of trust to
all rollover related test zones. The tld zones in rollover/ns2 contain
a DSYNC record that at a later time will be used for testing Generalized
DNS Notifications.

Write a python version of private_type_record so we can put such
records in the zone via jinja2 templating.
2025-12-19 11:47:49 +01:00
Matthijs Mekking
e620b29e35 Move ns6 to ns3 in rollover tests
There is no difference, so we are going to make it consistent. This will
make it easier to add a chain of trust for these zones (to be done in
a future commit).
2025-12-19 11:41:07 +01:00
Michal Nowak
21295bc188
Add ans6 blackhole server to notify system test 2025-12-18 15:27:17 +01:00
Štěpán Balážik
db212153d9 Use new AsyncDnsServer features in xfer system test
Use `prepare_new_response()`, `default_aa` and `default_rcode`.
2025-12-18 13:13:59 +01:00
Štěpán Balážik
f5f84a649b Use new AsyncDnsServer features in cookie system test
Take advantage of `default_aa`, `default_rcode` and `keyring` arguments.
2025-12-18 13:13:59 +01:00
Štěpán Balážik
5384998ccd Allow ResponseHandlers to roll back changes made to a response
Previously, this was only possible by making a new response by calling
make_response on qctx.query. This however ignored the `default_aa` and
`default_rcode` parameters of AsyncDnsServer.

Add prepare_new_response and save_initialized_response methods to
QueryContext.
2025-12-18 13:13:59 +01:00
Štěpán Balážik
de266fff4c Add TSIG keyring support to AsyncDnsServer
Previously, ResponseHandlers had to reparse the queries themselves if
they wanted to use TSIG. This led to `default_aa` and `default_rcode`
information being lost from the newly created messages.

Add support for TSIG keyrings to the AsyncDnsServer class directly.
2025-12-18 13:13:59 +01:00
Štěpán Balážik
8c2a72143c Remove dnspython<2.0.0 compatibility hacks from custom servers
isctest.asyncserver requires dnspython 2+ now.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
5761de5531 Import dnspython modules explicitly in custom servers
Previously, the server relied on the modules being imported by the
isctest.asyncserver module. This is fragile and confuses tooling.

Clean up stray imports in the process.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
d593af3a5f Allow adding multiple ResponseHandlers at once
Change this at call sites as well.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
e4de7eb4f9 Use default_rcode for AsyncDnsServer where applicable
Rule of thumb: If a RCode is set unconditionally in all
ResponseHandlers, set it in the server constructor.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
c7d84dc86a Set default_aa for AsyncDnsServer instances where suitable
Rule of thumb: If all ResponseHandlers said authoritative=True, it
should be default_aa=True instead.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
6e684d44e0 Allow users of AsyncDnsServer to set AA bit for all responses
Previously, all responses had to be set as authoritative explicitly
using DnsResponseSend(..., authoritative=True). After using this,
it became obvious that this is obnoxious.

Add an optional keyword-only parameter to AsyncDnsServer that sets the
default value of the AA bit on outgoing responses.

Make all the other parameters keyword-only as well.
2025-12-18 13:03:14 +01:00
Štěpán Balážik
a0970f3d04 Refactor ControllableAsyncDnsServer setup
When this class was introduced, the constructor of its base class had no
parameters. This was changed in the meantime and these parameters were
not accessible by users of the subclass.

Don't override the constructor.
Move command setup to methods.
Move subclass-specific storage to cached properties.
Take instances of Command instead of the classes themselves for
symmetry with install_response_handler.
2025-12-18 13:03:14 +01:00
Colin Vidal
d07deba615 update SERVFAIL cache test
An existing SERVFAIL cache test is updated as it initially checks there
are no EDE (the first SERVFAIL) then immediately re-does the same query,
(still SERVFAIL), and expect the CACHED_ERROR EDE.

However, the configuration used for this test to generate a SERVFAIL is
a broken DNSSEC configuration, where the DNSKEY is not the expected one
(it's a ZSK instead of a KZK). As a result, the first attempt also now
raise an EDE (MISSING_DNSKEY).
2025-12-17 09:43:13 +01:00
Colin Vidal
e856afa3b5 add system tests covering EDE 9
The authoritative server on "missing-dnskey." zone is ns2, the zone is
initially signed normally, but then the DNSKEY are pulled out from the
signed generated zone file. As a consequence, a quering the resolver ns4
returns a SERVFAIL with EDE9 as the chain of trust is broken: the DS is
prsent in the parent zone (the root zone in ns1), but the DNSKEY is
missing from the zone.

A similar is "wrong-dnskey.", but here the zone is signed correctly,
but the DS points to a different DNSKEY. Hence no supported matching
DNSKEY record could be found for the child.
2025-12-17 09:43:13 +01:00
Mark Andrews
96e6a22627 Exclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6
f.f.f.f.ip6.arpa is a configured zone so refused responses
are not expected.
2025-12-16 13:15:37 +11:00
Michal Nowak
ce23dd4dd3
Add TSAN report and core file globs to expected artifacts 2025-12-15 19:42:50 +01:00
Evan Hunt
92919609c4 Check delegation response to ANY query
If mandatory glue is present, it should be returned when the query
type is ANY.
2025-12-11 10:41:05 -08:00
Matthijs Mekking
5e704bbb59 Add NSEC3 optout large delegation zone test case
This test signs a large delegation with mostly insecure delegations
with NSEC3 optout. Once the NSEC3PARAM record is published, run
dnssec-verify to ensure the zone is correctly signed.
2025-12-10 14:18:52 +01:00
Nicki Křížek
8f326a7af7 Fix a timing issue in notify test
There are a total of 22 notifies required before the start of the test:
20 for each x1..x20 and two for x21, as it has a couple of servers.
2025-12-09 14:23:17 +01:00
Nicki Křížek
51ab74db10 Remove obsolete copy_setports
This function is no longer needed and jinja2 templates are universally
used instead.
2025-12-09 14:23:17 +01:00
Nicki Křížek
bf694d0628 Use jinja2 templates in kasp test
- ns3 had fips/rsasha1 config variants. These were refactored similarly
  to the way they're handled in nsec3 test.
- ns3 special character zone contains @, which is interpreted by jinja2.
  To avoid, {% raw %} directive was added
- ns6 contained unused policies and named2.conf, these were removed
2025-12-09 14:23:17 +01:00
Nicki Křížek
a8713fdcf8 Use jinja2 templates in serve-stale test
The ns1 named.conf files were sufficiently similar to allow for
de-duplication. No attempt to de-duplicate ns3 was made due to
significant differences among the config files.
2025-12-09 14:23:17 +01:00
Nicki Křížek
6114444007 Use jinja2 templates in catz test
- Use a common ns2/named.conf.j2 template for all the "#TN"
  replacements. Instead of commenting out with sed, render the template
  differently into ns/namedX.conf using variables.
- Keep the final ns2/named7.conf.j2 (formerly ns2/named2.conf.in) as a
  separate template for readability due to significant differences.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c93733263a Use jinja2 templates in rpz test
- The ns3/named.conf.j2 uses has a "#BAD" section that is only included
  after restart. Turn it into ns3/named2.conf.
- Since the original config is then restored, keep a copy of it as
  ns3/named1.conf using a symlink, causing it to be rendered twice.
- Use jinja2 templates for test* files to render the port number instead
  of calling copy_setports in load_db().
2025-12-09 14:23:17 +01:00
Nicki Křížek
efc302b0ad Use jinja2 templates in staticstub test
- Instead of strings to be replaced by sed, use proper jinja templates.
- ns3/named1.conf.j2 is basically a copy of the default config, because
  it needs to be restored later in the test.
2025-12-09 14:23:17 +01:00
Nicki Křížek
c46208ffdb Use jinja2 templates in resolver test
- Move ns1/named.conf.j2 to ns1/named2.conf.j2 and adjust the python
  test to render this template.
- Convert remaining .in files to .j2 and handle the multiple configs.
2025-12-09 14:23:17 +01:00
Nicki Křížek
2592f0d961 Use jinja2 templates in views test
- Rename named.conf.j2 to named3.conf.j2 and adjust the python test to
  render this template.
- Handle the n2 and ns3 multiple configs as in other similar cases
  (ns2/named1.conf.in was moved to ns2/named.conf.j2).
2025-12-09 14:23:17 +01:00
Nicki Křížek
1da733a015 Use jinja2 templates in legacy test
The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.
2025-12-09 14:23:17 +01:00
Nicki Křížek
cb88d1eda6 Use jinja2 templates in statistics test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
- Turn ns2/named.conf.in into ns2/named1.conf.j2 because it is used
  later in the test to restore the original config.
- Symlink the ns2/named.conf.j2 ns2/named1.conf.j2 to pick a starting
  config.
2025-12-09 14:23:17 +01:00
Nicki Křížek
719c656d2b Use jinja2 templates in synthfromdnssec test
- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8db37ac31c Use jinja2 templates in tsig test
- Rename ns1/named-fips.conf.in to ns1/named.conf.j2.
- Move MD5-specific stuff into ns1/named-md5.conf.j2 and include it
  conditionally.
2025-12-09 14:23:14 +01:00
Nicki Křížek
16e9ac4710 Use jinja2 templates in rpzrecurse test
- Change ns2 header into jinja2 template.
- Keep the various ns2 config files as non-templates, same for the
  named.default.conf to be consistent.
- Symlink the ns2/named.default.conf as a jinja2 template to pick a
  starting config. It is rendered as a template to avoid an error when
  the test would overwrite a git-tracked file.
- Use jinja2 templates for the ns3 files, keep named1.conf around
  because it's needed later in the test to restore the config. Symlink
  it to `ns3/named.conf.j2` to select a default config.
2025-12-09 14:23:14 +01:00
Nicki Křížek
54c95d6966 Use jinja2 templates in nsupdate test
- Merge ns1/tls.options.in into ns1/named.conf.j2 and render it
  conditionally. Also conditionally include the additional
  ns1/tls.conf.j2 which is always rendered.
- Use multiple templates for ns7 and replace the copy_setports.
- Use jinja2 template for verylarge.in as well.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9fc446b6f5 Use jinja2 templates in notify test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
2025-12-09 14:23:14 +01:00
Nicki Křížek
8e525f2154 Use jinja2 templates in forward test
- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
- Use multiple templates for ns3 and ns9 and replace the copy_setports.
- In ns3/named2.conf, use "root2.db" directly rather than replacing it
  with "sed" later.
2025-12-09 14:23:14 +01:00
Nicki Křížek
3f953266fb Use jinja2 templates in logfileconf test
- Replace all named*.in files with jinja2 templates.
- Rename the config files to named.*.conf convention.
- Rename named.plain.in to named.plain.conf.j2 and symlink it as te
  default config.
- Rename named.plainconf.in to named.plainlog.conf.j2 (there is a slight
  difference from named.plain, despite the similar name)
2025-12-09 14:23:14 +01:00
Nicki Křížek
7f3b0afb09 Use jinja2 templates in runtime test
- Replace named-altX.conf.in with namedX.conf.j2 to stick with the same
  naming convention across the entire code base. Note than due to
  named1.conf being the first (default) config, the numbers for the altX
  are incremented.
- Turn alt9 into named7 to stick with the same number sequence. Adjust
  the related file names accordingly.
2025-12-09 14:23:14 +01:00
Nicki Křížek
b23301ec55 Use jinja2 templates in checkzone test
Render the bad-tsig.db file using jinja2 template to get rid of
copy_setports.

Since the zone is using @ character, use the raw directive to avoid
interpreting it as a variable start.
2025-12-09 14:23:14 +01:00
Nicki Křížek
13bd0d689a Use jinja2 templates in autosign test
- Include ns3/nsec-only.conf conditionally and always render it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
1aa2f7249a Use jinja2 templates in tsiggss
- The ns1/named.conf.j2 contains "@" which is a special jinja character,
  use the raw directive to escape it.
2025-12-09 14:23:14 +01:00
Nicki Křížek
0f37603b1a Use jinja2 templates in transport-change test
- Replace named*.conf.in files with jinja2 templates.
- When applying the files use plain cp command to copy the rendered
  files.
2025-12-09 14:23:14 +01:00
Nicki Křížek
9d3279a542 Replace .in with .j2 templates for cases with namedX.conf
The following tests use multiple named configs. Previously, these have
been rendered with copy_setports in tests.sh when needed. Transform
these into jinja2 templates and render them during setup. In the tests,
the copy_setports invocations can be then replaced with a simple cp.
2025-12-09 14:23:14 +01:00
Nicki Křížek
fc10cb686d Replace .in with .j2 templates for simple copy_setports cases
Use jinja2 templates instead of *.in templates for named.conf and remove
the copy_setports invocations from setup.sh which are no longer needed.
2025-12-09 14:23:14 +01:00
Nicki Křížek
d6d6db52e3 Allow any named*.conf file as a system test artifact
This allows rendering multiple named*.conf files using the jinja2
template engine at test start and then simply copying the required
config to named.conf as needed.
2025-12-09 14:23:14 +01:00
Michal Nowak
ed33f44829 dns.name module does not have minversion attribute
The dns module does have it.
2025-12-09 11:17:20 +01:00
Aram Sargsyan
2622140482 Add a check to the catz test to confirm that the issue is fixed
Use a member zone with a long list of primaries with long key
names to trigger the issue that was fixed by the previous commit.
2025-12-09 18:09:45 +11:00
Nicki Křížek
19af19b31c Add FEATURE_* environment variables to system tests
The purpose of these variables is to be able to detect feature support
without calling feature-test. This becomes useful when detecting feature
support in jinja2 templates.
2025-12-08 18:07:41 +01:00
Nicki Křížek
2bb840bbc7 Remove unused dlz-filesystem feature check
There isn't any system test that uses this feature check.
2025-12-08 18:07:41 +01:00
Nicki Křížek
789e40bd4c Remove unused ipv6only feature check
There isn't any system test that uses this feature check.
2025-12-08 18:07:41 +01:00
Nicki Křížek
f33e2b6d87 Refactor NamedInstance.rndc() to use EnvCmd() interface
To unify the command handling, utilize EnvCmd() to handle rndc commands:

1. Remove isctest.rndc abstractions. They were intended for an upcoming
   python-only implementation. A couple of years later, it doesn't seem
   to be coming any time soon, so let's stick with the interface that
   makes sense today, i.e. use the same command handling interface
   everywhere.
2. Remove the specialized rndc.log in favor of the generic logging
   already implemented by isctest.run.cmd(). I believe the cause of the
   many rndc(log=False) invocations was that nobody wanted this extra
   file. Yet, logging everything by default makes sense for debugging,
   unless there's a good reason not to. In almost all cases, logging was
   switched to the default (enabled).
3. With the NamedInstance.rndc() call now returning CmdResult rather
   than combined stdout+stderr string, adjust all the invocations to use
   `.out` or `.err` as necessary.
4. Replace some manual rndc invocation and its base argument
   construction with the standardized nsX.rndc() call.
5. In cases where rndc is expected to fail, utilize
   raise_on_exception=False and check the `.rc` from the result, rather
   than handling an exception.
6. In addzone/tests_rndc_deadlock.py, refactor the test slightly to
   avoid using EnvCmd() entirely to avoid spamming the logs. This test
   calls rndc in a loop from multiple threads and such test case is an
   exception which doesn't warrant changing the `isctest.run.cmd()`
   implementation.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ff613a72d7 Add generic isctest.run.EnvCmd helper to pytest
A generic helper that calls the environment-specified binaries in a
developer-friendly manner, i.e. passing arguments as strings rather than
having to split them first.

The isctest.run.cmd() remains as the basis which provides a clean and
robust interface, while the isctest.run.EnvCmd() can be used as a
convenient wrapper for tests, or when there are some shared default
parameters.

The isctest.run.Dig() is superseded with the isctest.run.EnvCmd(). In
the future, we might revisit adding Dig() or command-specific helpers
again, but it probably only makes sense if they offer command-aware
attributes / methods, rather than just being shortcuts to
isctest.run.EnvCmd().
2025-12-08 14:57:47 +01:00
Nicki Křížek
a8bf53411d Add pylint check for re.compile() alias
Ensure that Re() is used consistently across our code base.
2025-12-08 14:57:47 +01:00
Nicki Křížek
9bad9491a1 Improve file handling in ksr test
Refactor the file handling to write to a file directly when calling
isctest.run.cmd().

Refactor the existing code to use CmdResult rather than out and err
separately.
2025-12-08 14:57:47 +01:00
Nicki Křížek
4b6a86b029 Use Text with Grep support in isctest.run.cmd()
When commands are executed using the isctest.run.cmd() command, allow
the output to be Grep-able like logs and text files.
2025-12-08 14:57:47 +01:00
Nicki Křížek
7743bab5fc Refactor LogFile into TextFile with Grep support
Add a new Grep-like interface which can be used for searching for
regular expressions in files. Replace the prior LogFile used for named
logs with the new TextFile interface.
2025-12-08 14:57:47 +01:00
Nicki Křížek
be6bae2a75 Move text-related operations into isctest.text module
Add a new module for working with text and keep the isctest.log.watchlog
module focused on its purpose. Move LogFile and LineReader into the new
module. Add compile_pattern() helper which will be useful in subsequent
commits.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac7127d620 Use Re() for creating regular expressions
It's a fairly common pattern to use regular expression in our tests.
Instead of using the fairly verbose re.compile(), import that function
as Re() instead to allow for more brevity in the test syntax.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac998da3f6 Use CmdResult to decode stdout/stderr from isctest.run.cmd()
Avoid repeating the .decode("utf-8") snippet when processing command
output and provide a helper instead, which leads to more concise code.
2025-12-08 14:57:47 +01:00
Nicki Křížek
ac2be27f8f Utilize nsX.rndc() helper
Remove the duplicated code and replace it with nsX.rndc() call.
2025-12-08 13:29:40 +01:00
Colin Vidal
0b9da992a5 add tests for EDE 13 support
Add system test covering EDE 13 being added in the response in case of
SERVFAIL cache hits.
2025-12-05 23:28:29 +01:00
Matthijs Mekking
14a243a81d Fix statschannel system test
The manykeys test case relies on keys being removed. Make sure the
zone is fully signed with the keys that will stay, so the other keys
may be removed safely.

This means the expected number of signatures generated and refreshed
will change. The CDS and CDNSKEY RRset also need to be signed now.

Configure the test case with sig-signing-signatures 100, large enough
that the entire zone is processed in a single step.
2025-12-05 12:14:14 +01:00
Matthijs Mekking
a8339be0f8 Fix nsec3 system test
The nsec3 system test has a couple of cases where the configured policy
changes the algorithm, effectively triggering an algorithm rollover. Fix
those cases to start in a valid DNSSEC state. Then fix the expected key
states, no longer should the old algorithm be removed immediately.
2025-12-05 12:14:14 +01:00
Matthijs Mekking
c756b8a505 Fix autosign system test
When creating keys, set Publish and Activate times so that keys will
be initialized as omnipresent. This way we start with a safe DNSSEC
state. In most cases at least, because some tests depend on special
key timings.

The ttl[1-4].example cases have become incorrect. With dnssec-policy
we require the TTL to match the dnskey-ttl from the policy.

The delzsk.example will have a ZSK removed from the zone. It also
requires that the DNSKEY RRset is already published. This means
that for the existing keys the, no longer "is now published"
messages will be logged.

The nsec-only.example and reconf.example zones are fixed to have a
correct matching policy.

This all means the expected count of log messages changes slightly.
2025-12-05 12:14:14 +01:00
Matthijs Mekking
67ea0e656b Fix views system test
This test case enables DNSSEC and has a mismatch in policy. Fix the
policy so that it matches the existing key set, and adjust the
expected answer count because no longer a new key is generated.
2025-12-05 12:14:14 +01:00
Matthijs Mekking
149ca5d46a Rollover test case for rumoured zone signatures
Test a manual rollover when zone signatures have not become omnipresent
yet. This should not immediately remove the predecessor key.
2025-12-05 12:14:14 +01:00
Colin Vidal
77e0104cf4 shrunk cfgobj down to 48bytes
Make all non-scalar properties of `cfg_obj_t` allocated values, which
ensures the union size is the width of one pointer. Also reorder the
fields inside `cfg_obj_t` to avoid alignment padding that would increase
the size. As a result, a `cfg_obj_t` instance is now 48 bytes on a
64-bit platform.

Add a static assertion to avoid increasing the size of the struct by
mistake.

The function `parse_sockaddrsub` was taking advantage of the fact that
both sockaddr and sockaddrtls were in the same position, and used to
initialize the sockaddr field independently if this was a -tls one or
not. This doesn't work anymore now that all fields are allocated,
so it has been slightly rewritten to take both cases into account
separately.
2025-12-05 08:59:53 +01:00
Colin Vidal
f7b64e2e87 cfg_parse_ API doesn't need memory context
Because the parser now uses global memory context, the cfg_parse_* API
doesn't take a memory context anymore.
2025-12-04 16:09:40 +01:00
Evan Hunt
d4ebea1037 use a standard CLEANUP macro
CLEANUP is a macro similar to CHECK but unconditional, jumping
to cleanup even if the result is ISC_R_SUCCESS. It is now used
in place of DST_RET, CLEANUP_WITH, and CHECK(<non-success constant>).
2025-12-03 13:45:43 -08:00
Evan Hunt
6b33b7fc77 switch to RETERR where it wasn't being used
replace all instances of the pattern:

        result = <statement>
        if (result != ISC_R_SUCCESS) {
                return result;
        }

with:

        RETERR(<statement>);
2025-12-03 13:45:43 -08:00
Evan Hunt
38e94cc7da switch to CHECK where it wasn't being used
replace all instances of the pattern:

        result = <statement>
        if (result != ISC_R_SUCCESS) {
                goto cleanup;
        }

with:

        CHECK(<statement>);
2025-12-03 13:45:42 -08:00
Evan Hunt
52bba5cc34 standardize CHECK and RETERR macros
previously, there were over 40 separate definitions of CHECK macros, of
which most used "goto cleanup", and the rest "goto failure" or "goto
out". there were another 10 definitions of RETERR, of which most were
identical to CHECK, but some simply returned a result code instead of
jumping to a cleanup label.

this has now been standardized throughout the code base: RETERR is for
returning an error code in the case of an error, and CHECK is for jumping
to a cleanup tag, which is now always called "cleanup". both macros are
defined in isc/util.h.
2025-12-03 13:26:28 -08:00
Colin Vidal
6998fe42e3 test for RRSIG provided as soon as they are found
Add a system test which checks that a server authoritative on zone which
is not fully signed (here, it is missing the DNSKEY records as well as the
RRSIG on the RR `b`) still return the RRSIG associated with an RR if
provided in the zone.
2025-12-03 15:49:47 +01:00
Mark Andrews
472cade02b check that dig +showtruncated works 2025-12-02 09:34:13 +11:00
Matthijs Mekking
c17ac42608 Wait for log zone_needdump is more reliable
In some cases we wait for the log message "sending notifies" before
proceeding with the test case. Notifies are rate limited. They are not
sent on every change to the zone. The "zone_needdump" messages happen on
every change.
2025-12-01 13:17:42 +00:00
Matthijs Mekking
ef33272181 Update kasp based system tests to new output
In addition fix some test bugs where we actually were testing against
the wrong policy name.
2025-11-28 15:32:17 +01:00
Matthijs Mekking
a91f13cae8 dnskey is now a property of Key class
After a rebase, the dnskey() invocations need to be adjusted to
accomodate for !11201 (0bf20f8d).
2025-11-28 14:30:31 +00:00
Matthijs Mekking
11578aa219 Update misleading comments in multisigner test
We are not actually retrieving these records from the other provider,
they are available as key files to us and we are using those files
to send a dynamic update to the server.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
61d1209c31 Remove common kasp shell script
No system test is using the common kasp shell script test anymore, so we
can remove it.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
97b38a1fbc Clean up shell script remnants
All the cases in this system test have been converted to pytest, so
we can clean up the shell script remnants.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
c96f896482 Convert model2.secondary test to pytest
This test is similar to model2.multisigner, but now the two providers
are both secondary, both using the same hidden primary. The DNSKEY,
CDNSKEY, and CDS records need to be published at the hidden primary,
ns5, the zone is transferred to both secondaries, ns3 and ns4.

To avoid intermittent test failures, we wait for the line
"zone {zone}/IN (signed): serial {serial2} (unsigned {serial1})" in
the secondary server logs. This is a signal that the unsigned zone
with serial <serial1> has a signed version ready with serial <serial2>.

To speed up the test, disable 'notify-delay'.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
fdf8a171c5 Update multisigner system test to set primary
When testing multi-signer as bump-in-the-wire (upcoming test), we want
to be able to do dynamically updates to a hidden primary. Update the
test functions such that we can set a specific primary server.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
9ae449afd1 Make test code flexible for more providers
The initial test code only allowed for one additional provider. Update
the test function such that more extra keys can be tested.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
773ce8d99b Convert model2.multisigner test to pytest
This converts the model2.multisigner tests from the multisigner system
test to pytest based code. Crappy shell test functions such as
'zsks_are_published', 'records_published' and others are replaced with
the standard test code from isctest.kasp and by setting 'private=False'
and 'legacy=True' on the keys from the other providers so we don't do
any key file testing.
2025-11-28 14:30:31 +00:00
Ondřej Surý
772ef27fe6
Fix missing field 'merge' initializer for the new cfg_clausedef_t
In !11121, a .merge member was added to cfg_clausedef_t.  This caused
a build failure with -Werror,-Wmissing-field-initializers enabled.
Add the missing initializer and set them all to NULL to match the
intent.
2025-11-28 13:50:54 +01:00
Nicki Křížek
b1ffc80f26 Remove obsolete dnspython prerequisite checks
dnspython has been mandatory to run system test for quite a while.
Remove all extraneous checks for this module from prereq.sh scipts.
2025-11-28 11:24:11 +01:00
Nicki Křížek
156b213d62 Remove extraneous prerequisite script for timeouts test
The timeouts test already checks for dnspython>=2.0.0 in
test_tcp_timeouts.py and the prereq.sh file is not needed.
2025-11-28 11:24:11 +01:00
Nicki Křížek
fe92341fd3 Remove obsolete checks for PYTHON executable
Python has been required to run the system test suite for quite a while.
Remove the dated checks inside system tests which are no longer needed.
2025-11-28 11:24:11 +01:00
Colin Vidal
4bc435ab10 add checkconf test for named remote-servers
Add checkconf system test to cover usage of `remote-servers` with a
named server-list and a `key` and/or a `tls` option.
2025-11-28 09:10:54 +01:00
Colin Vidal
32a4aa95ae test named remote-servers key usage
Even though `remote-servers` now allows using named server-list with `key`
(or `tls`), the `key` or `tls` is not used, in the context of a named
server-list, when configuring the server.

For instance,

   remote-servers foo { 10.53.0.5; };
   also-notify { foo key fookey; };

won't use `fookey`.

Add a system test highlighting the problem.
2025-11-28 09:10:53 +01:00
Ondřej Surý
ed460c50b7
Change the QNAME minimization algorithm to follow the standard
In !9155, the QNAME minimization was changed to not leak the query type
to the parent name server.  This violates RFC 9156 Section 3, step (3)
and it is not necessary.  It also breaks some (weird) authoritative DNS
setups, especially when CNAMEs are involved.  Also there is really no
privacy leak with query type.
2025-11-27 16:47:29 +01:00
Nicki Křížek
2f2be20547 Mock DSDigest for compatibility with older dnspython
DSDigest class isn't available prior to dnspython 2.0.0 and prior to Add
an isctest.compat.DSDigest compatibility hack to support those versions.
2025-11-27 14:02:49 +01:00
Nicki Křížek
f6cb154b65 Add a template for TA and generate it from isctest.kasp.Key
Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.
2025-11-27 14:02:49 +01:00
Nicki Křížek
0bf20f8d68 Parse DNSKEY into a dnspython type in isctest.kasp.Key.dnskey
Previously, a DNSKEY string from keyfile was returned. This made the
function brittle for further processing, as the string would have to be
split up, concatenated, and TTL could be missing, making string indices
context-dependent.

Parse the DNSKEY rrset into a proper dnspython object and return it.
This makes the output more predictable and reliable, as all the
neccessary parsing is done by dnspython.
2025-11-27 14:02:49 +01:00
Mark Andrews
98e4204db9 Check nsstats statistics in bind9.xml 2025-11-25 13:26:50 +11:00
Matthijs Mekking
be3e4c83d0 Test retransfer with NSEC3 policy
If the primary has been updated, but the secondary has not been
notified, the journal will go out of date. An 'rndc retransfer' causes
the zone to force an AXFR, removing and rebuilding zone and journal
files.

This test reproduces a bug that in such scenario, an NSEC3 signed zone
falls back to NSEC.
2025-11-24 10:21:33 +01:00
Colin Vidal
68fda6a035 do not log "no root hints for view '_bind'"
The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc (part of effective
configuration changes).

The reason is that since 27c4f68dcc, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. Those changes omitted
the `need_hints` bool that disabled the warning for the builtin view.
This commit silences the log message again.
2025-11-21 14:21:44 -08:00