diff options
author | vamahaja <vamahaja@redhat.com> | 2019-09-03 18:40:23 +0530 |
---|---|---|
committer | vamahaja <vamahaja@redhat.com> | 2019-09-13 17:28:10 +0530 |
commit | c5c02f6402ebe010e8db71eda738857d73f7e83d (patch) | |
tree | ec11367a5a2d2282ba9e1fb1b48fe2d56562fba4 /tests/functional/heketi/test_block_volumes_heketi.py | |
parent | 610c21c8a73329a13167f47bf6de0cf66e57cd05 (diff) |
Fix test cases which are failing to delete volume after test completion
In test case when we use large disk size, heketi takes time to create
volume and due to timeout it gives error.
Add fix in such test cases to check if volume created after getting
an exception, get details of such volumes or raise exception in case
it fails to create volume.
Change-Id: I1c23a8c6558c23edf8947771e4f41a4bd3ffd66a
Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'tests/functional/heketi/test_block_volumes_heketi.py')
-rw-r--r-- | tests/functional/heketi/test_block_volumes_heketi.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/functional/heketi/test_block_volumes_heketi.py b/tests/functional/heketi/test_block_volumes_heketi.py index 5520e8bc..b6ff9ee0 100644 --- a/tests/functional/heketi/test_block_volumes_heketi.py +++ b/tests/functional/heketi/test_block_volumes_heketi.py @@ -114,16 +114,13 @@ class TestBlockVolumeOps(BaseClass): self.skipTest("Skipping the test since free_space_available %s" "is less than the default_bhv_size %s" % (free_space_available, default_bhv_size)) - block_host_create_info = heketi_volume_create( - self.heketi_client_node, self.heketi_server_url, - default_bhv_size, json=True, block=True) + h_volume_name = ( + "autotests-heketi-volume-%s" % utils.get_random_str()) + block_host_create_info = self.create_heketi_volume_with_name_and_wait( + h_volume_name, default_bhv_size, json=True, block=True) + block_vol_size = block_host_create_info["blockinfo"]["freesize"] block_hosting_vol_id = block_host_create_info["id"] - self.addCleanup(heketi_volume_delete, - self.heketi_client_node, - self.heketi_server_url, - block_hosting_vol_id, - raise_on_error=True) block_vol_info = {"blockhostingvolume": "init_value"} while (block_vol_info['blockhostingvolume'] != block_hosting_vol_id): block_vol = heketi_blockvolume_create( |