From 47fed904b3f1e6744a5d56f4305a61b387f02f1e Mon Sep 17 00:00:00 2001 From: vamahaja Date: Thu, 13 Aug 2020 18:50:08 +0530 Subject: [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 --- tests/functional/heketi/test_block_volumes_heketi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/functional/heketi/test_block_volumes_heketi.py') 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): -- cgit