2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

13 Commits

Author SHA1 Message Date
Matthijs Mekking
2e5a2f4e81 Allow empty CDNSKEY/CDS RRset in ksr system test
When the zone is initially signed, the CDNSKEY/CDS RRset is not
immediately published. The DNSKEY and signatures must propagate first.
Adjust the test to allow for this case.

(cherry picked from commit 708927e03d152983557b6a2d0d40888e0ccffad5)
2024-11-04 01:10:34 +00:00
Matthijs Mekking
9621369524 Match algorithms when checking signatures
In the ksr system test, the test_ksr_twotone case may fail if there
are two keys with the same keytag (but different algorithms), because
one key is expected to be signing and the other is not.

Switch to regular expression matching and include the algorithm in the
search string.

(cherry picked from commit 795fcc9f803068de8c5dbdbcbba69bbd0545b8be)
2024-11-01 14:16:38 +00:00
Matthijs Mekking
8a598cb3bf Fix intermittent ksr test failure
The test_ksr_twotwone may fail if the key id is shorter than 5 digits.
Add a leading space to the expected strings which start with the key
tag to avoid the issue.

(cherry picked from commit d5f32f6990b6f33405e5ca33ffbbc3912f852e3f)
2024-10-25 07:47:01 +00:00
Nicki Křížek
2cdb8c90d1 Use UTC timezone when handling keys in kasp test library
When working with key timestamps, ensure we correctly set the UTC
timezone in order for the tests to work consistently regardless of the
local time setting.

(cherry picked from commit f840deba33f0b719fed0c9b6ad33a2a181406b38)
2024-10-22 10:51:53 +02:00
Nicki Křížek
fb9a87e8c5 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.

(cherry picked from commit 7639c58c4889003777e5da36567f84caa424f157)
2024-10-22 09:14:06 +02:00
Matthijs Mekking
b46ddad5df 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.

(cherry picked from commit b8b3df0676dedbca6e94340825a173ed1764f5b5)
2024-10-22 06:24:42 +00:00
Nicki Křížek
f1fc2e1db4 Address pylint issues
(cherry picked from commit 3c6124a0933d95e154ded274cea6fbef5ac60cc8)
2024-10-22 06:24:42 +00:00
Nicki Křížek
ba2fe0a830 Use f-strings
(cherry picked from commit 55ec9f94bc04eb76090528d939b798048fd7aa70)
2024-10-22 06:24:42 +00:00
Nicki Křížek
3cffc34551 Simplify command invocation
(cherry picked from commit 732a959d9a1e392f32c7365ecf270ea08f585eee)
2024-10-22 06:24:42 +00:00
Nicki Křížek
00ec96e6e6 Remove unused isctest/kasp code
(cherry picked from commit b5633462bfe7fc1e5e684680bb33fed5e8267d6d)
2024-10-22 06:24:42 +00:00
Nicki Křížek
e806d8c6f5 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_".

(cherry picked from commit 67957d1f54e01bc3066effc0fa5b6486efb66178)
2024-10-22 06:24:42 +00:00
Nicki Křížek
f5adeb6800 Use convenience wrappers for kasp key operations
(cherry picked from commit 2b0a8fcfb5084b23477f1c66b9f32445422a4461)
2024-10-22 06:24:42 +00:00
Matthijs Mekking
5d0144d006 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

(cherry picked from commit a3829990fdb67b646f41ef69d2d4ab3b5debbc24)
2024-10-22 06:24:42 +00:00