diff --git a/tests/topotests/all_protocol_startup/r1/ip_nht.ref b/tests/topotests/all_protocol_startup/r1/ip_nht.ref index 1dceb3ca76ac..224080942bc9 100644 --- a/tests/topotests/all_protocol_startup/r1/ip_nht.ref +++ b/tests/topotests/all_protocol_startup/r1/ip_nht.ref @@ -72,6 +72,18 @@ VRF default: resolved via connected is directly connected, r1-eth0 (vrf default) Client list: pbr(fd XX) +192.168.0.202 + resolved via connected + is directly connected, r1-eth0 (vrf default) + Client list: pbr(fd XX) +192.168.0.205 + resolved via connected + is directly connected, r1-eth0 (vrf default) + Client list: pbr(fd XX) +192.168.0.207 + resolved via connected + is directly connected, r1-eth0 (vrf default) + Client list: pbr(fd XX) 192.168.0.208 resolved via connected is directly connected, r1-eth0 (vrf default) diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py index 615d2f392ce1..d6f5e6f4f360 100644 --- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py +++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py @@ -715,7 +715,7 @@ def test_nexthop_groups(): ## the nhgroups are removed from a configurable timer (zebra nexthop-group keep XX) tgen.gears["r1"].vtysh_cmd("sharp remove routes 7.7.7.7 1") - tgen.gears["r1"].vtysh_cmd( + output = tgen.gears["r1"].vtysh_cmd( """ configure terminal nexthop-group CONTROL @@ -727,6 +727,61 @@ def test_nexthop_groups(): valid is not None ), "nexthop-group CONTROL 'protocol-controlled' command should not be modified" + ## multiple nexthop-group dependencies + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group GROUP1 + group ECMP1 + group ECMP2 + """ + ) + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group ECMP1 + protocol-controlled + nexthop 192.168.0.202 r1-eth0 + """ + ) + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group ECMP2 + protocol-controlled + nexthop 192.168.0.205 r1-eth0 + """ + ) + tgen.gears["r1"].vtysh_cmd("sharp install routes 8.8.8.8 nexthop-group GROUP1 1") + verify_route_nexthop_group("8.8.8.8/32", ecmp=2) + + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group GROUP1 + no group ECMP2 + """ + ) + verify_route_nexthop_group("8.8.8.8/32", ecmp=1) + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group ECMP3 + protocol-controlled + nexthop 192.168.0.207 r1-eth0 + """ + ) + tgen.gears["r1"].vtysh_cmd( + """ + configure terminal + nexthop-group GROUP1 + group ECMP3 + group ECMP2 + nexthop 192.168.0.207 r1-eth0 + """ + ) + verify_route_nexthop_group("8.8.8.8/32", ecmp=3) + ## Remove all NHG routes net["r1"].cmd('vtysh -c "sharp remove routes 2.2.2.1 1"') @@ -739,6 +794,7 @@ def test_nexthop_groups(): net["r1"].cmd('vtysh -c "sharp remove routes 6.6.6.1 4"') net["r1"].cmd('vtysh -c "c t" -c "no ip route 6.6.6.0/24 1.1.1.1"') net["r1"].cmd('vtysh -c "sharp remove routes 7.7.7.7 1"') + net["r1"].cmd('vtysh -c "sharp remove routes 8.8.8.8 1"') def test_rip_status():