From 8668ae9c3785158463529d280a861eed341e11d7 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Sun, 22 Oct 2023 17:07:05 +0200 Subject: [PATCH] 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 Signed-off-by: Michal Mielewczyk --- tests/functional/tests/management/test_composite_volume.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional/tests/management/test_composite_volume.py b/tests/functional/tests/management/test_composite_volume.py index 531a603..9023616 100644 --- a/tests/functional/tests/management/test_composite_volume.py +++ b/tests/functional/tests/management/test_composite_volume.py @@ -1,5 +1,6 @@ # # Copyright(c) 2022 Intel Corporation +# Copyright(c) 2024 Huawei Technologies # 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 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 addr = first_idx * vol_size + start_offset