From c6c0403c61c157a9507781c332e152a2b220da52 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sat, 13 Jul 2024 13:14:33 +0300 Subject: [PATCH] tests: Check if VRF instance has a different ASN than a default VRF Signed-off-by: Donatas Abraitis --- .../test_bgp_vrf_different_asn.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/topotests/bgp_vrf_different_asn/test_bgp_vrf_different_asn.py b/tests/topotests/bgp_vrf_different_asn/test_bgp_vrf_different_asn.py index 7334305ae4..9a1a9ec766 100644 --- a/tests/topotests/bgp_vrf_different_asn/test_bgp_vrf_different_asn.py +++ b/tests/topotests/bgp_vrf_different_asn/test_bgp_vrf_different_asn.py @@ -58,6 +58,24 @@ def test_bgp_vrf_different_asn(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + def _bgp_check_instances(): + output = json.loads(tgen.gears["r1"].vtysh_cmd("show bgp vrf all json")) + expected = { + "default": { + "vrfName": "default", + "localAS": 65000, + }, + "vrf100": { + "vrfName": "vrf100", + "localAS": 65100, + }, + } + return topotest.json_cmp(output, expected) + + test_func = functools.partial(_bgp_check_instances) + _, result = topotest.run_and_expect(test_func, None, count=30, wait=1) + assert result is None, "Can't see vrf100 to be under 65100 ASN" + def _bgp_check_imported_route(): output = json.loads( tgen.gears["r1"].vtysh_cmd("show ip route 192.168.1.0/24 json") -- 2.39.5