From bc866e5f9a41dbac93bea9fb16a4e8217cb02b12 Mon Sep 17 00:00:00 2001 From: Michal Rakowski Date: Tue, 7 Jan 2020 08:49:37 +0100 Subject: [PATCH] pyocf: fix security mngmt_start_fuzzy test --- .../security/test_management_start_fuzzy.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/functional/tests/security/test_management_start_fuzzy.py b/tests/functional/tests/security/test_management_start_fuzzy.py index 20f1ea8..ee399a9 100644 --- a/tests/functional/tests/security/test_management_start_fuzzy.py +++ b/tests/functional/tests/security/test_management_start_fuzzy.py @@ -123,12 +123,17 @@ def test_fuzzy_start_max_queue_size(pyocf_ctx, max_wb_queue_size, c_uint32_rando :param c_uint32_randomize: queue unblock size value to start cache with :param cls: cache line size value to start cache with """ - with pytest.raises(OcfError, match="OCF_ERR_INVAL"): - try_start_cache( - max_queue_size=max_wb_queue_size, - queue_unblock_size=max_wb_queue_size + c_uint32_randomize, - cache_mode=CacheMode.WB, - cache_line_size=cls) + if c_uint32_randomize > max_wb_queue_size: + with pytest.raises(OcfError, match="OCF_ERR_INVAL"): + try_start_cache( + max_queue_size=max_wb_queue_size, + queue_unblock_size=c_uint32_randomize, + cache_mode=CacheMode.WB, + cache_line_size=cls) + else: + logger.warning(f"Test skipped for valid values: " + f"'max_queue_size={max_wb_queue_size}, " + f"queue_unblock_size={c_uint32_randomize}'.") @pytest.mark.security