Disk tools and fs tools refactor

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-11 18:58:26 +01:00
parent 940990e37a
commit f7e7d3aa7f
71 changed files with 197 additions and 172 deletions

View File

@@ -8,10 +8,11 @@ import random
import pytest
import test_tools.fs_tools
from api.cas import casadm
from core.test_run import TestRun
from storage_devices.disk import DiskType, DiskTypeLowerThan, DiskTypeSet
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
@@ -46,7 +47,7 @@ def test_remove_core_when_other_mounted_auto_numeration():
free_core = cache.add_core(core_device.partitions[0])
mounted_cores = []
for i, part in enumerate(core_device.partitions[1:]):
part.create_filesystem(Filesystem.xfs)
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
mounted_cores.append(cache.add_core(part))
mounted_cores[i].mount(
mount_point=f"{mount_point}{cache.cache_id}-{mounted_cores[i].core_id}"
@@ -90,7 +91,7 @@ def test_remove_core_when_other_mounted_custom_numeration():
mounted_cores = []
for i, part in enumerate(core_device.partitions[1:]):
part.create_filesystem(Filesystem.xfs)
test_tools.fs_utils.create_filesystem(Filesystem.xfs)
mounted_cores.append(
cache.add_core(core_dev=part, core_id=int(f"{random_prefix}{random_interfix}{i}"))
)

View File

@@ -10,6 +10,7 @@ from time import sleep
import pytest
import test_tools.fs_tools
from api.cas import casadm
from api.cas.cache_config import (
CacheMode,
@@ -21,7 +22,7 @@ from api.cas.casadm_params import StatsFilter
from core.test_run_utils import TestRun
from storage_devices.disk import DiskTypeSet, DiskTypeLowerThan, DiskType
from test_tools.dd import Dd
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_tools.udev import Udev
@@ -222,7 +223,7 @@ def test_multistream_seq_cutoff_stress_fs(streams_seq_rand, filesystem, cache_mo
with TestRun.step("Create filesystem on core device"):
cache_disk = TestRun.disks["cache"]
core_disk = TestRun.disks["core"]
core_disk.create_filesystem(filesystem)
test_tools.fs_utils.create_filesystem(filesystem)
with TestRun.step("Start cache and add core"):
cache = casadm.start_cache(cache_dev=cache_disk, cache_mode=cache_mode, force=True)