diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-05-04 09:22:19 +0300 |
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-05-04 09:23:26 +0300 |
| commit | 66e0f6c456cb2380f932c8f0dfef8897218359d7 (patch) | |
| tree | 356294e406f7f0fc9df1404811d377097a4b095b /tests/topotests/rip_allow_ecmp | |
| parent | 4972a6ee7f1bffad9afa9e0c167e32c0fdd90e98 (diff) | |
tests: Check RIP allow-ecmp an arbitrary number of paths
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'tests/topotests/rip_allow_ecmp')
| -rw-r--r-- | tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py b/tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py index c965c87481..7d958fd496 100644 --- a/tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py +++ b/tests/topotests/rip_allow_ecmp/test_rip_allow_ecmp.py @@ -103,11 +103,13 @@ def test_rip_allow_ecmp(): _, result = topotest.run_and_expect(test_func, None, count=60, wait=1) assert result is None, "Can't see 10.10.10.1/32 as multipath in `show ip rip`" - def _show_routes(): + def _show_routes(nh_num): output = json.loads(r1.vtysh_cmd("show ip route json")) expected = { "10.10.10.1/32": [ { + "internalNextHopNum": nh_num, + "internalNextHopActiveNum": nh_num, "nexthops": [ { "ip": "192.168.1.2", @@ -117,15 +119,15 @@ def test_rip_allow_ecmp(): "ip": "192.168.1.3", "active": True, }, - ] + ], } ] } return topotest.json_cmp(output, expected) - test_func = functools.partial(_show_routes) + test_func = functools.partial(_show_routes, 4) _, result = topotest.run_and_expect(test_func, None, count=60, wait=1) - assert result is None, "Can't see 10.10.10.1/32 as multipath in `show ip route`" + assert result is None, "Can't see 10.10.10.1/32 as multipath (4) in `show ip route`" step( "Configure allow-ecmp 2, ECMP group routes SHOULD have next-hops with the lowest IPs" @@ -144,6 +146,10 @@ def test_rip_allow_ecmp(): result is None ), "Can't see 10.10.10.1/32 as ECMP with the lowest next-hop IPs" + test_func = functools.partial(_show_routes, 2) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=1) + assert result is None, "Can't see 10.10.10.1/32 as multipath (2) in `show ip route`" + if __name__ == "__main__": args = ["-s"] + sys.argv[1:] |
