From 8b3d2e5633183205fda5121329caf35e71200167 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Wed, 12 Mar 2025 16:14:52 +0100 Subject: [PATCH] ksr: Take into account key collisions When generating new key pairs, one test checks if existing keys that match the time bundle are selected, rather than extra keys being generated. Part of the test is to check the verbose output, counting the number of "Selecting" and "Generating" occurences. But if there is a key collision, the ksr tool will output that the key already exists and includes the substring "already exists, or might collide with another key upon revokation. Generating a new key". So substract by one the generated counter if there is a "collide" occurrence. --- bin/tests/system/ksr/tests_ksr.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/tests/system/ksr/tests_ksr.py b/bin/tests/system/ksr/tests_ksr.py index d2b3e86c17..78724d137b 100644 --- a/bin/tests/system/ksr/tests_ksr.py +++ b/bin/tests/system/ksr/tests_ksr.py @@ -597,6 +597,10 @@ def test_ksr_common(servers): selected += 1 if "Generating" in output: generated += 1 + # Subtract if there was a key collision. + if "collide" in output: + generated -= 1 + assert selected == 2 assert generated == 2 for index, key in enumerate(overlapping_zsks):