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 <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Jan 8, 2024
1 parent cf69fa9 commit 12793cf
Show file tree
Hide file tree
Showing 2 changed files with 36 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 @@ -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)
Expand Down
24 changes: 24 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 @@ -740,6 +740,29 @@ def test_nexthop_groups():
valid is not None
), "nexthop-group control 'protocol-controlled' 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 "protocol-controlled" -c "nexthop 192.168.0.202 r1-eth0"'
)
net["r1"].cmd(
'vtysh -c "c t" -c "nexthop-group ecmp2" -c "protocol-controlled" -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 "protocol-controlled" -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"')
Expand All @@ -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():
Expand Down

0 comments on commit 12793cf

Please sign in to comment.