summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2018-11-24 04:47:58 +0530
committerValerii Ponomarov <vponomar@redhat.com>2018-12-17 14:43:14 +0000
commite012567e38d8f5957aa7bc27b4a35e67ba665498 (patch)
tree462808eac58497fee46322e68e78c42d1a963503 /tests
parent78d7a913a49d388d80f42e367f2cb9ff6dc5ca20 (diff)
Add 'openshift_version.py' module
With growth of amount of test cases and supported OpenShift versions we need to perform more and more version comparisons. So, this module is designed to ease such operations. Usage example: from cnslibs.common import openshift_version version = openshift_version.get_openshift_version() if '3.9' < version <= '3.11': # Do stuff for OpenShift 3.11 or 3.10 elif version <= '3.9': # Do stuff for OpenShift 3.9 or lower else: # Do stuff for higher versions than 3.11 Also, reuse it in all the existing places with version comparisons. Change-Id: Ibc27eff20ed0dff80deca73d5d156e23bda57439
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/common/provisioning/test_pv_resize.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/functional/common/provisioning/test_pv_resize.py b/tests/functional/common/provisioning/test_pv_resize.py
index 353aa220..41f5e113 100644
--- a/tests/functional/common/provisioning/test_pv_resize.py
+++ b/tests/functional/common/provisioning/test_pv_resize.py
@@ -9,13 +9,13 @@ from cnslibs.common.openshift_ops import (
oc_create_app_dc_with_io,
oc_delete,
oc_rsh,
- oc_version,
scale_dc_pod_amount_and_wait,
verify_pv_size,
verify_pvc_size,
wait_for_events,
wait_for_pod_be_ready,
wait_for_resource_absence)
+from cnslibs.common.openshift_version import get_openshift_version
from cnslibs.cns.cns_baseclass import CnsBaseClass
from cnslibs.common.exceptions import ExecutionError
from glusto.core import Glusto as g
@@ -29,8 +29,7 @@ class TestPvResizeClass(CnsBaseClass):
def setUpClass(cls):
super(TestPvResizeClass, cls).setUpClass()
cls.node = cls.ocp_master_node[0]
- cls.version = oc_version(cls.node)
- if any(v in cls.version for v in ("3.6", "3.7", "3.8")):
+ if get_openshift_version() < "3.9":
cls.skip_me = True
return
enable_pvc_resize(cls.node)