]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Ensure routes are not queued when calling verify_rib
authorDonald Sharp <sharpd@nvidia.com>
Thu, 19 May 2022 19:54:59 +0000 (15:54 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 20 May 2022 14:31:48 +0000 (10:31 -0400)
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 <sharpd@nvidia.com>
tests/topotests/lib/common_config.py

index 5a5c7e3df40a64b4ac17e0959fa59f6f329f995e..5c8b7605444b2504a17974340deb502117385d41 100644 (file)
@@ -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]