2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

6385 Commits

Author SHA1 Message Date
Michal Nowak
0579e0a429 xfail upforwd system test if DNSTAP is enabled 2024-10-21 12:04:56 +02:00
Michal Nowak
a8b70abca1 Add with_dnstap mark 2024-10-21 12:04:56 +02:00
Nicki Křížek
7639c58c48 Disable too-many/too-few pylint checks
Enforcing pylint standards and default for our test code seems
counter-productive. Since most of the newly added code are tests or is
test-related, encountering these checks rarely make us refactor the code
in other ways and we just disable these checks individually. Code that
is too complex or convoluted will be pointed out in reviews anyways.
2024-10-17 11:01:44 +02:00
Mark Andrews
677abded6b Add regression test for [GL #4987] 2024-10-17 11:04:32 +11:00
Matthijs Mekking
b8b3df0676 Retry dnssec-verify in kasp test code
It is possible that the zone is not yet fully signed because it is
signed in batches. Retry the AXFR and verify command a couple of times.
2024-10-16 17:16:02 +02:00
Nicki Křížek
3c6124a093 Address pylint issues 2024-10-16 17:16:02 +02:00
Nicki Křížek
b7207fa3e7 Use difflib rather than diff cmd 2024-10-16 17:16:02 +02:00
Nicki Křížek
c9ecd2a618 Move algorithm defaults to check_keys() 2024-10-16 17:16:02 +02:00
Nicki Křížek
55ec9f94bc Use f-strings 2024-10-16 17:16:02 +02:00
Nicki Křížek
732a959d9a Simplify command invocation 2024-10-16 17:16:02 +02:00
Nicki Křížek
b5633462bf Remove unused isctest/kasp code 2024-10-16 17:16:02 +02:00
Nicki Křížek
67957d1f54 Rename kasp function to check_*
If a function is expected to assert / raise on failure (rather than
return boolean), its name should start with "check_".
2024-10-16 17:16:02 +02:00
Nicki Křížek
2b0a8fcfb5 Use convenience wrappers for kasp key operations 2024-10-16 17:16:02 +02:00
Matthijs Mekking
a15bf6704b Convert ksr system test to pytest
Move all test cases from tests.sh to tests_ksr.py. The only test that
is not moved is the check that key id's match expected keys. The
shell-based system test checks two earlier set environment variables
against each other that has become redundant in the pytest variant,
because we now check the signed key response against a list of keys
and for each key we take into account the timing metadata. So we
already ensure that each published key is in the correct key bundle.
2024-10-16 17:16:02 +02:00
Matthijs Mekking
a3829990fd Introduce pytest kasp library
Write initial pytest kasp library. This contains everything that is
required for testing Offline KSK functionality with pytest.

This includes:
- addtime: adding a value to a timing metadata
- get_timing_metdata: retrieve timing metadata from keyfile
- get_metadata/get_keystate: retrieve metadata from statefile
- get_keytag: retrieve keytag from base keyfile string
- get_keyrole: get key role from statefile
- dnskey_equals: compare DNSKEY record from file against a string
- cds_equals: compare CDS derived from file against a string
- zone_is_signed: wait until a zone is completely signed
- dnssec_verify: verify a DNSSEC signed zone with dnssec-verify
- check_dnssecstatus: check rndc dnssec -status output
- check_signatures: check that signatures for a given RRset are correct
- check_dnskeys: check that the published DNSKEY RRset is correct
- check_cds: check that the published CDS RRset is correct
- check_apex: check SOA, DNSKEY, CDNSKEY, and CDS RRset
- check_subdomain: check an RRset below the apex
2024-10-16 17:16:02 +02:00
Matthijs Mekking
ea1fc5c47b Change dnssec-ksr key sorting
Sort keys on algorithm, then keytag. This is more convenient for
testing.
2024-10-16 17:16:02 +02:00
Michal Nowak
4857da271d Remove unused sbytes, stime, n, response, and rtime variables 2024-10-15 17:38:03 +00:00
Michal Nowak
3f8e59330d Rewrite tools system test to pytest 2024-10-15 18:35:47 +02:00
Nicki Křížek
0d90b13646 Support dnspython 2.7.0
CookieOption with new .server/.client attributes (rather than .data) was
added to dnspython. Adjust the code to use the new attributes if
available and fall back to the old code for dnspython<2.7.0
compatibility.
2024-10-15 10:03:25 +02:00
Mark Andrews
b457f64d4a Test that the correct NSEC3 closest encloser is returned 2024-10-14 23:19:34 +00:00
Evan Hunt
74f53a0032 check 'rndc recursing'
there was no system test that exercised 'rndc recursing'; a
simple one has now been added; it confirms that the number of
recursing clients reported by 'rndc stats' is in agreement with
the list returned by 'rndc recursing'.
2024-10-14 12:59:52 -07:00
Matthijs Mekking
5f552293d7 Test removing DNSKEYs from other providers
In a multi-signer setup, removing DNSKEY records from the zone should
not be treated as a key that previously exists in the keyring, thus
blocking the keymgr. Add a test case to make sure.
2024-10-11 17:42:01 +02:00
Matthijs Mekking
a2317425bc Add additional test case with purged key
Test that if a key to be purged is in the keyring, it does not
prevent the keymgr from running. Normally a key that is in the keyring
should be available again on the next run, but that is not true for
a key that can be purged.

In addition, fix some wait_for_log calls, by adding the missing
'|| ret=1' parts.
2024-10-11 17:42:01 +02:00
Matthijs Mekking
d1e263ef13 Fix some system test cases
Some test cases were working but for the wrong reasons. These started
to fail when I implemented the first approach for #4763, where the
existence of a DNSKEY together with an empty keyring is suspicious and
would prevent the keymgr from running.

These are:

1. kasp: The multisigner-model2.kasp zone has ZSKs from other providers
   in the zone, but not yet its own keys. Pregenerate signing keys and
   add them to the unsigned zone as well.

2. kasp: The dynamic-signed-inline-signing.kasp zone has a key generated
   and added in the raw version of the zone. But the key file is stored
   outside the key-directory for the given zone. Add '-K keys' to the
   dnssec-keygen command.
2024-10-11 17:42:01 +02:00
Matthijs Mekking
5fdad05a8a Verify new key files before running keymgr
Prior to running the keymgr, first make sure that existing keys
are present in the new keylist. If not, treat this as an operational
error where the keys are made offline (temporarily), possibly unwanted.
2024-10-11 17:42:00 +02:00
Matthijs Mekking
a3afbd9d6f Add test for missing key files, don't roll
In this specific case the key files are temporary unavailable, for
example because of an operator error, or a mount failure). In such
cases, BIND should not try to roll over these keys.
2024-10-11 16:27:50 +02:00
Matthijs Mekking
0396bf98ee Revert "fix: chg: Improve performance when looking for the closest encloser when returning NSEC3 proofs"
This reverts merge request !9436
2024-10-10 06:59:28 +00:00
Aram Sargsyan
d49a8f518a Don't ignore the local port number in dns_dispatch_add() for TCP
The dns_dispatch_add() function registers the 'resp' entry in
'disp->mgr->qids' hash table with 'resp->port' being 0, but in
tcp_recv_success(), when looking up an entry in the hash table
after a successfully received data the port is used, so if the
local port was set (i.e. it was not 0) it fails to find the
entry and results in an unexpected error.

