Skip to content

Commit

Permalink
topotests: all_protocol_startup, add nexthop-group test with nhg group
Browse files Browse the repository at this point in the history
An ECMP configuration is tested with nexthop group.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed May 17, 2024
1 parent 782fa5a commit 5004fba
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/topotests/all_protocol_startup/r1/ip_nht.ref
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ VRF default:
resolved via connected
is directly connected, r1-eth0 (vrf default)
Client list: static(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)
Expand Down
53 changes: 53 additions & 0 deletions tests/topotests/all_protocol_startup/test_all_protocol_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,58 @@ def test_nexthop_groups():

tgen.gears["r1"].vtysh_cmd("sharp remove routes 10.10.10.10 1")

## 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
nexthop 192.168.0.202 r1-eth0
"""
)
tgen.gears["r1"].vtysh_cmd(
"""
configure terminal
nexthop-group ECMP2
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
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"')
Expand All @@ -696,6 +748,7 @@ def test_nexthop_groups():
net["r1"].cmd('vtysh -c "sharp remove routes 5.5.5.1 1"')
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 8.8.8.8 1"')


def test_rip_status():
Expand Down

0 comments on commit 5004fba

Please sign in to comment.