tests: Introduce cache/core flush test
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com> Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
committed by
Michal Mielewczyk
parent
b8ea10f30c
commit
b16b49c84d
@@ -171,6 +171,17 @@ class Core:
|
||||
if status:
|
||||
raise OcfError("Error setting core seq cut off policy promotion count", status)
|
||||
|
||||
def flush(self):
|
||||
self.cache.write_lock()
|
||||
|
||||
c = OcfCompletion([("core", c_void_p), ("priv", c_void_p), ("error", c_int)])
|
||||
self.cache.owner.lib.ocf_mngt_core_flush(self.handle, c, None)
|
||||
c.wait()
|
||||
self.cache.write_unlock()
|
||||
|
||||
if c.results["error"]:
|
||||
raise OcfError("Couldn't flush cache", c.results["error"])
|
||||
|
||||
def reset_stats(self):
|
||||
lib.ocf_core_stats_initialize(self.handle)
|
||||
|
||||
@@ -194,3 +205,5 @@ lib.ocf_core_get_info.argtypes = [c_void_p, c_void_p]
|
||||
lib.ocf_core_get_info.restype = c_int
|
||||
lib.ocf_core_stats_initialize.argtypes = [c_void_p]
|
||||
lib.ocf_core_stats_initialize.restype = c_void_p
|
||||
lib.ocf_mngt_core_flush.argtypes = [c_void_p, c_void_p, c_void_p]
|
||||
lib.ocf_mngt_core_flush.restype = c_void_p
|
||||
|
||||
Reference in New Issue
Block a user