summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/baseclass.py6
-rw-r--r--tests/functional/heketi/test_create_distributed_replica_heketi_volume.py12
2 files changed, 9 insertions, 9 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/baseclass.py b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
index 80f8966..24d0499 100644
--- a/openshift-storage-libs/openshiftstoragelibs/baseclass.py
+++ b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
@@ -415,7 +415,8 @@ class BaseClass(unittest.TestCase):
return self.create_dcs_with_pvc(pvc_name, timeout, wait_step)[pvc_name]
def create_heketi_volume_with_name_and_wait(
- self, name, size, timeout=600, wait_step=10, **kwargs):
+ self, name, size, raise_on_cleanup_error=True,
+ timeout=600, wait_step=10, **kwargs):
json = kwargs.get("json", False)
try:
@@ -445,7 +446,8 @@ class BaseClass(unittest.TestCase):
self.addCleanup(
heketi_volume_delete, self.heketi_client_node,
- self.heketi_server_url, h_volume_info["id"])
+ self.heketi_server_url, h_volume_info["id"],
+ raise_on_error=raise_on_cleanup_error)
return h_volume_info
diff --git a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
index 82fcf70..7c15a23 100644
--- a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
+++ b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py
@@ -103,7 +103,8 @@ class TestHeketiVolume(BaseClass):
h_volume_name = "autotests-heketi-volume-%s" % utils.get_random_str()
try:
heketi_vol = self.create_heketi_volume_with_name_and_wait(
- h_volume_name, vol_size_gb, json=True)
+ h_volume_name, vol_size_gb, json=True,
+ raise_on_cleanup_error=False)
except AssertionError as e:
# NOTE: rare situation when we need to decrease size of a volume.
# and we expect this vol to be distributed.
@@ -116,7 +117,8 @@ class TestHeketiVolume(BaseClass):
vol_size_gb -= 1
heketi_vol = self.create_heketi_volume_with_name_and_wait(
- h_volume_name, vol_size_gb, json=True)
+ h_volume_name, vol_size_gb, json=True,
+ raise_on_cleanup_error=False)
g.log.info("Successfully created distributed volume.")
vol_name = heketi_vol['name']
@@ -192,14 +194,10 @@ class TestHeketiVolume(BaseClass):
free_space_after_creating_vol,
free_space_after_deleting_vol))
- def test_to_create_distribute_replicated_vol(self):
+ def test_to_create_and_delete_dist_rep_vol(self):
"""Validate 2x3 vol type creation when the volume cannot be
carved out of a single device
"""
- self._create_distributed_replica_vol(validate_cleanup=False)
-
- def test_to_create_and_delete_dist_rep_vol(self):
- """Validate whether deleting a dist-rep volume is handled by heketi"""
self._create_distributed_replica_vol(validate_cleanup=True)
@ddt.data(True, False)