Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix tests after tf disk recognition refactor #1517

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion test/functional/tests/cli/test_zero_metadata_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import time
Expand Down Expand Up @@ -221,7 +222,7 @@ def test_zero_metadata_dirty_shutdown():
TestRun.LOGGER.info("This could ended with error (expected)")

with TestRun.step("Plug cache device."):
cache_disk.plug()
cache_disk.plug_all()
time.sleep(1)

with TestRun.step("Start cache (expect to fail)."):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -130,7 +131,7 @@ async def test_data_integrity_unplug(cache_mode):
raise

with TestRun.step("Plug back the cache device"):
cache_dev.plug()
cache_dev.plug_all()

with TestRun.step("Load cache"):
cache = casadm.load_cache(cache_dev)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2020-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -227,7 +228,7 @@ def test_one_core_fail(cache_mode):
casadm.stop_all_caches()

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]))
Expand Down Expand Up @@ -311,7 +312,7 @@ def test_one_core_fail_dirty():
casadm.stop_all_caches()

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):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -92,10 +93,10 @@ def test_soft_hot_unplug_cache(cache_mode):
casadm.stop_all_caches()

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("core1", DiskTypeLowerThan("cache"))
@pytest.mark.require_disk("core2", DiskTypeLowerThan("cache"))
Expand Down Expand Up @@ -197,7 +198,7 @@ def test_soft_hot_unplug_core(cache_mode):
casadm.stop_all_caches()

with TestRun.step("Plug back core device"):
core_dev_unplugged.plug()
core_dev_unplugged.plug_all()


def fio_prepare(core):
Expand Down
13 changes: 7 additions & 6 deletions test/functional/tests/incremental_load/test_udev.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2020-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -58,7 +59,7 @@ def test_udev_core_partition():
core_disk.unplug()

with TestRun.step("Plug missing core disk."):
core_disk.plug()
core_disk.plug_all()
time.sleep(1)

with TestRun.step("List cache devices and check that created partitions are present "
Expand Down Expand Up @@ -102,7 +103,7 @@ def test_udev_core():
core_disk.unplug()

with TestRun.step("Plug core disk."):
core_disk.plug()
core_disk.plug_all()
time.sleep(1)

with TestRun.step("Check if core device is listed in core pool."):
Expand All @@ -112,7 +113,7 @@ def test_udev_core():
cache_disk.unplug()

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."):
check_if_dev_in_core_pool(core_dev, False)
Expand Down Expand Up @@ -199,7 +200,7 @@ def test_udev_cache_load(cache_mode):
cache_disk.unplug()

with TestRun.step("Plug cache disk."):
cache_disk.plug()
cache_disk.plug_all()
time.sleep(1)

with TestRun.step("List caches and check if cache is loaded."):
Expand Down Expand Up @@ -263,7 +264,7 @@ def test_neg_udev_cache_load():

with TestRun.step("Unplug and plug cache disk."):
cache_disk.unplug()
cache_disk.plug()
cache_disk.plug_all()
time.sleep(1)

with TestRun.step("Check if CAS is loaded correctly."):
Expand Down Expand Up @@ -292,7 +293,7 @@ def test_neg_udev_cache_load():

with TestRun.step("Unplug and plug core disk."):
core_disk.unplug()
core_disk.plug()
core_disk.plug_all()
time.sleep(1)

with TestRun.step("Check if two cores assigned to not loaded cache are inserted to core pool."):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -89,7 +90,7 @@ def test_recovery_unplug_cache_fs(cache_mode, cls, filesystem, direct):

with TestRun.step("Plug missing cache device."):
TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False)))
cache_disk.plug()
cache_disk.plug_all()

with TestRun.step("Load cache."):
cache = casadm.load_cache(cache_device)
Expand Down Expand Up @@ -174,7 +175,7 @@ def test_recovery_unplug_cache_raw(cache_mode, cls):

with TestRun.step("Plug missing cache device."):
TestRun.LOGGER.info(str(casadm.list_caches(by_id_path=False)))
cache_disk.plug()
cache_disk.plug_all()

with TestRun.step("Load cache."):
cache = casadm.load_cache(cache_device)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -86,7 +87,7 @@ def test_fuzzy_remove_inactive_cache_id(
)
if output.exit_code == 0:
with TestRun.step("Reload cache with inactive core"):
core_disk.plug()
core_disk.plug_all()
cache.add_core(core_dev=core_disk)
InitConfig.create_init_config_from_running_configuration()
cache.stop(no_data_flush=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_fuzzy_remove_inactive_core_id(
)
if output.exit_code == 0:
with TestRun.step("Reload cache with inactive core"):
core_disk.plug()
core_disk.plug_all()
cache.add_core(core_dev=core_disk)
InitConfig.create_init_config_from_running_configuration()
cache.stop(no_data_flush=True)
Expand Down