]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
ksr: Take into account key collisions
authorMatthijs Mekking <matthijs@isc.org>
Wed, 12 Mar 2025 15:14:52 +0000 (16:14 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 13 Mar 2025 08:18:50 +0000 (08:18 +0000)
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

index d2b3e86c17c728b718290f5ecce9a37f0c289e8c..78724d137be63238fd04d4d75cab6cb43a8539e2 100644 (file)
@@ -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):