mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 20:26:36 +00:00
tests: Moving kernel version check to API.
Signed-off-by: naveen <nguggarigoud@vmware.com>
This commit is contained in:
parent
eb5e807234
commit
3dfd384ec4
@ -46,9 +46,8 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from lib.topotest import version_cmp
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(CWD, "../"))
|
sys.path.append(os.path.join(CWD, "../"))
|
||||||
@ -70,6 +69,7 @@ from lib.common_config import (
|
|||||||
create_static_routes,
|
create_static_routes,
|
||||||
verify_rib,
|
verify_rib,
|
||||||
verify_admin_distance_for_static_routes,
|
verify_admin_distance_for_static_routes,
|
||||||
|
<<<<<<< ff9ae8fbb8f14b1cf5679d3278341edd09e7d8bf
|
||||||
check_address_types,
|
check_address_types,
|
||||||
apply_raw_config,
|
apply_raw_config,
|
||||||
addKernelRoute,
|
addKernelRoute,
|
||||||
@ -77,6 +77,9 @@ from lib.common_config import (
|
|||||||
create_prefix_lists,
|
create_prefix_lists,
|
||||||
create_route_maps,
|
create_route_maps,
|
||||||
verify_bgp_community,
|
verify_bgp_community,
|
||||||
|
=======
|
||||||
|
required_linux_kernel_version
|
||||||
|
>>>>>>> tests: Moving kernel version check to API.
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import (
|
from lib.bgp import (
|
||||||
@ -138,6 +141,11 @@ def setup_module(mod):
|
|||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
|
@ -41,7 +41,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(CWD, "../"))
|
sys.path.append(os.path.join(CWD, "../"))
|
||||||
@ -51,7 +51,7 @@ sys.path.append(os.path.join(CWD, "../../"))
|
|||||||
# Import topogen and topotest helpers
|
# Import topogen and topotest helpers
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topotest import version_cmp
|
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
start_topology,
|
start_topology,
|
||||||
write_test_header,
|
write_test_header,
|
||||||
@ -61,6 +61,7 @@ from lib.common_config import (
|
|||||||
check_address_types,
|
check_address_types,
|
||||||
interface_status,
|
interface_status,
|
||||||
reset_config_on_routers,
|
reset_config_on_routers,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
|
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 NEXT_HOPS, INTF_LIST_R3, INTF_LIST_R2, TEST_STATIC
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -124,11 +130,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Don't run this test if we have any failure.
|
# Don't run this test if we have any failure.
|
||||||
if tgen.routers_have_failure():
|
if tgen.routers_have_failure():
|
||||||
pytest.skip(tgen.errors)
|
pytest.skip(tgen.errors)
|
||||||
|
@ -41,7 +41,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(CWD, "../"))
|
sys.path.append(os.path.join(CWD, "../"))
|
||||||
@ -51,7 +51,7 @@ sys.path.append(os.path.join(CWD, "../../"))
|
|||||||
# Import topogen and topotest helpers
|
# Import topogen and topotest helpers
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topotest import version_cmp
|
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
start_topology,
|
start_topology,
|
||||||
write_test_header,
|
write_test_header,
|
||||||
@ -61,6 +61,7 @@ from lib.common_config import (
|
|||||||
check_address_types,
|
check_address_types,
|
||||||
interface_status,
|
interface_status,
|
||||||
reset_config_on_routers,
|
reset_config_on_routers,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp
|
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 NEXT_HOPS, INTF_LIST_R3, INTF_LIST_R2, TEST_STATIC
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -124,11 +130,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Don't run this test if we have any failure.
|
# Don't run this test if we have any failure.
|
||||||
if tgen.routers_have_failure():
|
if tgen.routers_have_failure():
|
||||||
pytest.skip(tgen.errors)
|
pytest.skip(tgen.errors)
|
||||||
|
@ -43,7 +43,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(CWD, "../"))
|
sys.path.append(os.path.join(CWD, "../"))
|
||||||
@ -53,7 +53,7 @@ sys.path.append(os.path.join(CWD, "../lib/"))
|
|||||||
# Import topogen and topotest helpers
|
# Import topogen and topotest helpers
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from lib.topotest import version_cmp
|
|
||||||
# Import topoJson from lib, to create topology and initial configuration
|
# Import topoJson from lib, to create topology and initial configuration
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
start_topology,
|
start_topology,
|
||||||
@ -65,6 +65,7 @@ from lib.common_config import (
|
|||||||
create_route_maps,
|
create_route_maps,
|
||||||
check_address_types,
|
check_address_types,
|
||||||
step,
|
step,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import (
|
from lib.bgp import (
|
||||||
@ -112,6 +113,11 @@ def setup_module(mod):
|
|||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -129,11 +135,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Checking BGP convergence
|
# Checking BGP convergence
|
||||||
global BGP_CONVERGENCE
|
global BGP_CONVERGENCE
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
@ -31,7 +31,6 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
@ -41,7 +40,7 @@ sys.path.append(os.path.join(CWD, "../"))
|
|||||||
# Import topogen and topotest helpers
|
# Import topogen and topotest helpers
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from lib.topotest import version_cmp
|
|
||||||
# Import topoJson from lib, to create topology and initial configuration
|
# Import topoJson from lib, to create topology and initial configuration
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
start_topology,
|
start_topology,
|
||||||
@ -55,6 +54,7 @@ from lib.common_config import (
|
|||||||
create_route_maps,
|
create_route_maps,
|
||||||
create_prefix_lists,
|
create_prefix_lists,
|
||||||
create_route_maps,
|
create_route_maps,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import (
|
from lib.bgp import (
|
||||||
@ -103,6 +103,11 @@ def setup_module(mod):
|
|||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -120,11 +125,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Checking BGP convergence
|
# Checking BGP convergence
|
||||||
global BGP_CONVERGENCE
|
global BGP_CONVERGENCE
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
@ -91,7 +91,6 @@ import json
|
|||||||
import time
|
import time
|
||||||
import inspect
|
import inspect
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
@ -104,7 +103,7 @@ sys.path.append(os.path.join("../lib/"))
|
|||||||
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.topotest import version_cmp
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
|
|
||||||
@ -136,6 +135,7 @@ from lib.common_config import (
|
|||||||
kill_mininet_routers_process,
|
kill_mininet_routers_process,
|
||||||
get_frr_ipv6_linklocal,
|
get_frr_ipv6_linklocal,
|
||||||
create_route_maps,
|
create_route_maps,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
|
|
||||||
# Reading the data from JSON File for topology and configuration creation
|
# Reading the data from JSON File for topology and configuration creation
|
||||||
@ -187,6 +187,11 @@ def setup_module(mod):
|
|||||||
|
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -207,11 +212,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Don't run this test if we have any failure.
|
# Don't run this test if we have any failure.
|
||||||
if tgen.routers_have_failure():
|
if tgen.routers_have_failure():
|
||||||
pytest.skip(tgen.errors)
|
pytest.skip(tgen.errors)
|
||||||
|
@ -87,7 +87,6 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
@ -101,7 +100,7 @@ sys.path.append(os.path.join("../lib/"))
|
|||||||
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.topotest import version_cmp
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
|
|
||||||
@ -136,6 +135,7 @@ from lib.common_config import (
|
|||||||
kill_mininet_routers_process,
|
kill_mininet_routers_process,
|
||||||
get_frr_ipv6_linklocal,
|
get_frr_ipv6_linklocal,
|
||||||
create_route_maps,
|
create_route_maps,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
|
|
||||||
# Reading the data from JSON File for topology and configuration creation
|
# Reading the data from JSON File for topology and configuration creation
|
||||||
@ -184,6 +184,11 @@ def setup_module(mod):
|
|||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
@ -203,11 +208,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Api call verify whether BGP is converged
|
# Api call verify whether BGP is converged
|
||||||
ADDR_TYPES = check_address_types()
|
ADDR_TYPES = check_address_types()
|
||||||
|
|
||||||
|
@ -51,8 +51,7 @@ import time
|
|||||||
from os import path as os_path
|
from os import path as os_path
|
||||||
import sys
|
import sys
|
||||||
from json import load as json_load
|
from json import load as json_load
|
||||||
import platform
|
|
||||||
from lib.topotest import version_cmp
|
|
||||||
# Required to instantiate the topology builder class.
|
# Required to instantiate the topology builder class.
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
@ -68,6 +67,7 @@ from lib.common_config import (
|
|||||||
verify_bgp_community,
|
verify_bgp_community,
|
||||||
step,
|
step,
|
||||||
check_address_types,
|
check_address_types,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
|
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
|
||||||
@ -143,6 +143,11 @@ def setup_module(mod):
|
|||||||
|
|
||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
@ -161,11 +166,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Checking BGP convergence
|
# Checking BGP convergence
|
||||||
global bgp_convergence
|
global bgp_convergence
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
import time
|
import time
|
||||||
import platform
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
sys.path.append(os.path.join(CWD, "../"))
|
sys.path.append(os.path.join(CWD, "../"))
|
||||||
@ -75,7 +75,7 @@ sys.path.append(os.path.join(CWD, "../lib/"))
|
|||||||
# Import topoJson from lib, to create topology and initial configuration
|
# Import topoJson from lib, to create topology and initial configuration
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topotest import version_cmp
|
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
start_topology,
|
start_topology,
|
||||||
write_test_header,
|
write_test_header,
|
||||||
@ -91,6 +91,7 @@ from lib.common_config import (
|
|||||||
verify_route_maps,
|
verify_route_maps,
|
||||||
create_static_routes,
|
create_static_routes,
|
||||||
check_address_types,
|
check_address_types,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
from lib.bgp import verify_bgp_convergence, create_router_bgp, clear_bgp_and_verify
|
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
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.15')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
logger.info("=" * 40)
|
logger.info("=" * 40)
|
||||||
@ -150,11 +156,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
# Checking BGP convergence
|
# Checking BGP convergence
|
||||||
global bgp_convergence, ADDR_TYPES
|
global bgp_convergence, ADDR_TYPES
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
@ -116,7 +115,7 @@ sys.path.append(os.path.join(CWD, "../lib/"))
|
|||||||
# Import topogen and topotest helpers
|
# Import topogen and topotest helpers
|
||||||
from lib.topogen import Topogen, get_topogen
|
from lib.topogen import Topogen, get_topogen
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from lib.topotest import version_cmp
|
|
||||||
from lib.common_config import (
|
from lib.common_config import (
|
||||||
step,
|
step,
|
||||||
verify_rib,
|
verify_rib,
|
||||||
@ -133,6 +132,7 @@ from lib.common_config import (
|
|||||||
create_bgp_community_lists,
|
create_bgp_community_lists,
|
||||||
check_router_status,
|
check_router_status,
|
||||||
apply_raw_config,
|
apply_raw_config,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
|
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
@ -210,6 +210,10 @@ def setup_module(mod):
|
|||||||
|
|
||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.19')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
@ -231,11 +235,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
global BGP_CONVERGENCE
|
global BGP_CONVERGENCE
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
ADDR_TYPES = check_address_types()
|
ADDR_TYPES = check_address_types()
|
||||||
|
@ -43,10 +43,9 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import pytest
|
import pytest
|
||||||
import platform
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from lib.topotest import version_cmp
|
|
||||||
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||||
@ -79,6 +78,7 @@ from lib.common_config import (
|
|||||||
get_frr_ipv6_linklocal,
|
get_frr_ipv6_linklocal,
|
||||||
check_router_status,
|
check_router_status,
|
||||||
apply_raw_config,
|
apply_raw_config,
|
||||||
|
required_linux_kernel_version
|
||||||
)
|
)
|
||||||
|
|
||||||
from lib.topolog import logger
|
from lib.topolog import logger
|
||||||
@ -142,6 +142,10 @@ def setup_module(mod):
|
|||||||
|
|
||||||
* `mod`: module name
|
* `mod`: module name
|
||||||
"""
|
"""
|
||||||
|
# Required linux kernel version for this suite to run.
|
||||||
|
result = required_linux_kernel_version('4.19')
|
||||||
|
if result:
|
||||||
|
pytest.skip(result)
|
||||||
|
|
||||||
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
testsuite_run_time = time.asctime(time.localtime(time.time()))
|
||||||
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
logger.info("Testsuite start time: {}".format(testsuite_run_time))
|
||||||
@ -163,11 +167,6 @@ def setup_module(mod):
|
|||||||
# Creating configuration from JSON
|
# Creating configuration from JSON
|
||||||
build_config_from_json(tgen, topo)
|
build_config_from_json(tgen, topo)
|
||||||
|
|
||||||
if version_cmp(platform.release(), '4.19') < 0:
|
|
||||||
error_msg = ('These tests will not run. (have kernel "{}", '
|
|
||||||
'requires kernel >= 4.19)'.format(platform.release()))
|
|
||||||
pytest.skip(error_msg)
|
|
||||||
|
|
||||||
global BGP_CONVERGENCE
|
global BGP_CONVERGENCE
|
||||||
global ADDR_TYPES
|
global ADDR_TYPES
|
||||||
ADDR_TYPES = check_address_types()
|
ADDR_TYPES = check_address_types()
|
||||||
|
@ -36,6 +36,8 @@ import ConfigParser
|
|||||||
import traceback
|
import traceback
|
||||||
import socket
|
import socket
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
import platform
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info[0] > 2:
|
if sys.version_info[0] > 2:
|
||||||
import io
|
import io
|
||||||
@ -46,7 +48,7 @@ else:
|
|||||||
|
|
||||||
from lib.topolog import logger, logger_config
|
from lib.topolog import logger, logger_config
|
||||||
from lib.topogen import TopoRouter, get_topogen
|
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_FILE = "frr_json.conf"
|
||||||
FRRCFG_BKUP_FILE = "frr_json_initial.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))
|
logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
|
||||||
return False
|
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