From 1620c544a13d8d4b2117f0af6b8ebb90c5b2618a Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Fri, 23 Jul 2021 10:29:49 +0200 Subject: [PATCH] pyocf: update cleaning policy switching test Signed-off-by: Michal Mielewczyk --- tests/functional/pyocf/types/cache.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/functional/pyocf/types/cache.py b/tests/functional/pyocf/types/cache.py index 820a794..10ef466 100644 --- a/tests/functional/pyocf/types/cache.py +++ b/tests/functional/pyocf/types/cache.py @@ -228,14 +228,16 @@ class Cache: def set_cleaning_policy(self, cleaning_policy: CleaningPolicy): self.write_lock() - status = self.owner.lib.ocf_mngt_cache_cleaning_set_policy( - self.cache_handle, cleaning_policy + c = OcfCompletion([("priv", c_void_p), ("error", c_int)]) + self.owner.lib.ocf_mngt_cache_cleaning_set_policy( + self.cache_handle, cleaning_policy, c, None ) + c.wait() self.write_unlock() - if status: - raise OcfError("Error changing cleaning policy", status) + if c.results["error"]: + raise OcfError("Error changing cleaning policy", c.results["error"]) def set_cleaning_policy_param( self, cleaning_policy: CleaningPolicy, param_id, param_value @@ -704,8 +706,7 @@ lib.ocf_mngt_cache_remove_core.argtypes = [c_void_p, c_void_p, c_void_p] lib.ocf_mngt_cache_add_core.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p] lib.ocf_cache_get_name.argtypes = [c_void_p] lib.ocf_cache_get_name.restype = c_char_p -lib.ocf_mngt_cache_cleaning_set_policy.argtypes = [c_void_p, c_uint32] -lib.ocf_mngt_cache_cleaning_set_policy.restype = c_int +lib.ocf_mngt_cache_cleaning_set_policy.argtypes = [c_void_p, c_uint32, c_void_p, c_void_p] lib.ocf_mngt_core_set_seq_cutoff_policy_all.argtypes = [c_void_p, c_uint32] lib.ocf_mngt_core_set_seq_cutoff_policy_all.restype = c_int lib.ocf_mngt_core_set_seq_cutoff_threshold_all.argtypes = [c_void_p, c_uint32]