Skip to content

Commit

Permalink
tests: Ensure connected routes are installed before continuing
Browse files Browse the repository at this point in the history
Upon high load the ospf_instance_redistribute test can attempt
to install routes with sharpd before the connected routes have
fully baked themselves into zebra.  Since sharpd intentionally
has no retry mechanism we need to ensure that the test is waiting
a small bit.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Nov 21, 2024
1 parent 8884f42 commit 058faf6
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ def test_install_sharp_instance_routes():
if tgen.routers_have_failure():
pytest.skip(tgen.errors)

r1 = tgen.gears["r1"]
logger.info("Ensure that connected routes are actually installed")
expected = {
"192.168.100.0/24": [
{
"prefix": "192.168.100.0/24",
"prefixLen": 24,
"protocol": "connected",
"vrfName": "default",
"selected": True,
"destSelected": True,
"installed": True,
"nexthops": [
{
"fib": True,
"directlyConnected": True,
"interfaceName": "lo",
"active": True,
"weight": 1,
}
],
}
]
}

test_func = partial(
topotest.router_json_cmp, r1, "show ip route connected json", expected
)

_, result = topotest.run_and_expect(test_func, None, count=30, wait=1)

logger.info("Installing sharp routes")
r1 = tgen.gears["r1"]
r1.vtysh_cmd("sharp install route 4.5.6.7 nexthop 192.168.100.2 1")
Expand Down

0 comments on commit 058faf6

Please sign in to comment.