summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSri Vignesh <sselvan@redhat.com>2020-07-07 13:31:24 +0530
committerSri Vignesh <sselvan@redhat.com>2020-07-07 16:17:44 +0530
commit616c5ed78decb985366b6c827df7dd1d1346505b (patch)
tree93f6eceb3feda38ed45a1fdc07ade9df11e03cfe
parentb2868b331233dc6009b09b04eaa762b50e9b3dcd (diff)
[TestFix] Fix cleaning up resources in TC 'test_delete_heketi_volume'
Change-Id: Idf618b0f887ff56d080f99487f2c4859ddd51a21 Signed-off-by: Sri Vignesh <sselvan@redhat.com>
-rw-r--r--tests/functional/heketi/test_volume_deletion.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/functional/heketi/test_volume_deletion.py b/tests/functional/heketi/test_volume_deletion.py
index 5059002..6cb9018 100644
--- a/tests/functional/heketi/test_volume_deletion.py
+++ b/tests/functional/heketi/test_volume_deletion.py
@@ -39,21 +39,26 @@ class TestVolumeDeleteTestCases(BaseClass):
frees up used space after deletion
"""
- creation_output_dict = heketi_ops.heketi_volume_create(
+ volume_info = heketi_ops.heketi_volume_create(
self.heketi_client_node,
self.heketi_server_url, 10, json=True)
+ self.addCleanup(
+ heketi_ops.heketi_volume_delete,
+ self.heketi_client_node, self.heketi_server_url,
+ volume_info["id"], raise_on_error=False)
- volume_id = creation_output_dict["name"].strip().split("_")[1]
free_space_after_creation = self.get_free_space_summary_devices()
heketi_ops.heketi_volume_delete(
- self.heketi_client_node, self.heketi_server_url, volume_id)
+ self.heketi_client_node, self.heketi_server_url,
+ volume_info["id"])
free_space_after_deletion = self.get_free_space_summary_devices()
self.assertTrue(
free_space_after_deletion > free_space_after_creation,
- "Free space is not reclaimed after deletion of %s" % volume_id)
+ "Free space is not reclaimed after deletion "
+ "of %s" % volume_info["id"])
@pytest.mark.tier0
def test_delete_heketidb_volume(self):