Skip to content

Commit

Permalink
Merge pull request #17477 from donaldsharp/topo_connected_installed
Browse files Browse the repository at this point in the history
tests: Ensure connected routes are installed before continuing
  • Loading branch information
Jafaral authored Nov 21, 2024
2 parents 58abc85 + 058faf6 commit 440a0d3
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 440a0d3

Please sign in to comment.