Skip to content

Commit 4d6db6b

Browse files
authored
Merge pull request #6540 from meinaLi/netfs_size
Storage: fix resize check fail issue
2 parents 247de10 + c8684f2 commit 4d6db6b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

libvirt/tests/src/virsh_cmd/volume/virsh_vol_resize.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,15 @@ def check_vol_info(pool_vol, vol_name, test, expect_info=None):
217217
if expect_info['Allocation'] != img_info['dsize']:
218218
logging.debug("Allocation(Disk size) is %s bytes",
219219
img_info['dsize'])
220-
logging.error("Volume Allocation not equal to expect value %s",
221-
expect_info['Allocation'])
222-
check_allocation_pass = False
220+
image_mode = utils_sys.is_image_mode()
221+
if image_mode:
222+
max_allow = expect_info['Allocation'] * 1.4
223+
if img_info['dsize'] <= max_allow:
224+
check_allocation_pass = True
225+
else:
226+
logging.error("Volume Allocation not equal to expect value %s",
227+
expect_info['Allocation'])
228+
check_allocation_pass = False
223229
return check_capacity_pass & check_allocation_pass
224230
except KeyError as detail:
225231
test.error("Fail to check volume info:\n%s" % detail)

0 commit comments

Comments
 (0)