Commit 84590b2184 for frr
commit 84590b21845196fd88b56bb0ff16ffe0a5f2880b
Author: Donald Sharp <sharpd@nvidia.com>
Date: Thu Sep 17 14:50:03 2026 -0400
tests: isolate BFD keyed SHA1 hold case from leftover replay window
The hold test started while the previous session was still up, then
after waiting for Down still spoke with a fresh sequence number before
bfd.AuthSeqKnown had aged out. Those packets were refused as replays
and the counter check treated them as a failed hold.
Wait for Down, keep the sequence still until one packet is accepted,
and only then check that repeating it does not raise the sequence
error counter.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/tests/topotests/bfd_auth_replay_topo1/test_bfd_auth_replay_topo1.py b/tests/topotests/bfd_auth_replay_topo1/test_bfd_auth_replay_topo1.py
index 924ef03a73..c31a19ff87 100644
--- a/tests/topotests/bfd_auth_replay_topo1/test_bfd_auth_replay_topo1.py
+++ b/tests/topotests/bfd_auth_replay_topo1/test_bfd_auth_replay_topo1.py
@@ -157,9 +157,19 @@ def test_bfd_auth_held_sequence_is_accepted():
"""
skip_unless_ready()
- before = counter(SEQ_ERROR)
- peer = run_peer(after_up="hold", seconds=25)
+ expect_state("down", count=60)
+ # Repeat the same sequence until it is accepted, so the window left
+ # by the previous session ages out first. A restarted sequence would
+ # otherwise be counted as a replay rather than as the repeat this
+ # test wants. Snapshot the error counter only after the session is
+ # up, so those ageing-out drops are not mistaken for a refused hold.
+ peer = run_peer(after_up="hold", seconds=25, hold_until_up=True)
expect_state("up")
+
+ before = counter(SEQ_ERROR)
+ accepted = counter("control-packet-input")
+ expect_counter_above("control-packet-input", accepted + 20)
+ assert peer_state() == "up", "session dropped while the sequence number was held"
assert counter(SEQ_ERROR) == before, "a held sequence number was refused"
peer.terminate()
peer.wait()