diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2019-12-06 18:18:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 18:18:28 +0100 |
commit | a9dd82682dc343f9cdcc58dadf8f32fa16d0ddfa (patch) | |
tree | a424ee8308c6ff067061e92a2f771a8d604f5554 | |
parent | Merge pull request #5438 from sworleys/PBR-Fixes (diff) | |
parent | topotests: Adapt to linux kernel 5+ (diff) | |
download | frr-a9dd82682dc343f9cdcc58dadf8f32fa16d0ddfa.tar.xz frr-a9dd82682dc343f9cdcc58dadf8f32fa16d0ddfa.zip |
Merge pull request #5218 from mjstapp/fix_topo_kernel_5
topotests: Adapt to linux kernel 5+
-rw-r--r-- | tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py | 6 | ||||
-rw-r--r-- | tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py | 23 |
2 files changed, 27 insertions, 2 deletions
diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py index 02fba9731..e62d139a0 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/customize.py @@ -153,8 +153,10 @@ def ltemplatePreRouterStartHook(): if topotest.version_cmp(krel, '4.15') >= 0 and \ topotest.version_cmp(krel, '4.18') <= 0: l3mdev_accept = 1 - else: - l3mdev_accept = 0 + + if topotest.version_cmp(krel, '5.0') >= 0: + l3mdev_accept = 1 + logger.info('setting net.ipv4.tcp_l3mdev_accept={}'.format(l3mdev_accept)) #check for mpls if tgen.hasmpls != True: diff --git a/tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py b/tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py index 6b4df78c6..2944b3729 100644 --- a/tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py +++ b/tests/topotests/bgp_vrf_lite_ipv6_rtadv/test_bgp_vrf_lite_ipv6_rtadv.py @@ -31,6 +31,7 @@ import sys import json from functools import partial import pytest +import platform # Save the Current Working Directory to find configuration files. CWD = os.path.dirname(os.path.realpath(__file__)) @@ -68,6 +69,19 @@ def setup_module(mod): router_list = tgen.routers() 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 = ['ip link add {0}-cust1 type vrf table 1001', 'ip link add loop1 type dummy', @@ -78,6 +92,15 @@ def setup_module(mod): for cmd in cmds: output = tgen.net[rname].cmd(cmd.format(rname)) + output = tgen.net[rname].cmd('sysctl -n net.ipv4.tcp_l3mdev_accept') + logger.info( + '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.iteritems(): router.load_config( TopoRouter.RD_ZEBRA, |