Skip to content

Commit 8ca0e24

Browse files
committed
tests: topotests: EVPN VXLAN MH extern learn mode tests
Topotests added under bgp_evpn_mh_l2l3vni_ext_learn to: - Validate correct ES discovery and advertisement for both local and remote PEs. - Check VTEP peer lists for accuracy, including handling of downed VTEPs and ES state transitions. - Ensure L2VNI and L3VNI are correctly instantiated and associated with the appropriate VRFs and VXLAN interfaces. - Test orphaned hosts, dual-attached hosts, and single-attached hosts in various failure and recovery scenarios. - MAC 'protocol' state transitions i.e data plane learnt to control plane learnt and vice versa, delete, relearn in both peers sequences Utility and Parser Functions: Utility functions in lib/bgp_evpn.py(new) are added. These changes add the test coverage and reliability for EVPN VXLAN multihoming in external mode, making it easier to detect regressions and validate new features. Signed-off-by: Patrice Brissette <pbrisset@cisco.com> Signed-off-by: Tamer Ahmed <tamerahmed@microsoft.com>
1 parent ecb4f7f commit 8ca0e24

9 files changed

Lines changed: 1666 additions & 48 deletions

File tree

tests/topotests/bgp_evpn_mh/test_evpn_mh.py

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
# Required to instantiate the topology builder class.
3838
from lib.topogen import Topogen, TopoRouter, get_topogen
3939

40+
# bgp_evpn library
41+
from lib import bgp_evpn
42+
4043
#####################################################
4144
##
4245
## Network Topology Definition
@@ -210,36 +213,6 @@ def build_topo(tgen):
210213
}
211214

212215

