tests: fix tests after tf disk recognition refactor

Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
Kamil Gierszewski 2024-09-12 09:57:59 +02:00 committed by Katarzyna Treder
parent 8f5dbc997b
commit 173810ad6d
8 changed files with 24 additions and 17 deletions

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2021 Intel Corporation # Copyright(c) 2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
import time import time
@ -221,7 +222,7 @@ def test_zero_metadata_dirty_shutdown():
TestRun.LOGGER.info("This could ended with error (expected)") TestRun.LOGGER.info("This could ended with error (expected)")
with TestRun.step("Plug cache device."): with TestRun.step("Plug cache device."):
cache_disk.plug() cache_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("Start cache (expect to fail)."): with TestRun.step("Start cache (expect to fail)."):

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2022 Intel Corporation # Copyright(c) 2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -130,7 +131,7 @@ async def test_data_integrity_unplug(cache_mode):
raise raise
with TestRun.step("Plug back the cache device"): with TestRun.step("Plug back the cache device"):
cache_dev.plug() cache_dev.plug_all()
with TestRun.step("Load cache"): with TestRun.step("Load cache"):
cache = casadm.load_cache(cache_dev) cache = casadm.load_cache(cache_dev)

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2020-2022 Intel Corporation # Copyright(c) 2020-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -227,7 +228,7 @@ def test_one_core_fail(cache_mode):
casadm.stop_all_caches() casadm.stop_all_caches()
with TestRun.step("Plug back the first core."): with TestRun.step("Plug back the first core."):
core_dev1.plug() core_dev1.plug_all()
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))
@ -311,7 +312,7 @@ def test_one_core_fail_dirty():
casadm.stop_all_caches() casadm.stop_all_caches()
with TestRun.step("Plug back the first core."): with TestRun.step("Plug back the first core."):
core_dev1.plug() core_dev1.plug_all()
def dd_builder(cache_mode: CacheMode, dev: Core, size: Size): def dd_builder(cache_mode: CacheMode, dev: Core, size: Size):

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2019-2022 Intel Corporation # Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -92,10 +93,10 @@ def test_soft_hot_unplug_cache(cache_mode):
casadm.stop_all_caches() casadm.stop_all_caches()
with TestRun.step("Plug back cache device"): with TestRun.step("Plug back cache device"):
cache_dev.plug() cache_dev.plug_all()
@pytest.mark.parametrizex("cache_mode", CacheMode) @pytest.mark.parametrizex("cache_mode", [CacheMode.WO, CacheMode.WB])
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand])) @pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))
@pytest.mark.require_disk("core1", DiskTypeLowerThan("cache")) @pytest.mark.require_disk("core1", DiskTypeLowerThan("cache"))
@pytest.mark.require_disk("core2", DiskTypeLowerThan("cache")) @pytest.mark.require_disk("core2", DiskTypeLowerThan("cache"))
@ -197,7 +198,7 @@ def test_soft_hot_unplug_core(cache_mode):
casadm.stop_all_caches() casadm.stop_all_caches()
with TestRun.step("Plug back core device"): with TestRun.step("Plug back core device"):
core_dev_unplugged.plug() core_dev_unplugged.plug_all()
def fio_prepare(core): def fio_prepare(core):

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2020-2021 Intel Corporation # Copyright(c) 2020-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -58,7 +59,7 @@ def test_udev_core_partition():
core_disk.unplug() core_disk.unplug()
with TestRun.step("Plug missing core disk."): with TestRun.step("Plug missing core disk."):
core_disk.plug() core_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("List cache devices and check that created partitions are present " with TestRun.step("List cache devices and check that created partitions are present "
@ -102,7 +103,7 @@ def test_udev_core():
core_disk.unplug() core_disk.unplug()
with TestRun.step("Plug core disk."): with TestRun.step("Plug core disk."):
core_disk.plug() core_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("Check if core device is listed in core pool."): with TestRun.step("Check if core device is listed in core pool."):
@ -112,7 +113,7 @@ def test_udev_core():
cache_disk.unplug() cache_disk.unplug()
with TestRun.step("Plug cache disk."): with TestRun.step("Plug cache disk."):
cache_disk.plug() cache_disk.plug_all()
with TestRun.step("Check if core device is active and not in the core pool."): with TestRun.step("Check if core device is active and not in the core pool."):
check_if_dev_in_core_pool(core_dev, False) check_if_dev_in_core_pool(core_dev, False)
@ -199,7 +200,7 @@ def test_udev_cache_load(cache_mode):
cache_disk.unplug() cache_disk.unplug()
with TestRun.step("Plug cache disk."): with TestRun.step("Plug cache disk."):
cache_disk.plug() cache_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("List caches and check if cache is loaded."): with TestRun.step("List caches and check if cache is loaded."):
@ -263,7 +264,7 @@ def test_neg_udev_cache_load():
with TestRun.step("Unplug and plug cache disk."): with TestRun.step("Unplug and plug cache disk."):
cache_disk.unplug() cache_disk.unplug()
cache_disk.plug() cache_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("Check if CAS is loaded correctly."): with TestRun.step("Check if CAS is loaded correctly."):
@ -292,7 +293,7 @@ def test_neg_udev_cache_load():
with TestRun.step("Unplug and plug core disk."): with TestRun.step("Unplug and plug core disk."):
core_disk.unplug() core_disk.unplug()
core_disk.plug() core_disk.plug_all()
time.sleep(1) time.sleep(1)
with TestRun.step("Check if two cores assigned to not loaded cache are inserted to core pool."): with TestRun.step("Check if two cores assigned to not loaded cache are inserted to core pool."):

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2019-2021 Intel Corporation # Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -89,7 +90,7 @@ def test_recovery_unplug_cache_fs(cache_mode, cls, filesystem, direct):
with TestRun.step("Plug missing cache device."): with TestRun.step("Plug missing cache device."):
TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False))) TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False)))
cache_disk.plug() cache_disk.plug_all()
with TestRun.step("Load cache."): with TestRun.step("Load cache."):
cache = casadm.load_cache(cache_device) cache = casadm.load_cache(cache_device)
@ -174,7 +175,7 @@ def test_recovery_unplug_cache_raw(cache_mode, cls):
with TestRun.step("Plug missing cache device."): with TestRun.step("Plug missing cache device."):
TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False))) TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False)))
cache_disk.plug() cache_disk.plug_all()
with TestRun.step("Load cache."): with TestRun.step("Load cache."):
cache = casadm.load_cache(cache_device) cache = casadm.load_cache(cache_device)

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2024 Huawei Technologies Co., Ltd. # Copyright(c) 2024 Huawei Technologies Co., Ltd.
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -86,7 +87,7 @@ def test_fuzzy_remove_inactive_cache_id(
) )
if output.exit_code == 0: if output.exit_code == 0:
with TestRun.step("Reload cache with inactive core"): with TestRun.step("Reload cache with inactive core"):
core_disk.plug() core_disk.plug_all()
cache.add_core(core_dev=core_disk) cache.add_core(core_dev=core_disk)
InitConfig.create_init_config_from_running_configuration() InitConfig.create_init_config_from_running_configuration()
cache.stop(no_data_flush=True) cache.stop(no_data_flush=True)

View File

@ -86,7 +86,7 @@ def test_fuzzy_remove_inactive_core_id(
) )
if output.exit_code == 0: if output.exit_code == 0:
with TestRun.step("Reload cache with inactive core"): with TestRun.step("Reload cache with inactive core"):
core_disk.plug() core_disk.plug_all()
cache.add_core(core_dev=core_disk) cache.add_core(core_dev=core_disk)
InitConfig.create_init_config_from_running_configuration() InitConfig.create_init_config_from_running_configuration()
cache.stop(no_data_flush=True) cache.stop(no_data_flush=True)