From e3dec000dfdbaea0313e6c09ebaa87e4773d76f8 Mon Sep 17 00:00:00 2001 From: Piotr Debski Date: Tue, 5 Jul 2022 13:32:43 +0200 Subject: [PATCH 1/2] Fix for core pool tests Signed-off-by: Piotr Debski --- .../tests/incremental_load/test_core_pool.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/functional/tests/incremental_load/test_core_pool.py b/test/functional/tests/incremental_load/test_core_pool.py index 6afd778..32a053c 100644 --- a/test/functional/tests/incremental_load/test_core_pool.py +++ b/test/functional/tests/incremental_load/test_core_pool.py @@ -1,5 +1,5 @@ # -# Copyright(c) 2019-2021 Intel Corporation +# Copyright(c) 2019-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # @@ -37,6 +37,7 @@ def test_attach_core_pool(): core_disk.create_partitions([Size(2, Unit.GibiByte), Size(2, Unit.GibiByte)]) core_dev = core_disk.partitions[0] second_core_dev = core_disk.partitions[1] + core_1_id, core_2_id = 1, 2 with TestRun.step("Start cache."): cache = casadm.start_cache(cache_dev, force=True) @@ -48,10 +49,12 @@ def test_attach_core_pool(): cache.stop() with TestRun.step("Add previously used core device to core pool using --try-add flag."): - first_core = casadm.try_add(core_dev, cache.cache_id) + first_core = casadm.try_add(core_device=core_dev, cache_id=cache.cache_id, + core_id=core_1_id) with TestRun.step("Add different core device to core pool using --try-add flag."): - second_core = casadm.try_add(second_core_dev, cache.cache_id) + second_core = casadm.try_add(core_device=second_core_dev, cache_id=cache.cache_id, + core_id=core_2_id) with TestRun.step("Load cache."): cache = casadm.load_cache(cache_dev) @@ -86,9 +89,11 @@ def test_core_pool_exclusive_open(): core_disk.create_partitions([Size(1, Unit.GibiByte)]) core_dev = core_disk.partitions[0] core_dev.create_filesystem(Filesystem.ext4) + cache_id = 1 + core_id = 1 with TestRun.step("Add core device to core device pool using --try-add flag."): - core = casadm.try_add(core_dev, 1) + core = casadm.try_add(core_device=core_dev, cache_id=cache_id, core_id=core_id) with TestRun.step("Check if core status of added core in core pool is detached."): status = core.get_status() From be8cbcfe4308e36b3c549711ed98cfece4f85300 Mon Sep 17 00:00:00 2001 From: Piotr Debski Date: Tue, 5 Jul 2022 13:40:31 +0200 Subject: [PATCH 2/2] API fix obligatory parameter in core try add - (core id) Signed-off-by: Piotr Debski --- test/functional/api/cas/casadm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/api/cas/casadm.py b/test/functional/api/cas/casadm.py index dfce8ab..cc95a3b 100644 --- a/test/functional/api/cas/casadm.py +++ b/test/functional/api/cas/casadm.py @@ -133,9 +133,9 @@ def remove_detached(core_device: Device, shortcut: bool = False): return output -def try_add(core_device: Device, cache_id: int, core_id: int = None): +def try_add(core_device: Device, cache_id: int, core_id: int): output = TestRun.executor.run(script_try_add_cmd(str(cache_id), core_device.path, - str(core_id) if core_id is not None else None)) + str(core_id))) if output.exit_code != 0: raise CmdException("Failed to execute try add script command.", output) return Core(core_device.path, cache_id)