]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Kernel version check for topojson scripts.
authornaveen <nguggarigoud@vmware.com>
Wed, 12 Aug 2020 05:45:57 +0000 (11:15 +0530)
committernguggarigoud <nguggarigoud@vmware.com>
Tue, 15 Sep 2020 10:14:10 +0000 (15:44 +0530)
1. Added linux kernel version check to avoid failures
in CI systems if matching kernel version not found.

Signed-off-by: naveen <nguggarigoud@vmware.com>
tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py
tests/topotests/bgp-ecmp-topo2/test_ebgp_ecmp_topo2.py
tests/topotests/bgp-ecmp-topo2/test_ibgp_ecmp_topo2.py
tests/topotests/bgp_as_allow_in/test_bgp_as_allow_in.py
tests/topotests/bgp_communities_topo1/test_bgp_communities.py
tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py
tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2.py
tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py
tests/topotests/bgp_large_community/test_bgp_large_community_topo_2.py
tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py
tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py

index 69e050caedf17fee4c39b6621e5417306f144a9e..7e7155e8fad05af87cda659837a66ef8680d925c 100755 (executable)
@@ -46,8 +46,9 @@ import sys
 import json
 import time
 import pytest
+import platform
 from copy import deepcopy
-
+from lib.topotest import version_cmp
 # Save the Current Working Directory to find configuration files.
 CWD = os.path.dirname(os.path.realpath(__file__))
 sys.path.append(os.path.join(CWD, "../"))
index 948f641afbc33cd45f8c63e680684a471a4d5ed0..6059060729e5759aaba4048923d39afab08fce25 100755 (executable)
@@ -41,7 +41,7 @@ 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__))
 sys.path.append(os.path.join(CWD, "../"))
@@ -51,7 +51,7 @@ sys.path.append(os.path.join(CWD, "../../"))
 # Import topogen and topotest helpers
 from lib.topogen import Topogen, get_topogen
 from mininet.topo import Topo
-
+from lib.topotest import version_cmp
 from lib.common_config import (
     start_topology,
     write_test_header,
@@ -124,6 +124,11 @@ 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)
+
     # Don't run this test if we have any failure.
     if tgen.routers_have_failure():
         pytest.skip(tgen.errors)
index 5b997fdd1624c119c5751dfce057131c7592c2da..81486dd2a19859ea6c33f5c7ea535cacb5cc01f3 100755 (executable)
@@ -41,7 +41,7 @@ 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__))
 sys.path.append(os.path.join(CWD, "../"))
@@ -51,7 +51,7 @@ sys.path.append(os.path.join(CWD, "../../"))
 # Import topogen and topotest helpers
 from lib.topogen import Topogen, get_topogen
 from mininet.topo import Topo
-
+from lib.topotest import version_cmp
 from lib.common_config import (
     start_topology,
     write_test_header,
@@ -124,6 +124,11 @@ 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)
+
     # Don't run this test if we have any failure.
     if tgen.routers_have_failure():
         pytest.skip(tgen.errors)
index 89b15c46d37df061370d60f9a18a2aa40630f6b4..197a2619aa62a6f1c484ca3a3631ee3ee2541f1e 100755 (executable)
@@ -43,7 +43,7 @@ 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__))
 sys.path.append(os.path.join(CWD, "../"))
@@ -53,7 +53,7 @@ sys.path.append(os.path.join(CWD, "../lib/"))
 # 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,
@@ -129,6 +129,11 @@ 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
index 7d960d69167e0ea20faca249764302d00a681a9a..2726f65ad9e3958a0572a24de3fef5ffd7e384b8 100644 (file)
@@ -31,6 +31,7 @@ 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__))
@@ -40,7 +41,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,
@@ -119,6 +120,11 @@ 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
index fdc1bed52219a1e47ebea72b002c7f745b1dbce5..fc6c528f7160006c9e809fc59a1581a2a8a34363 100755 (executable)
@@ -91,6 +91,7 @@ import json
 import time
 import inspect
 import pytest
