diff options
author | Sri Vignesh <sselvan@redhat.com> | 2020-12-03 15:07:03 +0530 |
---|---|---|
committer | Sri Vignesh <sselvan@redhat.com> | 2020-12-16 13:44:53 +0000 |
commit | ec3024a56bb2ce12772dcf95450d372e38824da1 (patch) | |
tree | e85809e7a802648c7e29857075b4d6f164ef9c8a /tests/functional | |
parent | 4e10579b21ae5fbc916ac5178e3ca54227f261e3 (diff) |
[TestFix] Add Cleanup for multiple BHV's created
Change-Id: Ic2770fa6039985bafcc91bb05bf8c8ffe288544f
Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/heketi/test_heketi_create_volume.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py index a5a680a4..938a568e 100644 --- a/tests/functional/heketi/test_heketi_create_volume.py +++ b/tests/functional/heketi/test_heketi_create_volume.py @@ -458,6 +458,13 @@ class TestHeketiVolume(BaseClass): h_db_check_vol_before = ( h_db_check_before.get("{}volumes".format(vol_type))) + # Get existing heketi volume list + existing_volumes = heketi_volume_list(h_node, h_url, json=True) + + # Add cleanup function to clean stale volumes created during test + self.addCleanup( + self._cleanup_heketi_volumes, existing_volumes.get("volumes")) + # Delete heketi pod to clean db operations if(h_db_check_bricks_before.get("pending") or h_db_check_vol_before.get("pending")): |