Disk tools and fs tools refactor
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from datetime import timedelta
|
||||
|
||||
import test_tools.common.wait
|
||||
from core.test_run import TestRun
|
||||
from test_tools import fs_utils
|
||||
from test_tools import fs_tools
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.filesystem.file import File
|
||||
from type_def.size import Size, Unit
|
||||
|
@@ -7,12 +7,13 @@ import os
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CacheModeTrait, CacheLineSize, CleaningPolicy, \
|
||||
FlushParametersAcp
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_tools import Filesystem
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, ReadWrite
|
||||
from test_utils.filesystem.file import File
|
||||
@@ -57,7 +58,7 @@ def test_recovery_all_options(cache_mode, cache_line_size, cleaning_policy, file
|
||||
file_md5 = test_file.md5sum()
|
||||
|
||||
with TestRun.step(f"Make {filesystem} on core device."):
|
||||
core_device.create_filesystem(filesystem)
|
||||
test_tools.fs_utils.create_filesystem(filesystem)
|
||||
|
||||
with TestRun.step("Mount core device."):
|
||||
core_device.mount(mount_point)
|
||||
|
@@ -7,12 +7,12 @@ import os
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm, cli
|
||||
from api.cas.cache_config import CacheMode, CacheModeTrait, CleaningPolicy, SeqCutOffPolicy
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_utils import readlink
|
||||
from test_tools.fs_tools import readlink, Filesystem
|
||||
from test_tools.os_tools import DropCachesMode, sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from connection.utils.output import CmdException
|
||||
@@ -126,7 +126,7 @@ def test_recovery_flush_reset_fs(cache_mode, fs):
|
||||
core_device = core_disk.partitions[0]
|
||||
|
||||
with TestRun.step(f"Create {fs} filesystem on core."):
|
||||
core_device.create_filesystem(fs)
|
||||
test_tools.fs_utils.create_filesystem(fs)
|
||||
|
||||
with TestRun.step("Create test files."):
|
||||
source_file, target_file = create_test_files(test_file_size)
|
||||
|
@@ -8,11 +8,12 @@ import os
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm, cli_messages
|
||||
from api.cas.cache_config import CacheMode, CacheModeTrait, CacheLineSize
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_tools import Filesystem
|
||||
from connection.utils.output import CmdException
|
||||
from type_def.size import Size, Unit
|
||||
from tests.lazy_writes.recovery.recovery_tests_methods import create_test_files, copy_file, \
|
||||
@@ -53,7 +54,7 @@ def test_recovery_unplug_cache_fs(cache_mode, cls, filesystem, direct):
|
||||
source_file_md5 = source_file.md5sum()
|
||||
|
||||
with TestRun.step("Create filesystem on core device."):
|
||||
core_device.create_filesystem(filesystem)
|
||||
test_tools.fs_utils.create_filesystem(filesystem)
|
||||
|
||||
with TestRun.step("Start cache and add core."):
|
||||
cache = casadm.start_cache(cache_device, cache_mode, cls)
|
||||
|
@@ -7,16 +7,16 @@
|
||||
import pytest
|
||||
from datetime import timedelta
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CacheModeTrait, CleaningPolicy, SeqCutOffPolicy
|
||||
from api.cas.cli import stop_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.device import Device
|
||||
from storage_devices.disk import DiskType, DiskTypeLowerThan, DiskTypeSet
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, ReadWrite
|
||||
from test_tools.fs_utils import remove
|
||||
from test_tools.fs_tools import remove, Filesystem
|
||||
from test_utils.filesystem.file import File
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
@@ -56,7 +56,7 @@ def test_flush_over_640_gibibytes_with_fs(cache_mode, fs):
|
||||
cache = casadm.start_cache(cache_part, cache_mode)
|
||||
|
||||
with TestRun.step(f"Add core with {fs.name} filesystem to cache and mount it."):
|
||||
core_dev.create_filesystem(fs)
|
||||
test_tools.fs_utils.create_filesystem(fs)
|
||||
core = cache.add_core(core_dev)
|
||||
core.mount(mnt_point)
|
||||
|
||||
@@ -66,7 +66,7 @@ def test_flush_over_640_gibibytes_with_fs(cache_mode, fs):
|
||||
|
||||
with TestRun.step("Create a test file on a separate disk"):
|
||||
src_dir_path = "/mnt/flush_640G_test"
|
||||
separate_dev.create_filesystem(fs)
|
||||
test_tools.fs_utils.create_filesystem(fs)
|
||||
separate_dev.mount(src_dir_path)
|
||||
|
||||
test_file_main = File.create_file(f"{src_dir_path}/test_file_main")
|
||||
|
@@ -5,14 +5,14 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CleaningPolicy, CacheModeTrait, SeqCutOffPolicy
|
||||
from storage_devices.device import Device
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from core.test_run import TestRun
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_utils import create_random_test_file, remove
|
||||
from test_tools.fs_tools import create_random_test_file, remove, Filesystem
|
||||
from test_tools.iostat import IOstatBasic
|
||||
from test_utils.filesystem.file import File
|
||||
from test_tools.os_tools import sync
|
||||
@@ -180,7 +180,7 @@ def test_clean_remove_core_with_fs(cache_mode, fs):
|
||||
cache = casadm.start_cache(cache_part, cache_mode)
|
||||
|
||||
with TestRun.step(f"Add core with {fs.name} filesystem to cache and mount it."):
|
||||
core_part.create_filesystem(fs)
|
||||
test_tools.fs_utils.create_filesystem(fs)
|
||||
core = cache.add_core(core_part)
|
||||
core.mount(mnt_point)
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
import pytest
|
||||
from time import sleep
|
||||
|
||||
import test_tools.fs_tools
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import (CacheMode,
|
||||
CacheModeTrait,
|
||||
@@ -14,8 +15,7 @@ from api.cas.cache_config import (CacheMode,
|
||||
Time)
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from core.test_run import TestRun
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_utils import create_random_test_file
|
||||
from test_tools.fs_tools import create_random_test_file, Filesystem
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.scsi_debug import Logs, syslog_path
|
||||
from type_def.size import Size, Unit
|
||||
@@ -47,7 +47,7 @@ def test_flush_signal_core(cache_mode):
|
||||
|
||||
with TestRun.step("Start cache and add SCSI device with xfs filesystem as core."):
|
||||
cache = casadm.start_cache(cache_part, cache_mode)
|
||||
core_dev.create_filesystem(Filesystem.xfs)
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
|
||||
core = cache.add_core(core_dev)
|
||||
|
||||
with TestRun.step("Mount exported object."):
|
||||
@@ -145,7 +145,7 @@ def test_flush_signal_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Start SCSI device as cache and add core with xfs filesystem."):
|
||||
cache = casadm.start_cache(cache_dev, cache_mode)
|
||||
core_part.create_filesystem(Filesystem.xfs)
|
||||
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
|
||||
core = cache.add_core(core_part)
|
||||
|
||||
with TestRun.step("Mount exported object."):
|
||||
|
Reference in New Issue
Block a user