2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 01:59:26 +00:00

41994 Commits

Author SHA1 Message Date
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
d7fab54393 fix: usr: 'Recursive-clients 0;' triggers an assertion
BIND 9.20.0 broke `recursive-clients 0;`.  This has now been fixed.

Closes #4987

Merge branch '4987-fix-recursive-clients-0' into 'main'

See merge request isc-projects/bind9!9621
2024-10-17 06:43:25 +00:00
Mark Andrews
677abded6b Add regression test for [GL #4987] 2024-10-17 11:04:32 +11:00
Mark Andrews
840eaa628d Fix recursive-clients 0
Setting recursive-clients 0 triggered an assertion in isc_quota_soft.
This has now been fixed.
2024-10-17 11:04:26 +11:00
Michal Nowak
b98f82b94f Merge tag 'v9.21.2' 2024-10-16 17:49:36 +02:00
Matthijs Mekking
6dca5a0ced chg: test: Rewrite ksr system test to pytest
Merge branch 'matthijs-pytest-rewrite-ksr' into 'main'

See merge request isc-projects/bind9!9445
2024-10-16 15:45:18 +00: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
Aydın Mercan
94e5061151 chg: dev: unify explicit fetching and libcrypto handling
Unify libcrypto initialization and explicit digest fetching in a single place.

It will remove the remaining implicit fetching and deduplicate explicit
fetching inside the codebase. Initialization has been moved in to ensure
OpenSSL cleanup is done only after fetched contextes are destroyed.

Merge branch 'aydin/libdns-explicit-fetch' into 'main'

See merge request isc-projects/bind9!9288
2024-10-16 12:53:31 +00:00
Aydın Mercan
05798b31ff
unify libcrypto and evp_md handling
Unify libcrypto initialization and explicit digest fetching in a single
place and move relevant code to the isc__crypto namespace instead of
isc__tls.

It will remove the remaining implicit fetching and deduplicate explicit
fetching inside the codebase.
2024-10-16 14:03:14 +03:00
Mark Andrews
a1fed2d8e7 rem: dev: Remove unused <openssl/hmac.h> headers from OpenSSL shims
The <openssl/hmac.h> header was unused and including the
header might cause build failure when OpenSSL doesn't have
Engines support enabled.

See https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine

Removes unused hmac includes after Remove OpenSSL Engine support
(commit ef7aba70) removed engine support.

Merge branch 'main-openssl-engine' into 'main'

See merge request isc-projects/bind9!9228
2024-10-16 04:54:09 +00:00
Petr Menšík
9e55ffaf89 Remove unused <openssl/hmac.h> headers from OpenSSL shims
The <openssl/hmac.h> header was unused and including the
header might cause build failure when OpenSSL doesn't have
Engines support enabled.

See https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine

Removes unused hmac includes after Remove OpenSSL Engine support
(commit ef7aba70726cff9afaaa8c7054098f84087ccf84) removed engine
support.
2024-10-16 04:19:16 +00:00
Michal Nowak
81bcc19265 chg: test: Remove unused sbytes, stime, n, response, and rtime variables
Merge branch 'mnowak/drop-unused-variables' into 'main'

See merge request isc-projects/bind9!9617
2024-10-15 17:53:46 +00:00
Michal Nowak
c0246ecef6 Add vulture 2024-10-15 17:38:03 +00:00
Michal Nowak
4857da271d Remove unused sbytes, stime, n, response, and rtime variables 2024-10-15 17:38:03 +00:00
Michal Nowak
a8383e5785 chg: test: Rewrite tools system test to pytest
Merge branch 'mnowak/pytest_rewrite_tools' into 'main'

See merge request isc-projects/bind9!9208
2024-10-15 17:19:09 +00:00
Michal Nowak
3f8e59330d
Rewrite tools system test to pytest 2024-10-15 18:35:47 +02:00
Nicki Křížek
33380d7a50 chg: ci: Allow re-try of unit tests on FreeBSD 14
The unit test doh_test tends do fail quite often due to exceeding run
time limit in the unit:clang:freebsd14:amd64 job. Use a retry on gitlab
level to alleviate the issue until a better fix is available.

Related #4924

Merge branch '4924-retry-doh_test-freebsd14' into 'main'

See merge request isc-projects/bind9!9578
2024-10-15 11:14:02 +00:00
Nicki Křížek
1636864ddb Allow re-try of unit tests on FreeBSD 14
The unit test doh_test tends do fail quite often due to exceeding run
time limit in the unit:clang:freebsd14:amd64 job. Use a retry on gitlab
level to alleviate the issue until a better fix is available.
2024-10-15 12:39:18 +02:00
Nicki Křížek
66c52a92c5 chg: test: Support dnspython 2.7.0
Closes #4988

Merge branch '4988-dnspython-2.7.0-support' into 'main'

See merge request isc-projects/bind9!9634
2024-10-15 10:27:08 +00: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
a33528fe99 fix: usr: Fix NSEC3 closest encloser lookup for names with empty non-terminals
The performance improvement for finding the NSEC3 closest encloser when generating authoritative responses could cause servers to return incorrect NSEC3 records in some cases. This has been fixed.

Closes #4950

Merge branch '4950-bind-logs-expected-covering-nsec3-got-an-exact-match' into 'main'

See merge request isc-projects/bind9!9610
2024-10-14 23:54:27 +00:00
Mark Andrews
b457f64d4a Test that the correct NSEC3 closest encloser is returned 2024-10-14 23:19:34 +00:00
Mark Andrews
67f31c5046 Use a binary search to find the NSEC3 closest encloser
maxlabels is the suffix length that corresponds to the latest
NXDOMAIN response.  minlabels is the suffix length that corresponds
to longest found existing name.
2024-10-14 23:19:34 +00:00
Evan Hunt
87ec2ce498 fix: usr: Report client transport in 'rndc recursing'
When `rndc recursing` is used to dump the list of recursing clients, it now indicates whether a query was sent via UDP, TCP, TLS, or HTTP.

Closes #4971

Merge branch '4971-recursing-show-client-transport' into 'main'

See merge request isc-projects/bind9!9590
2024-10-14 21:16:27 +00:00
Evan Hunt
3ad82a4721 add a unit test for dns_transport_totext()
confirm that the text returned by the dns_transport_totext()
function matches the transport type when it was created.
2024-10-14 12:59:52 -07: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
Evan Hunt
8104ffda0e report client transport in 'rndc recursing'
when dumping the list of recursing clients, indicate whether
a given query was sent over UDP, TCP, TLS, or HTTP.
2024-10-14 12:59:52 -07:00
Michal Nowak
26ed03c247 fix: test: Always use requirements.txt from main
Merge branch 'mnowak/update-util-release-tarball-comparison-sh' into 'main'

See merge request isc-projects/bind9!9603
2024-10-14 18:07:32 +00:00
Michal Nowak
0dd154648e
Add libjson-c-dev before #4960 is addressed
Otherwise the "statistics-channels" option in doc/misc/options and
doc/man/named.conf.5in is marked as "not configured" (contrary to what
we have in release tarballs as they were build on a different image that
has libjson-c and libxml2 in it).

Caused by #4895 that made the option dependant on libjson-c or libxml2
presence in the build image.
2024-10-14 18:52:45 +02:00
Michal Nowak
b926488de8
Always use requirements.txt from main
Instances of the requirements.txt file may be outdated in other
branches.
2024-10-14 18:52:45 +02:00
Michal Nowak
83357e4d3c
Drop BIND 9.16 support 2024-10-14 18:52:45 +02:00
Nicki Křížek
0129ce1477 chg: ci: Increase shotgun pipeline timeout
When running shotgun tests on tagged releases, the increased number of
jobs may cause the shotgun pipeline to take longer than 50 minutes to
finish.

Merge branch 'nicki/increase-shotgun-pipeline-timeout' into 'main'

See merge request isc-projects/bind9!9599
2024-10-14 11:02:06 +00:00
Nicki Křížek
3b227e1161 Increase shotgun pipeline timeout
When running shotgun tests on tagged releases, the increased number of
jobs may cause the shotgun pipeline to take longer than 50 minutes to
finish.
2024-10-14 10:41:39 +02:00
Matthijs Mekking
7a416693bb chg: usr: Harden key management when key files have become unavailabe
Prior to doing key management, BIND 9 will check if the key files on disk match the expected keys. If key files for previously observed keys have become unavailable, this will prevent the internal key manager from running.

Merge branch '4763-do-not-roll-if-key-files-are-missing' into 'main'

See merge request isc-projects/bind9!9337
2024-10-14 07:15:41 +00:00
Matthijs Mekking
351c066d91 Add new behavior to the ARM
Add text to the ARM that describes what we do in case key files have
become unavailable.
2024-10-11 17:42:01 +02: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
af54e3dadc Small keymgr improvement
When a key is to be purged, don't run the key state machinery for it.
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