OS tools refactor
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -14,7 +14,7 @@ from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import drop_caches, DropCachesMode, sync
|
||||
from test_tools.os_tools import drop_caches, DropCachesMode, sync
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@@ -6,6 +6,8 @@
|
||||
import os
|
||||
import pytest
|
||||
import time
|
||||
|
||||
import test_tools.runlevel
|
||||
from api.cas import casadm, casadm_parser
|
||||
from api.cas.cache_config import CacheMode
|
||||
from api.cas.init_config import InitConfig
|
||||
@@ -14,8 +16,8 @@ from storage_devices.disk import DiskTypeLowerThan, DiskTypeSet, DiskType
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils import os_utils
|
||||
from test_utils.os_utils import Runlevel
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from test_tools.runlevel import Runlevel
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
@@ -36,7 +38,7 @@ def test_init_reboot_runlevels(runlevel, cache_mode):
|
||||
- Cache should be loaded successfully after reboot.
|
||||
"""
|
||||
with TestRun.step(f"Set runlevel to {runlevel.value}."):
|
||||
os_utils.change_runlevel(runlevel)
|
||||
test_tools.runlevel.change_runlevel(runlevel)
|
||||
|
||||
with TestRun.step("Prepare CAS device."):
|
||||
cache_disk = TestRun.disks['cache']
|
||||
@@ -65,8 +67,8 @@ def test_init_reboot_runlevels(runlevel, cache_mode):
|
||||
.file_size(Size(30, Unit.GibiByte))
|
||||
|
||||
fio.run_in_background()
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches()
|
||||
sync()
|
||||
drop_caches()
|
||||
|
||||
time.sleep(10)
|
||||
TestRun.executor.run_expect_success("pgrep fio")
|
||||
@@ -86,5 +88,5 @@ def test_init_reboot_runlevels(runlevel, cache_mode):
|
||||
with TestRun.step("Stop cache and set default runlevel."):
|
||||
if len(caches) != 0:
|
||||
casadm.stop_all_caches()
|
||||
os_utils.change_runlevel(Runlevel.runlevel3)
|
||||
test_tools.runlevel.change_runlevel(Runlevel.runlevel3)
|
||||
TestRun.executor.reboot()
|
||||
|
@@ -10,7 +10,7 @@ import pytest
|
||||
from api.cas import cas_module, casctl
|
||||
from api.cas.cas_module import CasModule
|
||||
from core.test_run import TestRun
|
||||
from test_utils import os_utils
|
||||
from test_tools.os_tools import load_kernel_module
|
||||
|
||||
|
||||
@pytest.mark.os_dependent
|
||||
@@ -46,5 +46,5 @@ def test_init_status():
|
||||
TestRun.fail("CAS management device is present in OS when CAS module is not loaded.")
|
||||
|
||||
with TestRun.step("Load CAS modules and start CAS service"):
|
||||
os_utils.load_kernel_module(CasModule.cache.value)
|
||||
load_kernel_module(CasModule.cache.value)
|
||||
casctl.start()
|
||||
|
@@ -17,7 +17,7 @@ from test_tools.dd import Dd
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_utils import check_if_file_exists
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import sync
|
||||
from test_tools.os_tools import sync
|
||||
from types.size import Size, Unit
|
||||
|
||||
mount_point = "/mnt/cas"
|
||||
|
@@ -18,7 +18,8 @@ from test_tools.disk_utils import Filesystem
|
||||
from test_tools import fstab
|
||||
from test_tools.dd import Dd
|
||||
from types.size import Unit, Size
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from test_utils.emergency_escape import EmergencyEscape
|
||||
from api.cas.cas_service import set_cas_service_timeout, clear_cas_service_timeout
|
||||
|
||||
|
Reference in New Issue
Block a user