Skip to content

Commit 6e7f73c

Browse files
committed
tests: check show route vrf all json output
Check that "show ip route vrf XXX json" and the JSON at key "XXX" of "show ip route vrf all json" gives the same output. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
1 parent 0c4dd47 commit 6e7f73c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,21 @@ def test_vrf_route_leak_donna_after_eva_down():
338338
result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
339339
assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
340340

341+
"""
342+
Check that "show ip route vrf DONNA json" and the JSON at key "DONNA" of
343+
"show ip route vrf all json" gives the same result.
344+
"""
345+
346+
def check_vrf_table(router, vrf, expect):
347+
output = router.vtysh_cmd("show ip route vrf all json", isjson=True)
348+
vrf_table = output.get(vrf, {})
349+
350+
return topotest.json_cmp(vrf_table, expect)
351+
352+
test_func = partial(check_vrf_table, r1, "DONNA", expect)
353+
result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
354+
assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
355+
341356

342357
def test_vrf_route_leak_donna_after_eva_up():
343358
logger.info("Ensure that route states change after EVA interface goes up")

0 commit comments

Comments
 (0)