diff options
| author | naveen <nguggarigoud@vmware.com> | 2020-08-12 11:15:57 +0530 | 
|---|---|---|
| committer | nguggarigoud <nguggarigoud@vmware.com> | 2020-09-15 15:44:10 +0530 | 
| commit | eb5e807234ae269614887097507f7a82206478e3 (patch) | |
| tree | 9537b61a3ef72dd2433b0ea1181c144c460673bd /tests/topotests/bgp_multi_vrf_topo1 | |
| parent | eac139f8f26315076d2c5fd94e7ac2fe322be084 (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_multi_vrf_topo1')
| -rwxr-xr-x | tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py b/tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py index a37e3f36a3..74cbda6a25 100755 --- a/tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py +++ b/tests/topotests/bgp_multi_vrf_topo1/test_bgp_multi_vrf_topo1.py @@ -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()  | 
