From 1a8cbf11fe03cf88a0e17095fe13a8e3bdb424fd Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Mon, 28 Jul 2025 14:12:55 +0200 Subject: [PATCH] Update set_expected_keytimes for migrate case If we are migrating keys, we should take the existing key timing metadata to initialise the state values. These tests will only setup keys with Publish/Activate/SyncPublish times, because the Retire and Remove timings will still need to be adjusted to the DNSSEC policy. --- bin/tests/system/isctest/kasp.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/tests/system/isctest/kasp.py b/bin/tests/system/isctest/kasp.py index 094a542f54..81d57f9651 100644 --- a/bin/tests/system/isctest/kasp.py +++ b/bin/tests/system/isctest/kasp.py @@ -249,7 +249,9 @@ class KeyProperties: iret = Iret(config, zsk=self.key.is_zsk(), ksk=self.key.is_ksk()) self.timing["Removed"] = self.timing["Retired"] + iret - def set_expected_keytimes(self, config, offset=None, pregenerated=False): + def set_expected_keytimes( + self, config, offset=None, pregenerated=False, migrate=False + ): if self.key is None: raise ValueError("KeyProperties must be attached to a Key") @@ -260,18 +262,24 @@ class KeyProperties: offset = self.properties["offset"] self.timing["Generated"] = self.key.get_timing("Created") - - self.timing["Published"] = self.timing["Generated"] + self.timing["Published"] = self.key.get_timing("Created") if pregenerated: self.timing["Published"] = self.key.get_timing("Publish") - self.timing["Published"] = self.timing["Published"] + offset - self.Ipub(config) + + if migrate: + self.timing["Published"] = self.key.get_timing("Publish") + if self.key.is_ksk(): + self.timing["PublishCDS"] = self.key.get_timing("SyncPublish") + self.timing["Active"] = self.key.get_timing("Activate") + else: + self.timing["Published"] = self.timing["Published"] + offset + self.Ipub(config) + self.IpubC(config) # Set Retired timing metadata if key has lifetime. if self.metadata["Lifetime"] != 0: self.timing["Retired"] = self.timing["Active"] + self.metadata["Lifetime"] - self.IpubC(config) self.Iret(config) # Key state change times must exist, but since we cannot reliably tell