]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/bgp_communities_topo1/test_bgp_communities.py
*: reformat python files
[mirror_frr.git] / tests / topotests / bgp_communities_topo1 / test_bgp_communities.py
index 2726f65ad9e3958a0572a24de3fef5ffd7e384b8..f2e54b24d6bc57b38b5f409c01b07397edf6402f 100644 (file)
@@ -31,7 +31,6 @@ import sys
 import time
 import json
 import pytest
-import platform
 
 # Save the Current Working Directory to find configuration files.
 CWD = os.path.dirname(os.path.realpath(__file__))
@@ -41,7 +40,7 @@ sys.path.append(os.path.join(CWD, "../"))
 # Import topogen and topotest helpers
 from mininet.topo import Topo
 from lib.topogen import Topogen, get_topogen
-from lib.topotest import version_cmp
+
 # Import topoJson from lib, to create topology and initial configuration
 from lib.common_config import (
     start_topology,
@@ -55,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 (
@@ -103,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)
@@ -120,11 +125,6 @@ def setup_module(mod):
     # Creating configuration from JSON
     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
     global BGP_CONVERGENCE
     global ADDR_TYPES