diff options
author | kasturiNarra <knarra@redhat.com> | 2019-12-10 18:16:50 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-12-12 14:36:43 +0000 |
commit | c1b6d23e29daf2da80722317ec2fd67b39523e3f (patch) | |
tree | c3a82e5e48f0c072b40e8b5af1e242b6122a2493 | |
parent | d832892648b5609f1ff0a34bfd9836946b555d69 (diff) |
Delete duplicate test "test_to_create_distribute_replicated_vol"
which completely duplicates "test_to_create_and_delete_dist_rep_vol"
in 'test_create_distributed_replica_heketi_volume.py' test module &
fix cleanup code for create_heketi_volume_with_name_and_wait in
openshift-storage-libs/openshiftstoragelibs/baseclass.py module.
Change-Id: I9b3dea28e6330e52caab09311e20b65dd48491b9
-rw-r--r-- | openshift-storage-libs/openshiftstoragelibs/baseclass.py | 6 | ||||
-rw-r--r-- | tests/functional/heketi/test_create_distributed_replica_heketi_volume.py | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/baseclass.py b/openshift-storage-libs/openshiftstoragelibs/baseclass.py index 80f89668..24d0499e 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 82fcf704..7c15a232 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) |