diff --git a/tests/topotests/all_protocol_startup/r1/ip_nht.ref b/tests/topotests/all_protocol_startup/r1/ip_nht.ref index c524d7d0fd4e..78491fbfcaac 100644 --- a/tests/topotests/all_protocol_startup/r1/ip_nht.ref +++ b/tests/topotests/all_protocol_startup/r1/ip_nht.ref @@ -76,6 +76,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 ae06b6e036db..79732ff8c02d 100644 --- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py +++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py @@ -740,6 +740,29 @@ def test_nexthop_groups(): valid is not None ), "nexthop-group control 'nexthop-behavior' command should not be modified" + ## multiple nexthop-group dependencies + net["r1"].cmd( + 'vtysh -c "c t" -c "nexthop-group group1" -c "group ecmp1" -c "group ecmp2"' + ) + net["r1"].cmd( + 'vtysh -c "c t" -c "nexthop-group ecmp1" -c "nexthop-behavior" -c "nexthop 192.168.0.202 r1-eth0"' + ) + net["r1"].cmd( + 'vtysh -c "c t" -c "nexthop-group ecmp2" -c "nexthop-behavior" -c "nexthop 192.168.0.205 r1-eth0"' + ) + net["r1"].cmd('vtysh -c "sharp install routes 8.8.8.8 nexthop-group group1 1"') + verify_route_nexthop_group("8.8.8.8/32", ecmp=2) + + net["r1"].cmd('vtysh -c "c t" -c "nexthop-group group1" -c "no group ecmp2"') + verify_route_nexthop_group("8.8.8.8/32", ecmp=1) + net["r1"].cmd( + 'vtysh -c "c t" -c "nexthop-group ecmp3" -c "nexthop-behavior" -c "nexthop 192.168.0.207 r1-eth0"' + ) + net["r1"].cmd( + 'vtysh -c "c t" -c "nexthop-group group1" -c "group ecmp3" -c "group ecmp2"' + ) + 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"') @@ -752,6 +775,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():