From ec3024a56bb2ce12772dcf95450d372e38824da1 Mon Sep 17 00:00:00 2001 From: Sri Vignesh Date: Thu, 3 Dec 2020 15:07:03 +0530 Subject: [TestFix] Add Cleanup for multiple BHV's created Change-Id: Ic2770fa6039985bafcc91bb05bf8c8ffe288544f Signed-off-by: Sri Vignesh --- tests/functional/heketi/test_heketi_create_volume.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/functional/heketi/test_heketi_create_volume.py') 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")): -- cgit