summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-05-27 10:35:26 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2024-06-07 10:13:32 +0200
commit2d6dcc0c57ecb4a8d28bf8671e67c3e292f7adad (patch)
tree6e4db6644c593947fd4b3a0b4b0744ec24824ddd
parentzebra: fix show route memory consumption (diff)
downloadfrr-2d6dcc0c57ecb4a8d28bf8671e67c3e292f7adad.tar.xz
frr-2d6dcc0c57ecb4a8d28bf8671e67c3e292f7adad.zip
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>
-rw-r--r--tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py b/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py
index 3938a966e..6d4b436bc 100644
--- a/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py
+++ b/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py
@@ -338,6 +338,21 @@ interface EVA
result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
+ """
+ Check that "show ip route vrf DONNA json" and the JSON at key "DONNA" of
+ "show ip route vrf all json" gives the same result.
+ """
+
+ def check_vrf_table(router, vrf, expect):
+ output = router.vtysh_cmd("show ip route vrf all json", isjson=True)
+ vrf_table = output.get(vrf, {})
+
+ return topotest.json_cmp(vrf_table, expect)
+
+ test_func = partial(check_vrf_table, r1, "DONNA", expect)
+ result, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ assert result, "BGP VRF DONNA check failed:\n{}".format(diff)
+
def test_vrf_route_leak_donna_after_eva_up():
logger.info("Ensure that route states change after EVA interface goes up")