213-
def config_bond(node, bond_name, bond_members, bond_ad_sys_mac, br):
214-
"""
215-
Used to setup bonds on the TORs and hosts for MH
216-
"""
217-
node.run("ip link add dev %s type bond mode 802.3ad" % bond_name)
218-
node.run("ip link set dev %s type bond lacp_rate 1" % bond_name)
219-
node.run("ip link set dev %s type bond miimon 100" % bond_name)
220-
node.run("ip link set dev %s type bond xmit_hash_policy layer3+4" % bond_name)
221-
node.run("ip link set dev %s type bond min_links 1" % bond_name)
222-
node.run(
223-
"ip link set dev %s type bond ad_actor_system %s" % (bond_name, bond_ad_sys_mac)
224-
)
225-
226-
for bond_member in bond_members:
227-
node.run("ip link set dev %s down" % bond_member)
228-
node.run("ip link set dev %s master %s" % (bond_member, bond_name))
229-
node.run("ip link set dev %s up" % bond_member)
230-
231-
node.run("ip link set dev %s up" % bond_name)
232-
233-
# if bridge is specified add the bond as a bridge member
234-
if br:
235-
node.run(" ip link set dev %s master bridge" % bond_name)
236-
node.run("/sbin/bridge link set dev %s priority 8" % bond_name)
237-
node.run("/sbin/bridge vlan del vid 1 dev %s" % bond_name)
238-
node.run("/sbin/bridge vlan del vid 1 untagged pvid dev %s" % bond_name)
239-
node.run("/sbin/bridge vlan add vid 1000 dev %s" % bond_name)
240-
node.run("/sbin/bridge vlan add vid 1000 untagged pvid dev %s" % bond_name)
241-
242-
243216
def attach_bond_to_bridge(node, bond_name):
244217
"""
245218
Re-attach an existing bond to the bridge with VLAN settings.
@@ -338,10 +311,10 @@ def config_tor(tor_name, tor, tor_ip, svi_pip):
338311
else:
339312
sys_mac = "44:38:39:ff:ff:02"
340313
bond_member = tor_name + "-eth2"
341-
config_bond(tor, "hostbond1", [bond_member], sys_mac, "bridge")
314+
bgp_evpn.config_bond(tor, "hostbond1", [bond_member], sys_mac, "bridge")
342315

343316
bond_member = tor_name + "-eth3"
344-
config_bond(tor, "hostbond2", [bond_member], sys_mac, "bridge")
317+
bgp_evpn.config_bond(tor, "hostbond2", [bond_member], sys_mac, "bridge")
345318

346319
# create SVI
347320
config_svi(tor, svi_pip)
@@ -361,25 +334,11 @@ def compute_host_ip_mac(host_name):
361334
return host_ip, host_mac
362335

363336

364-
def config_host(host_name, host):
365-
"""
366-
Create the dual-attached bond on host nodes for MH
367-
"""
368-
bond_members = []
369-
bond_members.append(host_name + "-eth0")
370-
bond_members.append(host_name + "-eth1")
371-
bond_name = "torbond"
372-
config_bond(host, bond_name, bond_members, "00:00:00:00:00:00", None)
373-
374-
host_ip, host_mac = compute_host_ip_mac(host_name)
375-
host.run("ip addr add %s dev %s" % (host_ip, bond_name))
376-
host.run("ip link set dev %s address %s" % (bond_name, host_mac))
377-
378-
379337
def config_hosts(tgen, hosts):
380338
for host_name in hosts:
381339
host = tgen.gears[host_name]
382-
config_host(host_name, host)
340+
host_ip, host_mac = compute_host_ip_mac(host_name)
341+
bgp_evpn.config_host(host_name, host, host_ip, host_mac)
383342

384343

385344
def setup_module(module):
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
int spine1-eth0
2+
ip addr 192.168.1.1/24
3+
!
4+
int spine1-eth1
5+
ip addr 192.168.2.1/24
6+
!
7+
int spine1-eth2
8+
ip addr 192.168.3.1/24
9+
!
10+
int spine1-eth3
11+
ip addr 192.168.4.1/24
12+
!
13+
int lo
14+
ip addr 192.168.100.13/32
15+
ip addr 192.168.100.100/32
16+
!
17+
frr defaults datacenter
18+
!
19+
router bgp 65001
20+
bgp router-id 192.168.100.13
21+
no bgp ebgp-requires-policy
22+
23+
neighbor TRANSIT_OVERLAY peer-group
24+
neighbor TRANSIT_OVERLAY remote-as external
25+
26+
neighbor 192.168.1.2 peer-group TRANSIT_OVERLAY
27+
neighbor 192.168.2.2 peer-group TRANSIT_OVERLAY
28+
neighbor 192.168.3.2 peer-group TRANSIT_OVERLAY
29+
neighbor 192.168.4.2 peer-group TRANSIT_OVERLAY
30+
redistribute connected
31+
address-family l2vpn evpn
32+
neighbor TRANSIT_OVERLAY activate
33+
exit-address-family
34+
!
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
int spine2-eth0
2+
ip addr 192.168.5.1/24
3+
!
4+
int spine2-eth1
5+
ip addr 192.168.6.1/24
6+
!
7+
int spine2-eth2
8+
ip addr 192.168.7.1/24
9+
!
10+
int spine2-eth3
11+
ip addr 192.168.8.1/24
12+
!
13+
int lo
14+
ip addr 192.168.100.14/32
15+
ip addr 192.168.100.100/32
16+
!
17+
frr defaults datacenter
18+
!
19+
router bgp 65002
20+
bgp router-id 192.168.100.14
21+
no bgp ebgp-requires-policy
22+
23+
neighbor TRANSIT_OVERLAY peer-group
24+
neighbor TRANSIT_OVERLAY remote-as external
25+
26+
neighbor 192.168.5.2 peer-group TRANSIT_OVERLAY
27+
neighbor 192.168.6.2 peer-group TRANSIT_OVERLAY
28+
neighbor 192.168.7.2 peer-group TRANSIT_OVERLAY
29+
neighbor 192.168.8.2 peer-group TRANSIT_OVERLAY
30+
redistribute connected
31+
address-family l2vpn evpn
32+
neighbor TRANSIT_OVERLAY activate
33+
exit-address-family
34+
!

0 commit comments

Comments
 (0)