Skip to content

Commit

Permalink
Merge pull request FRRouting#16109 from donaldsharp/seg6_topotest_fix
Browse files Browse the repository at this point in the history
tests: Fix zebra_seg6_route
  • Loading branch information
ton31337 authored May 30, 2024
2 parents 8f23eb7 + f766686 commit fd8a2c4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/topotests/zebra_seg6_route/r1/routes_setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"2001::/64":[
{
"prefix":"2001::/64",
"prefixLen":64,
"protocol":"connected",
"vrfName":"default",
"selected":true,
"destSelected":true,
"distance":0,
"metric":0,
"installed":true,
"internalStatus":16,
"internalFlags":8,
"internalNextHopNum":1,
"internalNextHopActiveNum":1,
"nexthops":[
{
"flags":3,
"fib":true,
"directlyConnected":true,
"interfaceName":"dum0",
"active":true
}
]
}
]
}
10 changes: 10 additions & 0 deletions tests/topotests/zebra_seg6_route/test_zebra_seg6_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ def check(router, dest, expected):
return False
return topotest.json_cmp(output, expected)

def check_connected(router, dest, expected):
logger.info("Checking for connected")
output = json.loads(router.vtysh_cmd("show ipv6 route {} json".format(dest)))
return topotest.json_cmp(output, expected)

expected = open_json_file(os.path.join(CWD, "{}/routes_setup.json".format("r1")))
test_func = partial(check_connected, r1, "2001::/64", expected)
success, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
assert result is None, "Failed to fully setup connected routes needed"

manifests = open_json_file(os.path.join(CWD, "{}/routes.json".format("r1")))
for manifest in manifests:
dest = manifest["in"]["dest"]
Expand Down

0 comments on commit fd8a2c4

Please sign in to comment.