From 5c88cbf660a6bd09133817ba2ed99f3bd2f02e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Fri, 12 Jun 2026 16:23:07 +0200 Subject: [PATCH] test: mdns_allow_deny: Adapt to yangerd behaviour changes --- test/case/services/mdns/mdns_allow_deny/test.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/case/services/mdns/mdns_allow_deny/test.py b/test/case/services/mdns/mdns_allow_deny/test.py index 0311d916..985ba0df 100755 --- a/test/case/services/mdns/mdns_allow_deny/test.py +++ b/test/case/services/mdns/mdns_allow_deny/test.py @@ -12,6 +12,7 @@ with three scenarios: """ import re import infamy +from infamy.util import until def mdns_scan(): @@ -56,9 +57,17 @@ def check(expected, allow=None, deny=None): dut.put_config_dicts({"infix-services": mdns_config}) - actual = mdns_scan() - if actual != tuple(expected): - raise AssertionError(f"Expected {expected}, got {actual}") + # The mDNS daemon is restarted/reloaded asynchronously when the + # allow/deny config changes, so retry the scan until the observed + # per-interface result matches the expectation. until() re-raises the + # last AssertionError on timeout, preserving the expected/got detail. + def scan_matches(): + actual = mdns_scan() + if actual != tuple(expected): + raise AssertionError(f"Expected {expected}, got {actual}") + return True + + until(scan_matches, attempts=20) with infamy.Test() as test: