diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-03-13 19:44:23 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-03-19 11:24:28 +0000 |
commit | 831a510f8594bb14cbb076d04fcf7d6fd52dfb38 (patch) | |
tree | 828fdf25b89bea11c125202b4504a19f08bd0164 | |
parent | 0f48f25294d63852d9cc97eda3b6467f0369a69c (diff) |
Unskip TCs with recreation of Gluster PODs
BZ-1632873 was fixed, hence, unskip test cases which were
skipped due to this BZ. Also, make it run only on containerized
Gluster clusters.
Change-Id: Iee49a303c4f191652d1c94c18e830e6d2fb4e381
3 files changed, 21 insertions, 10 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/baseclass.py b/openshift-storage-libs/openshiftstoragelibs/baseclass.py index 366af6a9..c7891608 100644 --- a/openshift-storage-libs/openshiftstoragelibs/baseclass.py +++ b/openshift-storage-libs/openshiftstoragelibs/baseclass.py @@ -258,6 +258,13 @@ class BaseClass(unittest.TestCase): timeout=timeout, wait_step=wait_step) return dc_name, pod_name + def is_containerized_gluster(self): + cmd = ("oc get pods --no-headers -l glusterfs-node=pod " + "-o=custom-columns=:.spec.nodeName") + g_nodes = command.cmd_run(cmd, self.ocp_client[0]) + g_nodes = g_nodes.split('\n') if g_nodes else g_nodes + return not not g_nodes + def _is_error_or_failure_exists(self): if hasattr(self, '_outcome'): # Python 3.4+ diff --git a/tests/functional/provisioning/test_dynamic_provisioning_block.py b/tests/functional/provisioning/test_dynamic_provisioning_block.py index 85b842eb..8b668d62 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_block.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_block.py @@ -1,5 +1,3 @@ -from unittest import skip - from glusto.core import Glusto as g from openshiftstoragelibs.baseclass import GlusterBlockBaseClass @@ -145,9 +143,13 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): ret, 0, "Failed to execute command %s on %s" % (write_data_cmd, self.node)) - @skip("Blocked by BZ-1632873") def test_dynamic_provisioning_glusterblock_glusterpod_failure(self): - """Create glusterblock PVC when gluster pod is down""" + """Create glusterblock PVC when gluster pod is down.""" + + # Check that we work with containerized Gluster + if not self.is_containerized_gluster(): + self.skipTest("Only containerized Gluster clusters are supported.") + datafile_path = '/mnt/fake_file_for_%s' % self.id() # Create DC with attached PVC @@ -170,7 +172,7 @@ class TestDynamicProvisioningBlockP0(GlusterBlockBaseClass): cmd = ("oc get pods -o wide | grep glusterfs | grep %s | " "grep -v Terminating | awk '{print $1}'") % ( gluster_pod_data["host_name"]) - for w in Waiter(600, 30): + for w in Waiter(600, 15): out = self.cmd_run(cmd) new_gluster_pod_name = out.strip().split("\n")[0].strip() if not new_gluster_pod_name: diff --git a/tests/functional/provisioning/test_dynamic_provisioning_file.py b/tests/functional/provisioning/test_dynamic_provisioning_file.py index f3b32d0f..7286fde7 100644 --- a/tests/functional/provisioning/test_dynamic_provisioning_file.py +++ b/tests/functional/provisioning/test_dynamic_provisioning_file.py @@ -1,5 +1,4 @@ import time -from unittest import skip from glusto.core import Glusto as g @@ -168,10 +167,13 @@ class TestDynamicProvisioningP0(BaseClass): ret, 0, "Failed to execute command %s on %s" % (write_data_cmd, self.node)) - @skip("Blocked by BZ-1632873") def test_dynamic_provisioning_glusterfile_glusterpod_failure(self): - """Validate dynamic provisioning for gluster file when gluster pod down - """ + """Create glusterblock PVC when gluster pod is down.""" + + # Check that we work with containerized Gluster + if not self.is_containerized_gluster(): + self.skipTest("Only containerized Gluster clusters are supported.") + mount_path = "/mnt" datafile_path = '%s/fake_file_for_%s' % (mount_path, self.id()) @@ -207,7 +209,7 @@ class TestDynamicProvisioningP0(BaseClass): cmd = ("oc get pods -o wide | grep glusterfs | grep %s | " "grep -v Terminating | awk '{print $1}'") % ( gluster_pod_data["host_name"]) - for w in Waiter(600, 30): + for w in Waiter(600, 15): out = self.cmd_run(cmd) new_gluster_pod_name = out.strip().split("\n")[0].strip() if not new_gluster_pod_name: |