summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py2
-rw-r--r--tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py7
-rw-r--r--tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py20
-rw-r--r--tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py8
-rw-r--r--tests/topotests/lib/common_config.py48
5 files changed, 1 insertions, 84 deletions
diff --git a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
index 320e6d430c..36605d44f0 100644
--- a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
+++ b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py
@@ -42,7 +42,6 @@ sys.path.append(os.path.join(CWD, "../"))
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-from lib.common_config import adjust_router_l3mdev
# Required to instantiate the topology builder class.
from mininet.topo import Topo
@@ -130,7 +129,6 @@ def setup_module(mod):
logger.info("result: " + output)
router = tgen.gears["r2"]
- adjust_router_l3mdev(tgen, "r2")
for cmd in cmds_vrflite:
logger.info("cmd to r2: " + cmd.format("r2"))
output = router.run(cmd.format("r2"))
diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
index 5d97537bd0..c2f85c68c4 100644
--- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
+++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py
@@ -84,7 +84,6 @@ from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
from lib.ltemplate import ltemplateRtrCmd
-from lib.common_config import adjust_router_l3mdev
# Required to instantiate the topology builder class.
from mininet.topo import Topo
@@ -176,9 +175,6 @@ def ltemplatePreRouterStartHook():
"ip link set dev {0}-cust1 up",
]
for rtr in rtrs:
- # adjust handling of VRF traffic
- adjust_router_l3mdev(tgen, rtr)
-
for cmd in cmds:
cc.doCmd(tgen, rtr, cmd.format(rtr))
cc.doCmd(tgen, rtr, "ip link set dev {0}-eth4 master {0}-cust1".format(rtr))
@@ -219,9 +215,6 @@ def ltemplatePreRouterStartHook():
"ip link set dev {0}-cust2 up",
]
for rtr in rtrs:
- # adjust handling of VRF traffic
- adjust_router_l3mdev(tgen, rtr)
-
for cmd in cmds:
cc.doCmd(tgen, rtr, cmd.format(rtr))
cc.doCmd(tgen, rtr, "ip link set dev {0}-eth0 master {0}-cust2".format(rtr))
diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py
index f7b9bad5fa..75158b127e 100644
--- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py
+++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/check_linux_vrf.py
@@ -1,24 +1,4 @@
from lib.lutil import luCommand
-from lib.common_config import kernel_requires_l3mdev_adjustment
-
-l3mdev_accept = kernel_requires_l3mdev_adjustment()
-l3mdev_rtrs = ["r1", "r3", "r4", "ce4"]
-for rtr in l3mdev_rtrs:
- luCommand(rtr, "sysctl net.ipv4.tcp_l3mdev_accept", " = \d*", "none", "")
- found = luLast()
- luCommand(
- rtr, "ss -naep", ":179", "pass", "IPv4:bgp, l3mdev{}".format(found.group(0))
- )
- luCommand(rtr, "ss -naep", ":.*:179", "pass", "IPv6:bgp")
- luCommand(
- rtr,
- "sysctl net.ipv4.tcp_l3mdev_accept",
- " = {}".format(l3mdev_accept),
- "pass",
- "l3mdev matches expected (real/expected{}/{})".format(
- found.group(0), l3mdev_accept
- ),
- )
rtrs = ["r1", "r3", "r4"]
for rtr in rtrs:
diff --git a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
index b7fe0c2ddb..ff1544e4a2 100644
--- a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
+++ b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py
@@ -41,10 +41,7 @@ from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
from lib.topotest import iproute2_is_vrf_capable
-from lib.common_config import (
- required_linux_kernel_version,
- adjust_router_l3mdev,
-)
+from lib.common_config import required_linux_kernel_version
from mininet.topo import Topo
@@ -124,9 +121,6 @@ def setup_module(mod):
for cmd in cmds:
output = tgen.net[rname].cmd(cmd.format(rname))
- # adjust handling of vrf traffic
- adjust_router_l3mdev(tgen, rname)
-
for rname, router in tgen.routers().items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py
index 5a904423c2..ee7cd6a7af 100644
--- a/tests/topotests/lib/common_config.py
+++ b/tests/topotests/lib/common_config.py
@@ -4487,51 +4487,3 @@ def verify_ip_nht(tgen, input_dict):
logger.debug("Exiting lib API: verify_ip_nht()")
return False
-
-
-def kernel_requires_l3mdev_adjustment():
- """
- Checks if the L3 master device needs to be adjusted to handle VRF traffic
- based on kernel version.
-
- Returns
- -------
- 1 or 0
- """
-
- if version_cmp(platform.release(), "4.15") >= 0:
- return 1
- return 0
-
-
-def adjust_router_l3mdev(tgen, router):
- """
- Adjusts a routers L3 master device to handle VRF traffic depending on kernel
- version.
-
- Parameters
- ----------
- * `tgen` : tgen object
- * `router` : router id to be configured.
-
- Returns
- -------
- True
- """
-
- l3mdev_accept = kernel_requires_l3mdev_adjustment()
-
- logger.info(
- "router {0}: setting net.ipv4.tcp_l3mdev_accept={1}".format(
- router, l3mdev_accept
- )
- )
-
- output = tgen.net[router].cmd("sysctl -n net.ipv4.tcp_l3mdev_accept")
- logger.info("router {0}: existing tcp_l3mdev_accept was {1}".format(router, output))
-
- tgen.net[router].cmd(
- "sysctl -w net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept)
- )
-
- return True