mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 03:28:31 +00:00
tests: fix l3mdev config in bgp_evpn_rt5 topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
This commit is contained in:
parent
3d762f26a6
commit
a94d054dfd
@ -42,13 +42,11 @@ sys.path.append(os.path.join(CWD, "../"))
|
|||||||
from lib import topotest
|
from lib import topotest
|
||||||
from lib.topogen import Topogen, TopoRouter, get_topogen
|
from lib.topogen import Topogen, TopoRouter, get_topogen
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
|
from lib.common_config import adjust_router_l3mdev
|
||||||
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
|
|
||||||
l3mdev_accept = 0
|
|
||||||
krel = ""
|
|
||||||
|
|
||||||
|
|
||||||
class BGPEVPNTopo(Topo):
|
class BGPEVPNTopo(Topo):
|
||||||
"Test topology builder"
|
"Test topology builder"
|
||||||
@ -73,8 +71,6 @@ class BGPEVPNTopo(Topo):
|
|||||||
|
|
||||||
def setup_module(mod):
|
def setup_module(mod):
|
||||||
"Sets up the pytest environment"
|
"Sets up the pytest environment"
|
||||||
global l3mdev_accept
|
|
||||||
global krel
|
|
||||||
|
|
||||||
tgen = Topogen(BGPEVPNTopo, mod.__name__)
|
tgen = Topogen(BGPEVPNTopo, mod.__name__)
|
||||||
tgen.start_topology()
|
tgen.start_topology()
|
||||||
@ -90,18 +86,13 @@ def setup_module(mod):
|
|||||||
)
|
)
|
||||||
return pytest.skip("Skipping BGP EVPN RT5 NETNS Test. Kernel not supported")
|
return pytest.skip("Skipping BGP EVPN RT5 NETNS Test. Kernel not supported")
|
||||||
|
|
||||||
l3mdev_accept = 1
|
|
||||||
logger.info("setting net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept))
|
|
||||||
|
|
||||||
# create VRF vrf-101 on R1 and R2
|
# create VRF vrf-101 on R1 and R2
|
||||||
# create loop101
|
# create loop101
|
||||||
cmds_vrflite = [
|
cmds_vrflite = [
|
||||||
"sysctl -w net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept),
|
|
||||||
"ip link add {}-vrf-101 type vrf table 101",
|
"ip link add {}-vrf-101 type vrf table 101",
|
||||||
"ip ru add oif {}-vrf-101 table 101",
|
"ip ru add oif {}-vrf-101 table 101",
|
||||||
"ip ru add iif {}-vrf-101 table 101",
|
"ip ru add iif {}-vrf-101 table 101",
|
||||||
"ip link set dev {}-vrf-101 up",
|
"ip link set dev {}-vrf-101 up",
|
||||||
"sysctl -w net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept),
|
|
||||||
"ip link add loop101 type dummy",
|
"ip link add loop101 type dummy",
|
||||||
"ip link set dev loop101 master {}-vrf-101",
|
"ip link set dev loop101 master {}-vrf-101",
|
||||||
"ip link set dev loop101 up",
|
"ip link set dev loop101 up",
|
||||||
@ -139,6 +130,7 @@ def setup_module(mod):
|
|||||||
logger.info("result: " + output)
|
logger.info("result: " + output)
|
||||||
|
|
||||||
router = tgen.gears["r2"]
|
router = tgen.gears["r2"]
|
||||||
|
adjust_router_l3mdev(tgen, "r2")
|
||||||
for cmd in cmds_vrflite:
|
for cmd in cmds_vrflite:
|
||||||
logger.info("cmd to r2: " + cmd.format("r2"))
|
logger.info("cmd to r2: " + cmd.format("r2"))
|
||||||
output = router.run(cmd.format("r2"))
|
output = router.run(cmd.format("r2"))
|
||||||
|
Loading…
Reference in New Issue
Block a user