mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 06:55:18 +00:00
Merge pull request #6905 from gpnaveen/topojson_kernel_version_check
tests: Kernel version check for topojson scripts.
This commit is contained in:
commit
171b364c7a
@ -76,6 +76,7 @@ from lib.common_config import (
|
||||
create_prefix_lists,
|
||||
create_route_maps,
|
||||
verify_bgp_community,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import (
|
||||
@ -137,6 +138,11 @@ def setup_module(mod):
|
||||
* `mod`: module name
|
||||
"""
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -61,6 +61,7 @@ from lib.common_config import (
|
||||
check_address_types,
|
||||
interface_status,
|
||||
reset_config_on_routers,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
|
||||
@ -108,6 +109,11 @@ def setup_module(mod):
|
||||
global NEXT_HOPS, INTF_LIST_R3, INTF_LIST_R2, TEST_STATIC
|
||||
global ADDR_TYPES
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -61,6 +61,7 @@ from lib.common_config import (
|
||||
check_address_types,
|
||||
interface_status,
|
||||
reset_config_on_routers,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
|
||||
@ -108,6 +109,11 @@ def setup_module(mod):
|
||||
global NEXT_HOPS, INTF_LIST_R3, INTF_LIST_R2, TEST_STATIC
|
||||
global ADDR_TYPES
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -65,6 +65,7 @@ from lib.common_config import (
|
||||
create_route_maps,
|
||||
check_address_types,
|
||||
step,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import (
|
||||
@ -112,6 +113,11 @@ def setup_module(mod):
|
||||
* `mod`: module name
|
||||
"""
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -54,6 +54,7 @@ from lib.common_config import (
|
||||
create_route_maps,
|
||||
create_prefix_lists,
|
||||
create_route_maps,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import (
|
||||
@ -102,6 +103,11 @@ def setup_module(mod):
|
||||
* `mod`: module name
|
||||
"""
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -135,6 +135,7 @@ from lib.common_config import (
|
||||
kill_mininet_routers_process,
|
||||
get_frr_ipv6_linklocal,
|
||||
create_route_maps,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
|
||||
# Reading the data from JSON File for topology and configuration creation
|
||||
@ -186,6 +187,11 @@ def setup_module(mod):
|
||||
|
||||
global ADDR_TYPES
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -135,6 +135,7 @@ from lib.common_config import (
|
||||
kill_mininet_routers_process,
|
||||
get_frr_ipv6_linklocal,
|
||||
create_route_maps,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
|
||||
# Reading the data from JSON File for topology and configuration creation
|
||||
@ -183,6 +184,11 @@ def setup_module(mod):
|
||||
* `mod`: module name
|
||||
"""
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
global ADDR_TYPES
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
|
@ -67,6 +67,7 @@ from lib.common_config import (
|
||||
verify_bgp_community,
|
||||
step,
|
||||
check_address_types,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
|
||||
@ -142,6 +143,11 @@ def setup_module(mod):
|
||||
|
||||
* `mod`: module name
|
||||
"""
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
global ADDR_TYPES
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
|
@ -91,6 +91,7 @@ from lib.common_config import (
|
||||
verify_route_maps,
|
||||
create_static_routes,
|
||||
check_address_types,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
from lib.topolog import logger
|
||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
|
||||
@ -133,6 +134,11 @@ def setup_module(mod):
|
||||
* `mod`: module name
|
||||
"""
|
||||
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
logger.info("=" * 40)
|
||||
|
@ -132,6 +132,7 @@ from lib.common_config import (
|
||||
create_bgp_community_lists,
|
||||
check_router_status,
|
||||
apply_raw_config,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
|
||||
from lib.topolog import logger
|
||||
@ -209,6 +210,10 @@ def setup_module(mod):
|
||||
|
||||
* `mod`: module name
|
||||
"""
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
|
@ -78,6 +78,7 @@ from lib.common_config import (
|
||||
get_frr_ipv6_linklocal,
|
||||
check_router_status,
|
||||
apply_raw_config,
|
||||
required_linux_kernel_version
|
||||
)
|
||||
|
||||
from lib.topolog import logger
|
||||
@ -141,6 +142,10 @@ def setup_module(mod):
|
||||
|
||||
* `mod`: module name
|
||||
"""
|
||||
# Required linux kernel version for this suite to run.
|
||||
result = required_linux_kernel_version('4.15')
|
||||
if result is not True:
|
||||
pytest.skip("Kernel requirements are not met")
|
||||
|
||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||
|
@ -36,6 +36,8 @@ import ConfigParser
|
||||
import traceback
|
||||
import socket
|
||||
import ipaddress
|
||||
import platform
|
||||
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
import io
|
||||
@ -46,7 +48,7 @@ else:
|
||||
|
||||
from lib.topolog import logger, logger_config
|
||||
from lib.topogen import TopoRouter, get_topogen
|
||||
from lib.topotest import interface_set_status
|
||||
from lib.topotest import interface_set_status, version_cmp
|
||||
|
||||
FRRCFG_FILE = "frr_json.conf"
|
||||
FRRCFG_BKUP_FILE = "frr_json_initial.conf"
|
||||
@ -3973,3 +3975,30 @@ def verify_vrf_vni(tgen, input_dict):
|
||||
|
||||
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
|
||||
return False
|
||||
|
||||
|
||||
def required_linux_kernel_version(required_version):
|
||||
"""
|
||||
This API is used to check linux version compatibility of the test suite.
|
||||
If version mentioned in required_version is higher than the linux kernel
|
||||
of the system, test suite will be skipped. This API returns true or errormsg.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
* `required_version` : Kernel version required for the suites to run.
|
||||
|
||||
Usage
|
||||
-----
|
||||
result = linux_kernel_version_lowerthan('4.15')
|
||||
|
||||
Returns
|
||||
-------
|
||||
errormsg(str) or True
|
||||
"""
|
||||
system_kernel = platform.release()
|
||||
if version_cmp(system_kernel, required_version) < 0:
|
||||
error_msg = ('These tests will not run on kernel "{}", '
|
||||
'they require kernel >= {})'.format(system_kernel,
|
||||
required_version ))
|
||||
return error_msg
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user