diff options
author | vamahaja <vamahaja@redhat.com> | 2020-08-13 18:50:08 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-08-19 11:20:30 +0000 |
commit | 47fed904b3f1e6744a5d56f4305a61b387f02f1e (patch) | |
tree | 69cfe5aef27d6e98a949df7f425dbffbb0aa20a7 /tests/functional/heketi/test_block_volumes_heketi.py | |
parent | e62d575478bc8e74772eb2758a8faa3314472f05 (diff) |
[TestFix] Fix BHV count calculations for small size disk cluster
Fix consists of -
In case small size disk is present in cluster TC
'test_create_max_num_blockhostingvolumes' uses blockvolume size
as 0 due to default BV count, which leads to failure of BV creation.
To fix issue set BV size to 1 and BHV count to free size in case,
mod operation returns 0.
Change-Id: Ia5c656e215498acdc86383c9a771a0094de70716
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 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/functional/heketi/test_block_volumes_heketi.py b/tests/functional/heketi/test_block_volumes_heketi.py index a7905329..43c8a9ba 100644 --- a/tests/functional/heketi/test_block_volumes_heketi.py +++ b/tests/functional/heketi/test_block_volumes_heketi.py @@ -306,8 +306,12 @@ class TestBlockVolumeOps(GlusterBlockBaseClass): heketi_volume_delete, self.heketi_client_node, self.heketi_server_url, block_host_create_info["id"], raise_on_error=False) - block_vol_size = int( - block_host_create_info["blockinfo"]["freesize"] / num_of_bv) + + free_size = block_host_create_info["blockinfo"]["freesize"] + if free_size > num_of_bv: + block_vol_size = int(free_size / num_of_bv) + else: + block_vol_size, num_of_bv = 1, free_size # Create specified number of BV's in BHV's created for i in range(0, num_of_bv): |