Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/functional/pyocf/types/ctx.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# Copyright(c) 2026 Unvertical
# SPDX-License-Identifier: BSD-3-Clause
#

Expand All @@ -13,6 +14,7 @@
from .shared import OcfError
from ..ocf import OcfLib
from .queue import Queue
from .volume import Volume


class OcfCtxOps(Structure):
Expand Down Expand Up @@ -114,10 +116,12 @@ def cleanup_volume_types(self):

def stop_caches(self):
for cache in self.caches[:]:
try:
cache.get_volume().disarm()
except AttributeError:
pass
c_vol = cache.get_c_volume()
if c_vol and c_vol in Volume._instances_:
try:
Volume._instances_[c_vol].disarm()
except AttributeError:
pass
cache.stop()

def exit(self):
Expand Down
Loading