From 58fddd360254abd66e7fb8fc8a7ee2084dabac74 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 4 Oct 2023 09:38:57 +0200 Subject: [PATCH] Test add and remove core with cache detached Signed-off-by: Michal Mielewczyk --- .../tests/management/test_attach_cache.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/functional/tests/management/test_attach_cache.py b/tests/functional/tests/management/test_attach_cache.py index 115a1c1..42d026f 100644 --- a/tests/functional/tests/management/test_attach_cache.py +++ b/tests/functional/tests/management/test_attach_cache.py @@ -1,5 +1,6 @@ # # Copyright(c) 2019-2022 Intel Corporation +# Copyright(c) 2024 Huawei Technologies # SPDX-License-Identifier: BSD-3-Clause # @@ -34,6 +35,18 @@ from pyocf.utils import Size logger = logging.getLogger(__name__) +def test_add_remove_core_detached_cache(pyocf_ctx): + cache_device = RamVolume(Size.from_MiB(50)) + core_device = RamVolume(Size.from_MiB(50)) + + cache = Cache(owner=pyocf_ctx) + cache.start_cache() + core = Core.using_device(core_device) + cache.add_core(core) + cache.remove_core(core) + cache.stop() + + @pytest.mark.parametrize("cls", CacheLineSize) @pytest.mark.parametrize("mode", [CacheMode.WB, CacheMode.WT, CacheMode.WO]) @pytest.mark.parametrize("new_cache_size", [80, 120])