summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/bgp_bmp/test_bgp_bmp_1.py2
-rw-r--r--tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json8
-rw-r--r--tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json8
-rw-r--r--tests/topotests/bgp_evpn_rt5/r1/frr.conf (renamed from tests/topotests/bgp_evpn_rt5/r1/bgpd.conf)31
-rw-r--r--tests/topotests/bgp_evpn_rt5/r1/zebra.conf23
-rw-r--r--tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json8
-rw-r--r--tests/topotests/bgp_evpn_rt5/r2/frr.conf (renamed from tests/topotests/bgp_evpn_rt5/r2/bgpd.conf)16
-rw-r--r--tests/topotests/bgp_evpn_rt5/r2/zebra.conf19
-rw-r--r--tests/topotests/bgp_evpn_rt5/r3/frr.conf46
-rw-r--r--tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py59
10 files changed, 145 insertions, 75 deletions
diff --git a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py
index be3e07929..1d7aa9747 100644
--- a/tests/topotests/bgp_bmp/test_bgp_bmp_1.py
+++ b/tests/topotests/bgp_bmp/test_bgp_bmp_1.py
@@ -78,7 +78,7 @@ def setup_module(mod):
"tcpdump -nni r1-eth0 -s 0 -w {} &".format(pcap_file), stdout=None
)
- for rname, router in tgen.routers().items():
+ for _, (rname, router) in enumerate(tgen.routers().items(), 1):
logger.info("Loading router %s" % rname)
router.load_frr_config(
os.path.join(CWD, "{}/frr.conf".format(rname)),
diff --git a/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json b/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json
index 7532ce933..cfab5726e 100644
--- a/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json
+++ b/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes.json
@@ -2,8 +2,8 @@
"bgpLocalRouterId":"192.168.100.21",
"defaultLocPrf":100,
"localAS":65000,
- "192.168.101.41:2":{
- "rd":"192.168.101.41:2",
+ "65000:201":{
+ "rd":"65000:201",
"[5]:[0]:[32]:[192.168.101.41]":{
"prefix":"[5]:[0]:[32]:[192.168.101.41]",
"prefixLen":352,
@@ -65,8 +65,8 @@
]
}
},
- "192.168.102.21:2":{
- "rd":"192.168.102.21:2",
+ "65000:101":{
+ "rd":"65000:101",
"[5]:[0]:[32]:[192.168.102.21]":{
"prefix":"[5]:[0]:[32]:[192.168.102.21]",
"prefixLen":352,
diff --git a/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json b/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json
index a14ba1291..444c67e44 100644
--- a/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json
+++ b/tests/topotests/bgp_evpn_rt5/r1/bgp_l2vpn_evpn_routes_all.json
@@ -2,8 +2,8 @@
"bgpLocalRouterId":"192.168.100.21",
"defaultLocPrf":100,
"localAS":65000,
- "192.168.101.41:2":{
- "rd":"192.168.101.41:2",
+ "65000:201":{
+ "rd":"65000:201",
"[5]:[0]:[32]:[192.168.101.41]":{
"prefix":"[5]:[0]:[32]:[192.168.101.41]",
"prefixLen":352,
@@ -125,8 +125,8 @@
]
}
},
- "192.168.102.21:2":{
- "rd":"192.168.102.21:2",
+ "65000:101":{
+ "rd":"65000:101",
"[5]:[0]:[32]:[192.168.102.21]":{
"prefix":"[5]:[0]:[32]:[192.168.102.21]",
"prefixLen":352,
diff --git a/tests/topotests/bgp_evpn_rt5/r1/bgpd.conf b/tests/topotests/bgp_evpn_rt5/r1/frr.conf
index c8c4faf22..e4a805998 100644
--- a/tests/topotests/bgp_evpn_rt5/r1/bgpd.conf
+++ b/tests/topotests/bgp_evpn_rt5/r1/frr.conf
@@ -1,15 +1,36 @@
+! debug zebra vxlan
+! debug zebra kernel
+! debug zebra dplane
+! debug zebra rib
! debug bgp neighbor-events
! debug bgp updates
! debug bgp zebra
+vrf r1-vrf-101
+ vni 101
+ exit-vrf
+!
+interface r1-eth0
+ ip address 192.168.100.21/24
+!
+interface loop101 vrf r1-vrf-101
+ ip address 192.168.102.21/32
+ ipv6 address fd00::1/128
+!
router bgp 65000
bgp router-id 192.168.100.21
bgp log-neighbor-changes
no bgp default ipv4-unicast
+ no bgp ebgp-requires-policy
neighbor 192.168.100.41 remote-as 65000
neighbor 192.168.100.41 capability extended-nexthop
+ neighbor 192.168.100.61 remote-as 65500
+ neighbor 192.168.100.61 capability extended-nexthop
!
address-family l2vpn evpn
neighbor 192.168.100.41 activate
+ neighbor 192.168.100.41 route-map rmap_r1 in
+ neighbor 192.168.100.61 activate
+ neighbor 192.168.100.61 route-map rmap_r3 in
advertise-all-vni
exit-address-family
!
@@ -24,7 +45,17 @@ router bgp 65000 vrf r1-vrf-101
network fd00::1/128
exit-address-family
address-family l2vpn evpn
+ rd 65000:101
+ route-target both 65:101
advertise ipv4 unicast
advertise ipv6 unicast
exit-address-family
!
+route-map rmap_r3 deny 1
+ match evpn vni 102
+exit
+route-map rmap_r1 permit 1
+ match evpn vni 101
+exit
+
+
diff --git a/tests/topotests/bgp_evpn_rt5/r1/zebra.conf b/tests/topotests/bgp_evpn_rt5/r1/zebra.conf
deleted file mode 100644
index c3d508c2b..000000000
--- a/tests/topotests/bgp_evpn_rt5/r1/zebra.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-log stdout
-
-hostname r1
-password zebra
-
-! debug zebra vxlan
-! debug zebra kernel
-! debug zebra dplane
-! debug zebra rib
-log stdout
-vrf r1-vrf-101
- vni 101
- exit-vrf
-!
-interface r1-eth0
- ip address 192.168.100.21/24
-!
-interface loop101 vrf r1-vrf-101
- ip address 192.168.102.21/32
- ipv6 address fd00::1/128
-!
-
-
diff --git a/tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json b/tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json
index 597bca5fd..3a55a7a38 100644
--- a/tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json
+++ b/tests/topotests/bgp_evpn_rt5/r2/bgp_l2vpn_evpn_routes.json
@@ -2,8 +2,8 @@
"bgpLocalRouterId":"192.168.100.41",
"defaultLocPrf":100,
"localAS":65000,
- "192.168.101.41:2":{
- "rd":"192.168.101.41:2",
+ "65000:201":{
+ "rd":"65000:201",
"[5]:[0]:[32]:[192.168.101.41]":{
"prefix":"[5]:[0]:[32]:[192.168.101.41]",
"prefixLen":352,
@@ -63,8 +63,8 @@
]
}
},
- "192.168.102.21:2":{
- "rd":"192.168.102.21:2",
+ "65000:101":{
+ "rd":"65000:101",
"[5]:[0]:[32]:[192.168.102.21]":{
"prefix":"[5]:[0]:[32]:[192.168.102.21]",
"prefixLen":352,
diff --git a/tests/topotests/bgp_evpn_rt5/r2/bgpd.conf b/tests/topotests/bgp_evpn_rt5/r2/frr.conf
index 4f1d8e4a3..0bb4b7cab 100644
--- a/tests/topotests/bgp_evpn_rt5/r2/bgpd.conf
+++ b/tests/topotests/bgp_evpn_rt5/r2/frr.conf
@@ -1,6 +1,19 @@
+! debug zebra vxlan
! debug bgp neighbor-events
! debug bgp updates
! debug bgp zebra
+
+vrf r2-vrf-101
+ vni 101
+ exit-vrf
+!
+interface loop101 vrf r2-vrf-101
+ ip address 192.168.101.41/32
+ ipv6 address fd00::2/128
+!
+interface r2-eth0
+ ip address 192.168.100.41/24
+!
router bgp 65000
bgp router-id 192.168.100.41
bgp log-neighbor-changes
@@ -27,6 +40,8 @@ router bgp 65000 vrf r2-vrf-101
network fd00::3/128
exit-address-family
address-family l2vpn evpn
+ rd 65000:201
+ route-target both 65:101
advertise ipv4 unicast route-map rmap4
advertise ipv6 unicast route-map rmap6
exit-address-family
@@ -47,3 +62,4 @@ exit
route-map rmap6 deny 2
match ipv6 address acl6_2
exit
+
diff --git a/tests/topotests/bgp_evpn_rt5/r2/zebra.conf b/tests/topotests/bgp_evpn_rt5/r2/zebra.conf
deleted file mode 100644
index 7db40cb59..000000000
--- a/tests/topotests/bgp_evpn_rt5/r2/zebra.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-log stdout
-
-hostname r2
-password zebra
-
-! debug zebra vxlan
-
-vrf r2-vrf-101
- vni 101
- exit-vrf
-!
-interface loop101 vrf r2-vrf-101
- ip address 192.168.101.41/32
- ipv6 address fd00::2/128
-!
-interface r2-eth0
- ip address 192.168.100.41/24
-!
-
diff --git a/tests/topotests/bgp_evpn_rt5/r3/frr.conf b/tests/topotests/bgp_evpn_rt5/r3/frr.conf
new file mode 100644
index 000000000..3f3851bd8
--- /dev/null
+++ b/tests/topotests/bgp_evpn_rt5/r3/frr.conf
@@ -0,0 +1,46 @@
+! debug bgp neighbor-events
+! debug bgp updates
+! debug bgp zebra
+vrf r3-vrf-102
+ vni 102
+ exit-vrf
+!
+interface r3-eth0
+ ip address 192.168.100.61/24
+!
+interface loop102 vrf r3-vrf-102
+ ip address 192.168.102.61/32
+ ipv6 address fd00:6::1/128
+!
+router bgp 65500
+ bgp router-id 192.168.100.61
+ bgp log-neighbor-changes
+ no bgp default ipv4-unicast
+ no bgp ebgp-requires-policy
+ neighbor 192.168.100.21 remote-as 65000
+ neighbor 192.168.100.21 capability extended-nexthop
+ !
+ address-family l2vpn evpn
+ neighbor 192.168.100.21 activate
+ advertise-all-vni
+ exit-address-family
+!
+router bgp 65000 vrf r3-vrf-102
+ bgp router-id 192.168.100.61
+ bgp log-neighbor-changes
+ no bgp network import-check
+ address-family ipv4 unicast
+ network 192.168.102.102/32
+ exit-address-family
+ address-family ipv6 unicast
+ network fd00:102::1/128
+ exit-address-family
+ address-family l2vpn evpn
+ rd 65000:302
+ route-target both 65:101
+ advertise ipv4 unicast
+ advertise ipv6 unicast
+ exit-address-family
+ !
+
+
diff --git a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
index c874cbed6..2b8355af0 100644
--- a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
+++ b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
@@ -42,10 +42,12 @@ def build_topo(tgen):
tgen.add_router("r1")
tgen.add_router("r2")
+ tgen.add_router("r3")
switch = tgen.add_switch("s1")
switch.add_link(tgen.gears["r1"])
switch.add_link(tgen.gears["r2"])
+ switch.add_link(tgen.gears["r3"])
switch = tgen.add_switch("s2")
switch.add_link(tgen.gears["r1"])
@@ -53,6 +55,9 @@ def build_topo(tgen):
switch = tgen.add_switch("s3")
switch.add_link(tgen.gears["r2"])
+ switch = tgen.add_switch("s4")
+ switch.add_link(tgen.gears["r3"])
+
def setup_module(mod):
"Sets up the pytest environment"
@@ -71,16 +76,16 @@ def setup_module(mod):
)
return pytest.skip("Skipping BGP EVPN RT5 NETNS Test. Kernel not supported")
- # create VRF vrf-101 on R1 and R2
+ # create VRF vrf-101 on R1, R2, R3
# create loop101
cmds_vrflite = [
- "ip link add {}-vrf-101 type vrf table 101",
- "ip ru add oif {}-vrf-101 table 101",
- "ip ru add iif {}-vrf-101 table 101",
- "ip link set dev {}-vrf-101 up",
- "ip link add loop101 type dummy",
- "ip link set dev loop101 master {}-vrf-101",
- "ip link set dev loop101 up",
+ "ip link add {0}-vrf-{1} type vrf table {1}",
+ "ip ru add oif {0}-vrf-{1} table {1}",
+ "ip ru add iif {0}-vrf-{1} table {1}",
+ "ip link set dev {0}-vrf-{1} up",
+ "ip link add loop{1} type dummy",
+ "ip link set dev loop{1} master {0}-vrf-{1}",
+ "ip link set dev loop{1} up",
]
cmds_r2 = [ # config routing 101
@@ -92,6 +97,15 @@ def setup_module(mod):
"ip link set vxlan-101 up type bridge_slave learning off flood off mcast_flood off",
]
+ cmds_r3 = [ # config routing 102
+ "ip link add name bridge-102 up type bridge stp_state 0",
+ "ip link set bridge-102 master {}-vrf-102",
+ "ip link set dev bridge-102 up",
+ "ip link add name vxlan-102 type vxlan id 102 dstport 4789 dev r3-eth0 local 192.168.100.61",
+ "ip link set dev vxlan-102 master bridge-102",
+ "ip link set vxlan-102 up type bridge_slave learning off flood off mcast_flood off",
+ ]
+
# cmds_r1_netns_method3 = [
# "ip link add name vxlan-{1} type vxlan id {1} dstport 4789 dev {0}-eth0 local 192.168.100.21",
# "ip link set dev vxlan-{1} netns {0}-vrf-{1}",
@@ -111,8 +125,8 @@ def setup_module(mod):
router = tgen.gears["r2"]
for cmd in cmds_vrflite:
- logger.info("cmd to r2: " + cmd.format("r2"))
- output = router.cmd_raises(cmd.format("r2"))
+ logger.info("cmd to r2: " + cmd.format("r2", 101))
+ output = router.cmd_raises(cmd.format("r2", 101))
logger.info("result: " + output)
for cmd in cmds_r2:
@@ -120,6 +134,17 @@ def setup_module(mod):
output = router.cmd_raises(cmd.format("r2"))
logger.info("result: " + output)
+ router = tgen.gears["r3"]
+ for cmd in cmds_vrflite:
+ logger.info("cmd to r3: " + cmd.format("r3", 102))
+ output = router.cmd_raises(cmd.format("r3", 102))
+ logger.info("result: " + output)
+
+ for cmd in cmds_r3:
+ logger.info("cmd to r3: " + cmd.format("r3"))
+ output = router.cmd_raises(cmd.format("r3"))
+ logger.info("result: " + output)
+
tgen.net["r1"].cmd_raises(
"ip link add name vxlan-101 type vxlan id 101 dstport 4789 dev r1-eth0 local 192.168.100.21"
)
@@ -134,19 +159,13 @@ def setup_module(mod):
tgen.net["r1"].cmd_raises("ip -n r1-vrf-101 link set bridge-101 up")
tgen.net["r1"].cmd_raises("ip -n r1-vrf-101 link set vxlan-101 up")
- for rname, router in router_list.items():
+ for rname, router in tgen.routers().items():
+ logger.info("Loading router %s" % rname)
if rname == "r1":
router.use_netns_vrf()
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
+ router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
else:
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
- )
+ router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
# Initialize all routers.
tgen.start_router()