summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_gr_functionality_topo1
diff options
context:
space:
mode:
authornaveen <nguggarigoud@vmware.com>2020-08-12 11:15:57 +0530
committernguggarigoud <nguggarigoud@vmware.com>2020-09-15 15:44:10 +0530
commiteb5e807234ae269614887097507f7a82206478e3 (patch)
tree9537b61a3ef72dd2433b0ea1181c144c460673bd /tests/topotests/bgp_gr_functionality_topo1
parenteac139f8f26315076d2c5fd94e7ac2fe322be084 (diff)
tests: Kernel version check for topojson scripts.
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>
Diffstat (limited to 'tests/topotests/bgp_gr_functionality_topo1')
-rwxr-xr-xtests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py
index fdc1bed522..fc6c528f71 100755
--- a/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py
+++ b/tests/topotests/bgp_gr_functionality_topo1/test_bgp_gr_functionality_topo1.py
@@ -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)