Fix imports
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -3,15 +3,15 @@
|
||||
# Copyright(c) 2024 Huawei Technologies
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import base64
|
||||
import os
|
||||
import posixpath
|
||||
import yaml
|
||||
|
||||
from collections import namedtuple
|
||||
from typing import List
|
||||
|
||||
import yaml
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CacheLineSize, KernelParameters, CleaningPolicy
|
||||
from core.test_run import TestRun
|
||||
@@ -67,7 +67,7 @@ def prepare_cas_instance(
|
||||
cache.set_cleaning_policy(cleaning_policy)
|
||||
|
||||
if mount_point:
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.ext4)
|
||||
core_device.create_filesystem(Filesystem.ext4)
|
||||
core = cache.add_core(core_device)
|
||||
core.mount(mount_point)
|
||||
else:
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#
|
||||
# Copyright(c) 2019-2022 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from core.test_run import TestRun
|
||||
|
@@ -6,15 +6,13 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm, cli
|
||||
from api.cas.cache_config import CacheMode
|
||||
from api.cas.casadm_params import OutputFormat
|
||||
from api.cas.init_config import InitConfig
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_tools
|
||||
from test_tools.fs_tools import Filesystem
|
||||
from test_tools.fs_tools import Filesystem, ls_item, parse_ls_output
|
||||
from test_tools.os_tools import create_user, check_if_user_exists
|
||||
from connection.utils.output import CmdException
|
||||
from type_def.size import Size, Unit
|
||||
@@ -52,18 +50,18 @@ def test_user_cli():
|
||||
cache = casadm.start_cache(cache_dev, force=True)
|
||||
|
||||
with TestRun.step("Add core to cache and mount it."):
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.ext3)
|
||||
core_part1.create_filesystem(Filesystem.ext3)
|
||||
core = cache.add_core(core_part1)
|
||||
core.mount(mount_point)
|
||||
|
||||
with TestRun.step(f"Copy casadm bin from {system_casadm_bin_path} "
|
||||
f"to {user_casadm_bin_dest_path}."):
|
||||
casadm_bin = fs_utils.parse_ls_output(fs_utils.ls_item(f"{system_casadm_bin_path}"))[0]
|
||||
casadm_bin = parse_ls_output(ls_item(f"{system_casadm_bin_path}"))[0]
|
||||
casadm_bin_copy = casadm_bin.copy(user_casadm_bin_dest_path, True)
|
||||
casadm_bin_copy.chmod_numerical(777)
|
||||
|
||||
with TestRun.step("Copy IO class config."):
|
||||
io_conf = fs_utils.parse_ls_output(fs_utils.ls_item(f"{ioclass_config_path}"))[0]
|
||||
io_conf = parse_ls_output(ls_item(f"{ioclass_config_path}"))[0]
|
||||
io_conf_copy = io_conf.copy(ioclass_config_copy_path, force=True)
|
||||
|
||||
with TestRun.step("Unmount core."):
|
||||
@@ -404,7 +402,7 @@ def test_user_service():
|
||||
cache = casadm.start_cache(cache_dev, force=True)
|
||||
|
||||
with TestRun.step("Add core to cache and mount it."):
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.ext3)
|
||||
core_dev.create_filesystem(Filesystem.ext3)
|
||||
core = cache.add_core(core_dev)
|
||||
core.mount(mount_point)
|
||||
|
||||
@@ -413,7 +411,7 @@ def test_user_service():
|
||||
|
||||
with TestRun.step(f"Copy casadm bin from {system_casadm_bin_path} "
|
||||
f"to {user_casadm_bin_dest_path}."):
|
||||
casadm_bin = fs_utils.parse_ls_output(fs_utils.ls_item(f"{system_casadm_bin_path}"))[0]
|
||||
casadm_bin = parse_ls_output(ls_item(f"{system_casadm_bin_path}"))[0]
|
||||
casadm_bin_copy = casadm_bin.copy(user_casadm_bin_dest_path, True)
|
||||
casadm_bin_copy.chmod_numerical(777)
|
||||
|
||||
|
Reference in New Issue
Block a user