diff --git a/tests/functional/pyocf/types/cache.py b/tests/functional/pyocf/types/cache.py index c4510c5..1f32d3d 100644 --- a/tests/functional/pyocf/types/cache.py +++ b/tests/functional/pyocf/types/cache.py @@ -703,6 +703,22 @@ class Cache: if c.results["error"]: raise OcfError("Loading cache device failed", c.results["error"]) + @classmethod + def load_standby_from_device(cls, device, owner=None, name="cache", cache_line_size=None): + if owner is None: + owner = OcfCtx.get_default() + + c = cls(name=name, owner=owner, cache_line_size=cache_line_size) + + c.start_cache() + try: + c.standby_load(device) + except: # noqa E722 + c.stop() + raise + + return c + @classmethod def load_from_device( cls, device, owner=None, name="cache", open_cores=True, disable_cleaner=False