+import platform
 from time import sleep
 
 # Save the Current Working Directory to find configuration files.
@@ -103,7 +104,7 @@ sys.path.append(os.path.join("../lib/"))
 from lib import topotest
 from lib.topogen import Topogen, TopoRouter, get_topogen
 from lib.topolog import logger
-
+from lib.topotest import version_cmp
 # Required to instantiate the topology builder class.
 from mininet.topo import Topo
 
@@ -206,6 +207,11 @@ 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)
+
     # Don't run this test if we have any failure.
     if tgen.routers_have_failure():
         pytest.skip(tgen.errors)
index 83a04f491f36dd2ea193f32d034484e7d374de28..49045f2bb6964bbd0c07099c4486d03c49784b1c 100755 (executable)
@@ -87,6 +87,7 @@ import sys
 import json
 import time
 import pytest
+import platform
 from time import sleep
 from copy import deepcopy
 
@@ -100,7 +101,7 @@ sys.path.append(os.path.join("../lib/"))
 from lib import topotest
 from lib.topogen import Topogen, TopoRouter, get_topogen
 from lib.topolog import logger
-
+from lib.topotest import version_cmp
 # Required to instantiate the topology builder class.
 from mininet.topo import Topo
 
@@ -202,6 +203,11 @@ 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)
+
     # Api call verify whether BGP is converged
     ADDR_TYPES = check_address_types()
 
index 334aaebb4b29ad61ba305e24cd288c824b163837..baa0653dc2203dfef968f48013d50737b8156ffe 100755 (executable)
@@ -51,7 +51,8 @@ import time
 from os import path as os_path
 import sys
 from json import load as json_load
-
+import platform
+from lib.topotest import version_cmp
 # Required to instantiate the topology builder class.
 from lib.topogen import Topogen, get_topogen
 from mininet.topo import Topo
@@ -160,6 +161,11 @@ 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
 
index 502a9a9ec4449665b76407ab482ee842a6c024aa..5ec663c633e216014bdbcfc976f1c140529c0f69 100755 (executable)
@@ -64,7 +64,7 @@ import sys
 import json
 import pytest
 import time
-
+import platform
 # Save the Current Working Directory to find configuration files.
 CWD = os.path.dirname(os.path.realpath(__file__))
 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
 from lib.topogen import Topogen, get_topogen
 from mininet.topo import Topo
-
+from lib.topotest import version_cmp
 from lib.common_config import (
     start_topology,
     write_test_header,
@@ -150,6 +150,11 @@ 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, ADDR_TYPES
 
index a37e3f36a352de1f05b76cf47357c70c119d681e..74cbda6a259d5673394ba17aeb2194f0c55eeb01 100755 (executable)
@@ -102,6 +102,7 @@ import sys
 import json
 import time
 import pytest
+import platform
 from copy import deepcopy
 
 # Save the Current Working Directory to find configuration files.
@@ -115,7 +116,7 @@ sys.path.append(os.path.join(CWD, "../lib/"))
 # Import topogen and topotest helpers
 from lib.topogen import Topogen, get_topogen
 from mininet.topo import Topo
-
+from lib.topotest import version_cmp
 from lib.common_config import (
     step,
     verify_rib,
@@ -230,6 +231,11 @@ 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)
+
     global BGP_CONVERGENCE
     global ADDR_TYPES
     ADDR_TYPES = check_address_types()
index c36e66a60ea325abef6f428ba39a5b38ecb67aca..f1522c2a99e40b419b259dac21993bd1fab573e1 100755 (executable)
@@ -43,9 +43,10 @@ import sys
 import json
 import time
 import pytest
+import platform
 from copy import deepcopy
 from time import sleep
-
+from lib.topotest import version_cmp
 
 # Save the Current Working Directory to find configuration files.
 CWD = os.path.dirname(os.path.realpath(__file__))
@@ -162,6 +163,11 @@ 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)
+
     global BGP_CONVERGENCE
     global ADDR_TYPES
     ADDR_TYPES = check_address_types()