Fix imports

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-13 15:19:03 +01:00
parent f7e7d3aa7f
commit e740ce377f
111 changed files with 361 additions and 379 deletions

View File

@@ -1,5 +1,6 @@
#
# Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -12,9 +13,10 @@ from api.cas.cache_config import (CleaningPolicy,
FlushParametersAlru,
Time,
FlushParametersAcp)
from core.test_run import TestRun
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools.fio.fio import Fio
from test_tools.fio.fio_param import *
from test_tools.fio.fio_param import IoEngine, ReadWrite, CpusAllowedPolicy
from type_def.size import Size, Unit

View File

@@ -1,5 +1,6 @@
#
# Copyright(c) 2020-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -7,7 +8,6 @@ import os
import pytest
import time
import test_tools.runlevel
from api.cas import casadm, casadm_parser
from api.cas.cache_config import CacheMode
from api.cas.init_config import InitConfig
@@ -17,7 +17,7 @@ from test_tools.fs_tools import Filesystem
from test_tools.fio.fio import Fio
from test_tools.fio.fio_param import ReadWrite, IoEngine
from test_tools.os_tools import sync, drop_caches
from test_tools.runlevel import Runlevel
from test_tools.runlevel import Runlevel, change_runlevel
from type_def.size import Size, Unit
@@ -38,7 +38,7 @@ def test_init_reboot_runlevels(runlevel, cache_mode):
- Cache should be loaded successfully after reboot.
"""
with TestRun.step(f"Set runlevel to {runlevel.value}."):
test_tools.runlevel.change_runlevel(runlevel)
change_runlevel(runlevel)
with TestRun.step("Prepare CAS device."):
cache_disk = TestRun.disks['cache']
@@ -88,5 +88,5 @@ def test_init_reboot_runlevels(runlevel, cache_mode):
with TestRun.step("Stop cache and set default runlevel."):
if len(caches) != 0:
casadm.stop_all_caches()
test_tools.runlevel.change_runlevel(Runlevel.runlevel3)
change_runlevel(Runlevel.runlevel3)
TestRun.executor.reboot()

View File

@@ -1,10 +1,11 @@
#
# Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import pytest
from api.cas import casadm, casadm_parser, cli, cli_messages
from core.test_run import TestRun
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan

View File

@@ -222,7 +222,7 @@ def test_cas_startup_lazy():
core_pool_paths = {c["device_path"] for c in core_pool_list}
if core_pool_paths != expected_core_pool_paths:
TestRun.error(
TestRun.LOGGER.error(
f"Expected the following devices in core pool "
f"{expected_core_pool_paths}. Got {core_pool_paths}"
)
@@ -231,7 +231,7 @@ def test_cas_startup_lazy():
caches_paths = {c["device_path"] for c in caches_list}
if caches_paths != expected_caches_paths:
TestRun.error(
TestRun.LOGGER.error(
f"Expected the following devices as caches "
f"{expected_caches_paths}. Got {caches_paths}"
)
@@ -240,7 +240,7 @@ def test_cas_startup_lazy():
cores_paths = {c["device_path"] for c in cores_list}
if cores_paths != expected_cores_paths:
TestRun.error(
TestRun.LOGGER.error(
f"Expected the following devices as cores "
f"{expected_caches_paths}. Got {cores_paths}"
)
@@ -447,14 +447,14 @@ def test_failover_config_startup():
cores_list = get_cas_devices_dict()["cores"].values()
if len(core_pool_list) != 0:
TestRun.error(f"No cores expected in core pool. Got {core_pool_list}")
TestRun.LOGGER.error(f"No cores expected in core pool. Got {core_pool_list}")
else:
TestRun.LOGGER.info("Core pool is ok")
expected_caches_paths = set([active_cache_path, standby_cache_path])
caches_paths = {c["device"] for c in caches_list}
if caches_paths != expected_caches_paths:
TestRun.error(
TestRun.LOGGER.error(
f"Expected the following devices as caches "
f"{expected_caches_paths}. Got {caches_paths}"
)
@@ -464,7 +464,7 @@ def test_failover_config_startup():
expected_core_paths = set([active_core_path])
cores_paths = {c["device"] for c in cores_list}
if cores_paths != expected_core_paths:
TestRun.error(
TestRun.LOGGER.error(
f"Expected the following devices as cores "
f"{expected_core_paths}. Got {cores_paths}"
)