Fix imports
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#
|
||||
|
||||
import math
|
||||
import posixpath
|
||||
import pytest
|
||||
|
||||
from api.cas import casadm, cli_messages
|
||||
@@ -13,8 +12,8 @@ from api.cas.cache_config import CacheLineSize
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.device import Device
|
||||
from storage_devices.disk import DiskTypeSet, DiskType
|
||||
from test_tools import disk_tools
|
||||
from connection.utils.output import CmdException
|
||||
from test_tools.disk_tools import get_block_size, get_size
|
||||
from type_def.size import Size, Unit
|
||||
|
||||
|
||||
@@ -103,8 +102,8 @@ def create_scsi_debug_device(sector_size: int, physblk_exp: int, dev_size_mb=102
|
||||
def prepare_cas_device(cache_device, core_device):
|
||||
cache = casadm.start_cache(cache_device, cache_line_size=CacheLineSize.LINE_64KiB, force=True)
|
||||
try:
|
||||
cache_dev_bs = disk_utils.get_block_size(cache_device.device_id)
|
||||
core_dev_bs = disk_utils.get_block_size(core_device.device_id)
|
||||
cache_dev_bs = get_block_size(cache_device.device_id)
|
||||
core_dev_bs = get_block_size(core_device.device_id)
|
||||
core = cache.add_core(core_device)
|
||||
if cache_dev_bs > core_dev_bs:
|
||||
TestRun.LOGGER.error(
|
||||
@@ -154,9 +153,9 @@ def compare_capabilities(cache_device, core_device, cache, core, msg):
|
||||
cli_messages.try_add_core_sector_size_mismatch)
|
||||
else:
|
||||
core_dev_sectors_num = \
|
||||
disk_utils.get_size(core_device.device_id) / disk_utils.get_block_size(
|
||||
get_size(core_device.device_id) / get_block_size(
|
||||
core_device.device_id)
|
||||
core_sectors_num = disk_utils.get_size(core.device_id) / disk_utils.get_block_size(
|
||||
core_sectors_num = get_size(core.device_id) / get_block_size(
|
||||
core.device_id)
|
||||
if core_dev_sectors_num != core_sectors_num:
|
||||
TestRun.LOGGER.error(
|
||||
|
@@ -4,7 +4,6 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
|
||||
import os
|
||||
|
||||
from test_tools.git import get_repo_files
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#
|
||||
# Copyright(c) 2020-2022 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import pytest
|
||||
|
||||
from time import sleep
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import (
|
||||
CacheMode,
|
||||
@@ -45,7 +46,7 @@ def test_flush_signal_propagation_cache():
|
||||
|
||||
with TestRun.step("Start cache on SCSI device and add core with xfs filesystem"):
|
||||
cache = casadm.start_cache(cache_dev, CacheMode.WT)
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
|
||||
core_dev.create_filesystem(Filesystem.xfs)
|
||||
core = cache.add_core(core_dev)
|
||||
|
||||
with TestRun.step("Turn off cleaning policy and sequential cutoff"):
|
||||
@@ -91,7 +92,7 @@ def test_flush_signal_propagation_core():
|
||||
|
||||
with TestRun.step("Start cache and add SCSI device with xfs filesystem as core."):
|
||||
cache = casadm.start_cache(cache_dev, CacheMode.WT)
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
|
||||
core_dev.create_filesystem(Filesystem.xfs)
|
||||
core = cache.add_core(core_dev)
|
||||
|
||||
with TestRun.step("Turn off cleaning policy and sequential cutoff"):
|
||||
|
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Copyright(c) 2022 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from api.cas.cas_packaging import Packages
|
||||
from api.cas.installer import clean_opencas_repo, rsync_opencas_sources
|
||||
from core.test_run import TestRun
|
||||
from test_tools.fs_tools import (
|
||||
@@ -17,7 +17,6 @@ from test_tools.fs_tools import (
|
||||
readlink,
|
||||
remove,
|
||||
)
|
||||
from api.cas.packaging import Packages
|
||||
|
||||
|
||||
modules_links_dir = "/lib/modules/$(uname -r)/weak-updates/block/opencas"
|
||||
|
Reference in New Issue
Block a user