Merge pull request #337 from micrakow/security_test_fixes

pyocf: fix security mngmt_start_fuzzy test
This commit is contained in:
Jan Musiał 2020-01-08 15:18:39 +01:00 committed by GitHub
commit 1784d6e3a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 c_uint32_randomize: queue unblock size value to start cache with
:param cls: cache line size value to start cache with :param cls: cache line size value to start cache with
""" """
with pytest.raises(OcfError, match="OCF_ERR_INVAL"): if c_uint32_randomize > max_wb_queue_size:
try_start_cache( with pytest.raises(OcfError, match="OCF_ERR_INVAL"):
max_queue_size=max_wb_queue_size, try_start_cache(
queue_unblock_size=max_wb_queue_size + c_uint32_randomize, max_queue_size=max_wb_queue_size,
cache_mode=CacheMode.WB, queue_unblock_size=c_uint32_randomize,
cache_line_size=cls) 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 @pytest.mark.security