Set the 'resp->port' to the given local port value extracted from
'disp->local'.
2024-10-02 08:53:44 +00:00
Alessio Podda
cc167266aa Support ISO timestamps with timezone information
This commit adds support for timestamps in iso8601 format with timezone
when logging. This is exposed through the iso8601-tzinfo printtime
suboption.
It also makes the new logging format the default for -g output,
hopefully removing the need for custom timestamp parsing in scripts.
2024-10-01 15:09:43 +00:00
Michal Nowak
dfec69b4a2 Replace dns.query module with isctest.query 2024-10-01 13:25:56 +02:00
Michal Nowak
a2d2d9c0d3 Add isctest.check.notimp() 2024-10-01 13:25:56 +02:00
Michal Nowak
4cb52f072e Report expected and last returned rcode on query timeout
Sometimes it's useful to see what was the server returning that did not
match the expected rcode.
2024-10-01 13:25:56 +02:00
Mark Andrews
9b358e6e8b Add examples of WALLET records 2024-09-25 10:32:38 +00:00
Mark Andrews
b919b9b4f3 Add the new record type WALLET (262)
This provides a mapping from a domain name to a cryptographic
currency wallet and is a clone of TXT.
2024-09-25 10:32:38 +00:00
Aram Sargsyan
63bddd7192 Test 'rndc dumpdb' with an unwritable dump-file
Check that with a preexisting dump file without a write permission
no actual dump happens, and rndc returns an error result.

