pyocf: Fix test_io_propagation_multiple_subvolumes

Make sure end_offset is never generated as 0. Otherwise the last volume
in the range will not get any io, leading false negative test result.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Robert Baldyga 2023-10-22 17:07:05 +02:00 committed by Michal Mielewczyk
parent 1c7de189e2
commit 8668ae9c37

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2022 Intel Corporation # Copyright(c) 2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -471,7 +472,7 @@ def test_io_propagation_multiple_subvolumes(pyocf_ctx, rand_seed):
# I/O addres range start/end offsets within a subvolume # I/O addres range start/end offsets within a subvolume
start_offset = S.from_B(random.randint(0, vol_size.B // 512 - 1) * 512) start_offset = S.from_B(random.randint(0, vol_size.B // 512 - 1) * 512)
end_offset = S.from_B(random.randint(0, vol_size.B // 512 - 1) * 512) end_offset = S.from_B(random.randint(1, vol_size.B // 512 - 1) * 512)
size = (vol_size - start_offset) + (subvol_count - 2) * vol_size + end_offset size = (vol_size - start_offset) + (subvol_count - 2) * vol_size + end_offset
addr = first_idx * vol_size + start_offset addr = first_idx * vol_size + start_offset