OS tools refactor
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -20,7 +20,7 @@ from test_tools.device_mapper import DmTable
|
||||
from storage_devices.error_device import ErrorDevice
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, ErrorFilter, VerifyMethod
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
start_size = Size(512, Unit.Byte)
|
||||
|
@@ -14,8 +14,8 @@ from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils import os_utils
|
||||
from test_utils.os_utils import Udev, DropCachesMode
|
||||
from test_tools.os_tools import DropCachesMode, sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from tests.lazy_writes.recovery.recovery_tests_methods import compare_files
|
||||
|
||||
@@ -65,8 +65,8 @@ def test_interrupt_core_flush(cache_mode, filesystem):
|
||||
test_file_md5sum_before = test_file.md5sum()
|
||||
|
||||
with TestRun.step("Get number of dirty data on exported object before interruption."):
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
sync()
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
core_dirty_blocks_before = core.get_dirty_blocks()
|
||||
|
||||
with TestRun.step("Start flushing core device."):
|
||||
@@ -149,8 +149,8 @@ def test_interrupt_cache_flush(cache_mode, filesystem):
|
||||
test_file_md5sum_before = test_file.md5sum()
|
||||
|
||||
with TestRun.step("Get number of dirty data on exported object before interruption."):
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
sync()
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
cache_dirty_blocks_before = cache.get_dirty_blocks()
|
||||
|
||||
with TestRun.step("Start flushing cache."):
|
||||
@@ -238,8 +238,8 @@ def test_interrupt_core_remove(cache_mode, filesystem):
|
||||
with TestRun.step(
|
||||
"Get number of dirty data on exported object before core removal interruption"
|
||||
):
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
sync()
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
cache_dirty_blocks_before = cache.get_dirty_blocks()
|
||||
|
||||
with TestRun.step("Unmount core"):
|
||||
@@ -358,8 +358,8 @@ def test_interrupt_cache_mode_switch_parametrized(cache_mode, stop_percentage):
|
||||
dd.run()
|
||||
|
||||
with TestRun.step("Get number of dirty data on exported object before interruption"):
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
sync()
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
cache_dirty_blocks_before = cache.get_dirty_blocks()
|
||||
|
||||
with TestRun.step("Start switching cache mode"):
|
||||
@@ -450,8 +450,8 @@ def test_interrupt_cache_stop(cache_mode, filesystem):
|
||||
test_file = create_test_file()
|
||||
|
||||
with TestRun.step("Get number of dirty data on exported object before interruption."):
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
sync()
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
cache_dirty_blocks_before = cache.get_dirty_blocks()
|
||||
|
||||
with TestRun.step("Unmount core."):
|
||||
|
@@ -12,7 +12,7 @@ from api.cas.core import Core
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from core.test_run import TestRun
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
block_size = Size(1, Unit.Blocks4096)
|
||||
|
@@ -5,13 +5,13 @@
|
||||
|
||||
import pytest
|
||||
|
||||
import test_tools.udev
|
||||
from api.cas import casadm, casadm_parser, cli, cli_messages
|
||||
from api.cas.cache_config import CacheMode, CleaningPolicy, CacheModeTrait
|
||||
from tests.lazy_writes.recovery.recovery_tests_methods import copy_file, compare_files
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_utils import os_utils
|
||||
from types.size import Size, Unit
|
||||
|
||||
mount_point = "/mnt/cas"
|
||||
@@ -99,5 +99,5 @@ def prepare():
|
||||
core_dev = TestRun.disks['core']
|
||||
core_dev.create_partitions([Size(2, Unit.GibiByte)])
|
||||
core_part = core_dev.partitions[0]
|
||||
os_utils.Udev.disable()
|
||||
test_tools.udev.Udev.disable()
|
||||
return cache_part, core_part
|
||||
|
@@ -15,7 +15,7 @@ from api.cas.cache_config import CacheLineSize, CacheMode
|
||||
from api.cas.cli import standby_activate_cmd, standby_load_cmd
|
||||
from api.cas.dmesg import get_md_section_size
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.os_utils import sync
|
||||
from test_tools.os_tools import sync
|
||||
from test_utils.filesystem.file import File
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@ from api.cas.cache_config import CacheMode, CacheLineSize
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ from api.cas.cache_config import (
|
||||
CleaningPolicy,
|
||||
)
|
||||
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@@ -16,7 +16,7 @@ from api.cas.cache_config import CacheLineSize
|
||||
from api.cas.cache import CacheStatus
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.fs_utils import check_if_symlink_exists
|
||||
from test_utils.os_utils import sync
|
||||
from test_tools.os_tools import sync
|
||||
|
||||
|
||||
@pytest.mark.CI
|
||||
|
Reference in New Issue
Block a user