Skip to content

Commit

Permalink
topotests: all_protocol_startup, add nexthop-group test for child groups
Browse files Browse the repository at this point in the history
Add a test for hierarchical nexthop groups. A nexthop group with
child nexthop groups is added and modified.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 10, 2024
1 parent e6bf079 commit 0195801
Show file tree
Hide file tree
Showing 2 changed files with 48 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 @@ -73,6 +73,18 @@ VRF default:
resolved via connected, prefix 192.168.0.0/24
is directly connected, r1-eth0 (vrf default), weight 1
Client list: static(fd XX)
192.168.0.202
resolved via connected, prefix 192.168.0.0/24
is directly connected, r1-eth0 (vrf default), weight 1
Client list: pbr(fd XX)
192.168.0.205
resolved via connected, prefix 192.168.0.0/24
is directly connected, r1-eth0 (vrf default), weight 1
Client list: pbr(fd XX)
192.168.0.207
resolved via connected, prefix 192.168.0.0/24
is directly connected, r1-eth0 (vrf default), weight 1
Client list: pbr(fd XX)
192.168.0.208
resolved via connected, prefix 192.168.0.0/24
is directly connected, r1-eth0 (vrf default), weight 1
Expand Down
36 changes: 36 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 @@ -882,6 +882,41 @@ def test_nexthop_groups():

net["r1"].cmd('vtysh -c "sharp remove routes 10.10.10.10 1"')

## child-group configration
net["r1"].cmd(
'vtysh -c "configure terminal" \
-c "nexthop-group GROUP1" \
-c "child-group ECMP1" \
-c "child-group ECMP2" \
-c "exit" \
-c "nexthop-group ECMP1" \
-c "nexthop 192.168.0.202 r1-eth0" \
-c "exit" \
-c "nexthop-group ECMP2" \
-c "nexthop 192.168.0.205 r1-eth0"'
)
sleep(1)
net["r1"].cmd('vtysh -c "sharp install routes 8.8.8.8 nexthop-group GROUP1 1\n"')
verify_route_nexthop_group("8.8.8.8/32", ecmp=2)

net["r1"].cmd(
'vtysh -c "configure terminal" \
-c "nexthop-group GROUP1" \
-c "no child-group ECMP2\n"'
)
sleep(1)
verify_route_nexthop_group("8.8.8.8/32", ecmp=1)
net["r1"].cmd(
'vtysh -c "configure terminal" \
-c "nexthop-group ECMP3" \
-c "nexthop 192.168.0.207 r1-eth0" \
-c "nexthop-group GROUP1" \
-c "child-group ECMP3" \
-c "child-group ECMP2"'
)
sleep(1)
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 @@ -893,6 +928,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 "sharp remove routes 9.9.9.9 1"')
net["r1"].cmd('vtysh -c "sharp remove routes 8.8.8.8 1"')
net["r1"].cmd('vtysh -c "c t" -c "no ip route 6.6.6.0/24 1.1.1.1"')


Expand Down

0 comments on commit 0195801

Please sign in to comment.