Commit da7e7101de for bind
commit da7e7101debf32a6c9a856d08009ebb56e0982b6
Author: Nicki Křížek <nicki@isc.org>
Date: Tue Aug 25 13:15:32 2026 +0000
Simplify zone file path handling in dnssec_py tests
Assisted-by: Claude:claude-fable-5
diff --git a/bin/tests/system/dnssec_py/tests_dnskey_malformed.py b/bin/tests/system/dnssec_py/tests_dnskey_malformed.py
index b62c190f65..213e1c4605 100644
--- a/bin/tests/system/dnssec_py/tests_dnskey_malformed.py
+++ b/bin/tests/system/dnssec_py/tests_dnskey_malformed.py
@@ -9,7 +9,6 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-from pathlib import Path
from re import compile as Re
import base64
@@ -86,9 +85,7 @@ def bootstrap():
zone.render()
# read the rendered zone
- unsigned_path = str(Path(zone.ns.name) / zone.filepath_unsigned)
- signed_path = str(Path(zone.ns.name) / zone.filepath_signed)
- zoneobj = dns.zone.from_file(unsigned_path, origin="dnskey-malformed.")
+ zoneobj = dns.zone.from_file(str(zone.path_unsigned), origin="dnskey-malformed.")
# sign the zone (including the malformed ZSKs) with KSK
with zoneobj.writer() as txn:
@@ -115,7 +112,7 @@ def bootstrap():
multiple_rrset.add(create_malformed_rr(rr, i))
multiple_rrset.add(rr)
- zoneobj.to_file(signed_path)
+ zoneobj.to_file(str(zone.path_signed))
root = configure_root([zone])
ksk_key_b64 = base64.b64encode(ksk_dnskey.key).decode()
diff --git a/bin/tests/system/dnssec_py/tests_rrsigs_extra_expired.py b/bin/tests/system/dnssec_py/tests_rrsigs_extra_expired.py
index 7fc3b4dc1b..1772bc6ba7 100644
--- a/bin/tests/system/dnssec_py/tests_rrsigs_extra_expired.py
+++ b/bin/tests/system/dnssec_py/tests_rrsigs_extra_expired.py
@@ -9,7 +9,6 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-from pathlib import Path
from re import compile as Re
import time
@@ -34,7 +33,7 @@ def bootstrap():
zone.add_keys()
zone.render()
- signed_path = Path(zone.ns.name) / zone.filepath_signed
+ signed_path = str(zone.path_signed)
# create valid but expired signatures
expired_rdata = set()
@@ -43,19 +42,19 @@ def bootstrap():
end = now - 10000
for i in range(2):
zone.sign(f"-s {start - i} -e {end - i}")
- expired = dns.zone.from_file(str(signed_path), origin="rrsigs-extra-expired.")
+ expired = dns.zone.from_file(signed_path, origin="rrsigs-extra-expired.")
rdataset = expired.get_rdataset("a", "RRSIG", "A")
expired_rdata.add(rdataset.pop())
# sign zone with valid sigs
zone.sign()
- valid = dns.zone.from_file(str(signed_path), origin="rrsigs-extra-expired.")
+ valid = dns.zone.from_file(signed_path, origin="rrsigs-extra-expired.")
rdataset = valid.find_rdataset("a", "RRSIG", "A")
# add the expired RRSIGs for a.rrsigs-extra-expired
for rd in expired_rdata:
rdataset.add(rd)
- valid.to_file(str(signed_path))
+ valid.to_file(signed_path)
root = configure_root([zone])
return {