Merge pull request #430 from rafalste/fix_attach_load_paths

Create separate pipelines and paths for cache attach/load scenarios
This commit is contained in:
Robert Baldyga
2020-12-23 16:51:37 +01:00
committed by GitHub
14 changed files with 245 additions and 231 deletions

View File

@@ -346,7 +346,7 @@ def test_start_cache_huge_device(pyocf_ctx_log_buffer, cls):
cache_device = HugeDevice(Size.from_MiB(20))
with pytest.raises(OcfError, match="OCF_ERR_START_CACHE_FAIL"):
with pytest.raises(OcfError, match="OCF_ERR_INVAL_CACHE_DEV"):
cache = Cache.start_on_device(cache_device, cache_line_size=cls, metadata_volatile=True)
assert any(

View File

@@ -122,7 +122,7 @@ static void ocf_freelist_get_cache_line_get_fast(void **state)
will_return_maybe(__wrap_env_get_execution_context_count, num_ctxts);
will_return_maybe(__wrap_metadata_test_valid_any, false);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
ocf_freelist_populate(freelist, num_cls);
@@ -224,7 +224,7 @@ static void ocf_freelist_get_cache_line_get_slow(void **state)
/* always return exec ctx 0 */
will_return_maybe(__wrap_env_get_execution_context, 0);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
ocf_freelist_populate(freelist, num_cls);
@@ -308,7 +308,7 @@ static void ocf_freelist_get_cache_line_put(void **state)
will_return_maybe(__wrap_env_get_execution_context_count, num_ctxts);
will_return_maybe(__wrap_metadata_test_valid_any, false);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
ocf_freelist_populate(freelist, num_cls);

View File

@@ -50,7 +50,7 @@ static void ocf_freelist_init_test01(void **state)
expect_function_call(__wrap_env_get_execution_context_count);
will_return(__wrap_env_get_execution_context_count, num_ctxts);
freelist = ocf_freelist_init(cache);
ocf_freelist_init(&freelist, cache);
assert(freelist != NULL);
ocf_freelist_deinit(freelist);

View File

@@ -136,7 +136,7 @@ static void ocf_freelist_get_put_locks(void **state)
/* simulate context 1 for the entire test duration */
will_return_maybe(__wrap_env_get_execution_context, 1);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
ocf_freelist_populate(freelist, num_cls);

View File

@@ -76,7 +76,7 @@ static void ocf_freelist_populate_test01(void **state)
will_return_maybe(__wrap_env_get_execution_context_count, num_ctxts);
will_return_maybe(__wrap_metadata_test_valid_any, false);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
expect_set_info(0, PARTITION_INVALID, 1 , num_cls);
expect_set_info(1, PARTITION_INVALID, 2 , 0);
@@ -104,7 +104,7 @@ static void ocf_freelist_populate_test02(void **state)
will_return_maybe(__wrap_ocf_metadata_collision_table_entries, num_cls);
will_return_maybe(__wrap_env_get_execution_context_count, num_ctxts);
freelist = ocf_freelist_init(NULL);
ocf_freelist_init(&freelist, NULL);
/* simulate only cachelines 2, 3, 4, 7 invalid */
will_return(__wrap_metadata_test_valid_any, true);