From 6ec742d95fc444457d27f5d5b59c6045550fe722 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 19 May 2022 15:54:59 -0400 Subject: tests: Ensure routes are not queued when calling verify_rib Lots of tests call verify_rib that takes a list of routes that need to be verified in some fashion. This verify_rib functionality will try up to 12 seconds before failing the check that zebra has the route and has installed it. Unfortunately the verify_rib code was not looking to see if the route was queued for installation and was then allowing tests to immediately do subsuquent steps that depended on that route actually being installed sometimes causing tests to fail. Write a bit of additional code that looks at the queued status and allows the test to wait a bit longer for zebra to finish processing before allowing the test to move on to the next bit. Signed-off-by: Donald Sharp --- tests/topotests/lib/common_config.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/topotests/lib/common_config.py') diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 5a5c7e3df..5c8b76054 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -3383,6 +3383,10 @@ def verify_rib( st_found = True found_routes.append(st_rt) + if "queued" in rib_routes_json[st_rt][0]: + errormsg = "Route {} is queued\n".format(st_rt) + return errormsg + if fib and next_hop: if type(next_hop) is not list: next_hop = [next_hop] @@ -3607,6 +3611,10 @@ def verify_rib( st_found = True found_routes.append(st_rt) + if "queued" in rib_routes_json[st_rt][0]: + errormsg = "Route {} is queued\n".format(st_rt) + return errormsg + if next_hop: if type(next_hop) is not list: next_hop = [next_hop] -- cgit v1.2.3