Also add a couple of missing entries in the cleaning script.
2024-09-25 08:02:17 +00:00
Mark Andrews
21baad0a8f Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.
2024-09-24 05:33:06 +00:00
Michal Nowak
1c637e96d1 Print correct udp/tcp function name in generic_query() 2024-09-23 13:06:42 +00:00
Michal Nowak
463ab2f3f5 Downgrade "timeout" and "attempts" arguments in shutdown
The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.
2024-09-23 13:06:42 +00:00
Mark Andrews
61415432ec Check responselog behaviour
Extends the resolver system test to to check whether responses are
logged to the query log in addition to the queries.
2024-09-19 21:44:06 +00:00
Ondřej Surý
62d59766d6 Remove DNSRPS implementation
DNSRPS was the API for a commercial implementation of Response-Policy
Zones that was supposedly better.  However, it was never open-sourced
and has only ever been available from a single vendor.  This goes against
the principle that the open-source edition of BIND 9 should contain only
features that are generally available and universal.

This commit removes the DNSRPS implementation from BIND 9.  It may be
reinstated in the subscription edition if there's enough interest from
customers, but it would have to be rewritten as a plugin (hook) instead
of hard-wiring it again in so many places.
2024-09-18 17:39:14 +02:00
Evan Hunt
dc13333957 use uv_dlopen() instead of dlopen() when linking DNSRPZ
take advantage of libuv's shared library handling capability
when linking to a DNSRPS library.  (see b396f55586 and 37b9511ce1
for prior related work.)
2024-09-18 17:24:13 +02:00
Ondřej Surý
d7bff3c0f9 Remove old cruft from dnsrps code
There was some old cruft for ancient compilers checking for attributes
that we regularly use, etc.  Just remove the cruft.
2024-09-18 17:24:13 +02:00
Aram Sargsyan
136ed023fd Update the statistics channel check in the forward system test
Check that the ForwardOnlyFail increases as expected.
2024-09-16 09:31:14 +00:00
Aram Sargsyan
81b3c5d908 Add a statistics channel check in the forward system test
Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.
2024-09-16 08:23:12 +00:00
Michal Nowak
8b55d0709d Extract dns.rcode compatibility code to isctest.compat 2024-09-12 11:42:22 +02:00
Michal Nowak
d2e0043ec3 Turn off deadline for wildcard tests
Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.
2024-09-12 11:42:22 +02:00
Michal Nowak
2cec1de43b Extract "custom" named instances support to isctest.run module 2024-09-12 11:42:22 +02:00
Michal Nowak
5929ba0f54 Rework query functions to retry by default 2024-09-12 11:42:22 +02:00
Michal Nowak
bfe338b965 Replace dns.resolver module in system tests 2024-09-12 11:42:22 +02:00
alessio
da0e48b611 Remove "port" from source address options
Remove the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Remove the use of source ports for parental-agents.

Also remove the deprecated options use-{v4,v6}-udp-ports and
avoid-{v4,v6}udp-ports.
2024-09-12 08:15:58 +02:00