mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 23:58:44 +00:00
tests: fix l3mdev config in bgp_vrf_lite_ipv6_rtadv topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
This commit is contained in:
parent
f2d729056e
commit
b7589f4e5c
@ -42,6 +42,7 @@ 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
|
||||||
@ -71,22 +72,6 @@ def setup_module(mod):
|
|||||||
router_list = tgen.routers()
|
router_list = tgen.routers()
|
||||||
|
|
||||||
logger.info("Testing with VRF Lite support")
|
logger.info("Testing with VRF Lite support")
|
||||||
krel = platform.release()
|
|
||||||
|
|
||||||
# May need to adjust handling of vrf traffic depending on kernel version
|
|
||||||
l3mdev_accept = 0
|
|
||||||
if (
|
|
||||||
topotest.version_cmp(krel, "4.15") >= 0
|
|
||||||
and topotest.version_cmp(krel, "4.18") <= 0
|
|
||||||
):
|
|
||||||
l3mdev_accept = 1
|
|
||||||
|
|
||||||
if topotest.version_cmp(krel, "5.0") >= 0:
|
|
||||||
l3mdev_accept = 1
|
|
||||||
|
|
||||||
logger.info(
|
|
||||||
"krel '{0}' setting net.ipv4.tcp_l3mdev_accept={1}".format(krel, l3mdev_accept)
|
|
||||||
)
|
|
||||||
|
|
||||||
cmds = [
|
cmds = [
|
||||||
"ip link add {0}-cust1 type vrf table 1001",
|
"ip link add {0}-cust1 type vrf table 1001",
|
||||||
@ -99,15 +84,8 @@ def setup_module(mod):
|
|||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
output = tgen.net[rname].cmd(cmd.format(rname))
|
output = tgen.net[rname].cmd(cmd.format(rname))
|
||||||
|
|
||||||
output = tgen.net[rname].cmd("sysctl -n net.ipv4.tcp_l3mdev_accept")
|
# adjust handling of vrf traffic
|
||||||
logger.info(
|
adjust_router_l3mdev(tgen, rname)
|
||||||
"router {0}: existing tcp_l3mdev_accept was {1}".format(rname, output)
|
|
||||||
)
|
|
||||||
|
|
||||||
if l3mdev_accept:
|
|
||||||
output = tgen.net[rname].cmd(
|
|
||||||
"sysctl -w net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept)
|
|
||||||
)
|
|
||||||
|
|
||||||
for rname, router in router_list.items():
|
for rname, router in router_list.items():
|
||||||
router.load_config(
|
router.load_config(
|
||||||
|
Loading…
Reference in New Issue
Block a user