OS tools refactor
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
parent
3e67a8c0f5
commit
8a5d531a32
@ -8,7 +8,7 @@ from api.cas.casadm_parser import *
|
||||
from api.cas.core import Core
|
||||
from api.cas.dmesg import get_metadata_size_on_device
|
||||
from api.cas.statistics import CacheStats, CacheIoClassStats
|
||||
from test_utils.os_utils import *
|
||||
from test_tools.os_tools import *
|
||||
from connection.utils.output import Output
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
from enum import Enum, IntFlag
|
||||
|
||||
from test_utils.os_utils import get_kernel_module_parameter
|
||||
from test_tools.os_tools import get_kernel_module_parameter
|
||||
from types.size import Size, Unit
|
||||
from types.time import Time
|
||||
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
from enum import Enum
|
||||
from core.test_run import TestRun
|
||||
from test_utils import os_utils
|
||||
from test_utils.os_utils import ModuleRemoveMethod
|
||||
from test_tools import os_tools
|
||||
|
||||
|
||||
class CasModule(Enum):
|
||||
@ -15,12 +14,12 @@ class CasModule(Enum):
|
||||
|
||||
|
||||
def reload_all_cas_modules():
|
||||
os_utils.unload_kernel_module(CasModule.cache.value, ModuleRemoveMethod.modprobe)
|
||||
os_utils.load_kernel_module(CasModule.cache.value)
|
||||
os_tools.unload_kernel_module(CasModule.cache.value)
|
||||
os_tools.load_kernel_module(CasModule.cache.value)
|
||||
|
||||
|
||||
def unload_all_cas_modules():
|
||||
os_utils.unload_kernel_module(CasModule.cache.value, os_utils.ModuleRemoveMethod.rmmod)
|
||||
os_tools.unload_kernel_module(CasModule.cache.value)
|
||||
|
||||
|
||||
def is_cas_management_dev_present():
|
||||
|
@ -20,7 +20,7 @@ from api.cas.cli import *
|
||||
from api.cas.core import Core
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.device import Device
|
||||
from test_utils.os_utils import reload_kernel_module
|
||||
from test_tools.os_tools import reload_kernel_module
|
||||
from connection.utils.output import CmdException, Output
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -16,7 +16,7 @@ from api.cas.statistics import CoreStats, CoreIoClassStats
|
||||
from core.test_run_utils import TestRun
|
||||
from storage_devices.device import Device
|
||||
from test_tools import fs_utils, disk_utils
|
||||
from test_utils.os_utils import sync
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.common.wait import wait
|
||||
from types.size import Unit, Size
|
||||
|
||||
|
@ -9,8 +9,7 @@ import os
|
||||
from core.test_run import TestRun
|
||||
from api.cas import cas_module
|
||||
from api.cas.version import get_installed_cas_version
|
||||
from test_utils import os_utils
|
||||
from test_tools import git
|
||||
from test_tools import git, os_tools
|
||||
from connection.utils.output import CmdException
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ from packaging import version
|
||||
|
||||
from core.test_run import TestRun
|
||||
from test_tools import fs_utils
|
||||
from test_utils import os_utils
|
||||
from test_tools.os_tools import get_kernel_version
|
||||
|
||||
default_config_file_path = "/tmp/opencas_ioclass.conf"
|
||||
|
||||
@ -166,7 +166,7 @@ class IoClass:
|
||||
"file_offset",
|
||||
"request_size",
|
||||
]
|
||||
if os_utils.get_kernel_version() >= version.Version("4.13"):
|
||||
if get_kernel_version() >= version.Version("4.13"):
|
||||
rules.append("wlth")
|
||||
|
||||
rule = random.choice(rules)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ae9b036b4716934406a01f62277558f86a40bf46
|
||||
Subproject commit 7512420e2adbecf2a83847f963f61326d17c77fc
|
@ -18,7 +18,7 @@ from api.cas.cache_config import (
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from core.test_run import TestRun
|
||||
from types.size import Size, Unit
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
|
||||
|
@ -15,7 +15,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, VerifyMethod
|
||||
from test_utils.os_utils import Udev, sync
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
io_size = Size(10000, Unit.Blocks4096)
|
||||
|
@ -24,7 +24,7 @@ from test_tools.dd import Dd
|
||||
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_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -15,7 +15,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, CpusAllowedPolicy
|
||||
from test_utils.os_utils import Udev, sync, get_dut_cpu_physical_cores
|
||||
from test_tools.os_tools import sync, get_dut_cpu_physical_cores
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@ from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.iostat import IOstatBasic
|
||||
|
@ -9,14 +9,12 @@ import pytest
|
||||
from api.cas.cas_module import CasModule
|
||||
from core.test_run import TestRun
|
||||
from types.size import Unit
|
||||
from test_utils.os_utils import (allocate_memory,
|
||||
disable_memory_affecting_functions,
|
||||
drop_caches,
|
||||
get_mem_free,
|
||||
from test_tools.os_tools import (drop_caches,
|
||||
is_kernel_module_loaded,
|
||||
load_kernel_module,
|
||||
unload_kernel_module,
|
||||
)
|
||||
from test_tools.memory import disable_memory_affecting_functions, get_mem_free, allocate_memory
|
||||
|
||||
|
||||
@pytest.mark.os_dependent
|
||||
|
@ -15,7 +15,7 @@ from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CleaningPolicy
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
|
||||
|
||||
@pytest.mark.CI
|
||||
|
@ -8,7 +8,7 @@ import pytest
|
||||
|
||||
from api.cas import casadm
|
||||
from core.test_run import TestRun
|
||||
from test_utils.os_utils import sync
|
||||
from test_tools.os_tools import sync
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from types.size import Unit, Size
|
||||
from test_tools.dd import Dd
|
||||
|
@ -15,7 +15,7 @@ from storage_devices.disk import DiskType, DiskTypeSet, 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 sync
|
||||
from test_tools.os_tools import sync
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
from api.cas.cli_messages import (
|
||||
|
@ -15,7 +15,7 @@ from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CleaningPolicy
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
|
||||
|
||||
@pytest.mark.CI
|
||||
|
@ -23,7 +23,8 @@ from api.cas import casadm
|
||||
from api.cas.cas_service import opencas_drop_in_directory
|
||||
from storage_devices.raid import Raid
|
||||
from storage_devices.ramdisk import RamDisk
|
||||
from test_utils.os_utils import Udev, kill_all_io
|
||||
from test_tools.os_tools import kill_all_io
|
||||
from test_tools.udev import Udev
|
||||
from test_utils.disk_finder import get_disk_serial_number
|
||||
from test_tools.disk_utils import PartitionTable, create_partition_table
|
||||
from test_tools.device_mapper import DeviceMapper
|
||||
|
@ -18,7 +18,7 @@ from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, VerifyMethod
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
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 Unit, Size
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ from core.test_run import TestRun
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from storage_devices.device import Device
|
||||
|
@ -4,7 +4,6 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
from time import sleep
|
||||
import pytest
|
||||
|
||||
from api.cas import casadm
|
||||
@ -27,7 +26,8 @@ from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite
|
||||
from test_tools.fs_utils import readlink
|
||||
from test_utils.drbd import Resource, Node
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from test_tools import fs_utils
|
||||
|
||||
|
@ -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
|
||||
|
@ -29,7 +29,8 @@ 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_utils.filesystem.file import File
|
||||
from test_utils.os_utils import Udev, sync
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
from types.time import Time
|
||||
|
@ -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
|
||||
|
||||
|
@ -14,7 +14,7 @@ from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, CpusAllowedPolicy, ReadWrite
|
||||
from test_utils.os_utils import get_dut_cpu_physical_cores
|
||||
from test_tools.os_tools import get_dut_cpu_physical_cores
|
||||
from types.size import Size, Unit
|
||||
|
||||
mount_point = "/mnt/test"
|
||||
|
@ -13,7 +13,7 @@ from storage_devices.disk import DiskTypeSet, DiskTypeLowerThan, DiskType
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, ReadWrite
|
||||
from test_utils.filesystem.symlink import Symlink
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@ -3,12 +3,13 @@
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
import os
|
||||
import posixpath
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode, CacheModeTrait, CleaningPolicy, SeqCutOffPolicy
|
||||
from core.test_run import TestRun
|
||||
@ -18,7 +19,6 @@ from test_tools.blktrace import BlkTrace, BlkTraceMask, RwbsKind
|
||||
from test_tools.disk_utils import Filesystem, check_if_device_supports_trim
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils import os_utils
|
||||
from types.size import Size, Unit
|
||||
from api.cas.dmesg import get_metadata_size_on_device
|
||||
|
||||
@ -129,7 +129,7 @@ def test_trim_propagation():
|
||||
raise Exception("Core device doesn't support discards")
|
||||
|
||||
with TestRun.step(f"Disable udev"):
|
||||
os_utils.Udev.disable()
|
||||
Udev.disable()
|
||||
|
||||
with TestRun.step(f"Prepare cache instance in WB with one core"):
|
||||
cache = casadm.start_cache(cache_dev, CacheMode.WB, force=True)
|
||||
@ -161,7 +161,7 @@ def test_trim_propagation():
|
||||
with TestRun.step("Power cycle"):
|
||||
power_control = TestRun.plugin_manager.get_plugin("power_control")
|
||||
power_control.power_cycle()
|
||||
os_utils.Udev.disable()
|
||||
Udev.disable()
|
||||
|
||||
with TestRun.step("Load cache"):
|
||||
cache = casadm.start_cache(cache_dev, load=True)
|
||||
@ -246,8 +246,8 @@ def test_trim_device_discard_support(
|
||||
|
||||
with TestRun.step("Remove file."):
|
||||
test_file.remove()
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches()
|
||||
sync()
|
||||
drop_caches()
|
||||
time.sleep(5)
|
||||
|
||||
with TestRun.step("Ensure that discards were detected by blktrace on proper devices."):
|
||||
@ -315,8 +315,8 @@ def compare_properties(value, expected_value, property_name):
|
||||
|
||||
def stop_monitoring_and_check_discards(blktraces, discard_support):
|
||||
time.sleep(60)
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches()
|
||||
sync()
|
||||
drop_caches()
|
||||
time.sleep(5)
|
||||
|
||||
discard_flag = RwbsKind.D # Discard
|
||||
|
@ -16,8 +16,9 @@ from core.test_run import TestRun
|
||||
from test_tools.dd import Dd
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev, sync
|
||||
from test_utils.os_utils import drop_caches, DropCachesMode
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from test_tools.os_tools import drop_caches, DropCachesMode
|
||||
from types.size import Size, Unit
|
||||
|
||||
ioclass_config_path = "/etc/opencas/ioclass.conf"
|
||||
|
@ -10,7 +10,8 @@ from api.cas.cache_config import CacheMode, CleaningPolicy, SeqCutOffPolicy
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.os_utils import sync, Udev, drop_caches
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
|
||||
dd_bs = Size(1, Unit.Blocks4096)
|
||||
|
@ -17,7 +17,8 @@ from test_tools.dd import Dd
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.filesystem.directory import Directory
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import drop_caches, DropCachesMode, sync, Udev
|
||||
from test_tools.os_tools import drop_caches, DropCachesMode, sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from tests.io_class.io_class_common import mountpoint, prepare, ioclass_config_path
|
||||
|
||||
|
@ -12,7 +12,8 @@ from core.test_run import TestRun
|
||||
from api.cas.cache_config import CacheMode, CleaningPolicy, SeqCutOffPolicy
|
||||
from .io_class_common import ioclass_config, get_io_class_occupancy, run_io_dir
|
||||
from api.cas import casadm
|
||||
from test_utils.os_utils import sync, Udev, drop_caches
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ from storage_devices.disk import DiskType, DiskTypeSet, 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 sync, DropCachesMode, drop_caches
|
||||
from test_tools.os_tools import sync, DropCachesMode, drop_caches
|
||||
from types.size import Size, Unit
|
||||
from tests.io_class.io_class_common import mountpoint, prepare, ioclass_config_path
|
||||
|
||||
|
@ -16,7 +16,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
from tests.io_class.io_class_common import (
|
||||
prepare,
|
||||
|
@ -15,7 +15,8 @@ from storage_devices.device import Device
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from tests.io_class.io_class_common import (
|
||||
prepare,
|
||||
mountpoint,
|
||||
|
@ -15,7 +15,8 @@ from core.test_run_utils import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit
|
||||
from tests.io_class.io_class_common import (
|
||||
prepare,
|
||||
|
@ -13,7 +13,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit
|
||||
from tests.io_class.io_class_common import (
|
||||
mountpoint,
|
||||
|
@ -11,7 +11,8 @@ from api.cas import ioclass_config, casadm
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from tests.io_class.io_class_common import prepare, ioclass_config_path
|
||||
|
||||
|
@ -14,7 +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.os_utils import drop_caches, DropCachesMode, sync, Udev
|
||||
from test_tools.os_tools import drop_caches, DropCachesMode, sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
from tests.io_class.io_class_common import prepare, mountpoint, ioclass_config_path
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
import os
|
||||
import pytest
|
||||
from datetime import timedelta
|
||||
|
||||
import test_tools.runlevel
|
||||
from api.cas import ioclass_config, casadm_parser
|
||||
from api.cas.cache_config import CacheMode
|
||||
from api.cas.casadm_params import StatsFilter
|
||||
@ -17,8 +19,8 @@ from test_tools import fs_utils
|
||||
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_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
|
||||
from tests.io_class.io_class_common import (
|
||||
prepare,
|
||||
@ -73,10 +75,10 @@ def test_io_class_service_load(runlevel):
|
||||
InitConfig.create_init_config_from_running_configuration(
|
||||
cache_extra_flags=f"ioclass_file={ioclass_config_path}"
|
||||
)
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Reboot system to runlevel {runlevel}."):
|
||||
os_utils.change_runlevel(runlevel)
|
||||
test_tools.runlevel.change_runlevel(runlevel)
|
||||
TestRun.executor.reboot()
|
||||
|
||||
with TestRun.step(
|
||||
@ -152,8 +154,8 @@ def run_io():
|
||||
)
|
||||
fio.run()
|
||||
|
||||
os_utils.sync()
|
||||
os_utils.drop_caches()
|
||||
sync()
|
||||
drop_caches()
|
||||
|
||||
|
||||
def prepare_and_load_io_class_config(cache, metadata_not_cached=False):
|
||||
|
@ -17,7 +17,7 @@ from test_tools import fs_utils
|
||||
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_utils.os_utils import sync, drop_caches
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from types.size import Size, Unit
|
||||
from tests.io_class.io_class_common import template_config_path
|
||||
|
||||
|
@ -10,7 +10,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import sync, Udev, drop_caches
|
||||
from test_tools.os_tools import sync, drop_caches
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
from tests.io_class.io_class_common import prepare
|
||||
|
||||
|
@ -19,7 +19,8 @@ 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.filesystem.file import File
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from tests.io_class.io_class_common import prepare, ioclass_config_path, mountpoint
|
||||
|
||||
|
@ -24,7 +24,7 @@ from storage_devices.disk import DiskTypeSet, DiskTypeLowerThan, DiskType
|
||||
from test_tools.blktrace import BlkTrace, BlkTraceMask, ActionKind, RwbsKind
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, ReadWrite
|
||||
from test_utils.os_utils import kill_all_io
|
||||
from test_tools.os_tools import kill_all_io
|
||||
from types.size import Size, Unit
|
||||
from types.time import Time
|
||||
|
||||
|
@ -14,7 +14,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev, kill_all_io
|
||||
from test_tools.os_tools import kill_all_io
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
from types.time import Time
|
||||
|
||||
|
@ -18,7 +18,7 @@ from api.cas.cache_config import (
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
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
|
||||
from types.time import Time
|
||||
|
||||
|
@ -9,7 +9,6 @@ import test_tools.common.wait
|
||||
from core.test_run import TestRun
|
||||
from test_tools import fs_utils
|
||||
from test_tools.dd import Dd
|
||||
from test_utils import os_utils
|
||||
from test_utils.filesystem.file import File
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -15,9 +15,8 @@ from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
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_utils import os_utils
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import DropCachesMode
|
||||
from test_tools.os_tools import DropCachesMode, drop_caches, sync
|
||||
from types.size import Size, Unit
|
||||
from types.time import Time
|
||||
from tests.lazy_writes.recovery.recovery_tests_methods import power_cycle_dut
|
||||
@ -63,7 +62,7 @@ def test_recovery_all_options(cache_mode, cache_line_size, cleaning_policy, file
|
||||
with TestRun.step("Mount core device."):
|
||||
core_device.mount(mount_point)
|
||||
file_operation(test_file.full_path, other_pattern, ReadWrite.write)
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
|
||||
with TestRun.step("Unmount core device."):
|
||||
core_device.unmount()
|
||||
@ -85,9 +84,9 @@ def test_recovery_all_options(cache_mode, cache_line_size, cleaning_policy, file
|
||||
cache.set_cache_mode(CacheMode.WT, flush=False)
|
||||
|
||||
with TestRun.step("Reset platform."):
|
||||
os_utils.sync()
|
||||
sync()
|
||||
core.unmount()
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
TestRun.LOGGER.info(f"Number of dirty blocks in cache: {cache.get_dirty_blocks()}")
|
||||
power_cycle_dut()
|
||||
|
||||
|
@ -13,8 +13,8 @@ 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_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 connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
from tests.lazy_writes.recovery.recovery_tests_methods import create_test_files, copy_file, \
|
||||
@ -62,13 +62,13 @@ def test_recovery_flush_reset_raw(cache_mode):
|
||||
direct="oflag")
|
||||
|
||||
with TestRun.step("Sync and flush buffers."):
|
||||
os_utils.sync()
|
||||
sync()
|
||||
output = TestRun.executor.run(f"hdparm -f {core.path}")
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("Error during hdparm", output)
|
||||
|
||||
with TestRun.step("Trigger flush."):
|
||||
os_utils.drop_caches(DropCachesMode.ALL)
|
||||
drop_caches(DropCachesMode.ALL)
|
||||
TestRun.executor.run_in_background(cli.flush_cache_cmd(f"{cache.cache_id}"))
|
||||
|
||||
with TestRun.step("Hard reset DUT during data flushing."):
|
||||
|
@ -10,7 +10,7 @@ from core.test_run_utils import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
||||
|
@ -18,7 +18,8 @@ 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_utils.filesystem.file import File
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
file_size = Size(640, Unit.GiB)
|
||||
|
@ -15,7 +15,8 @@ from test_tools.disk_utils import Filesystem
|
||||
from test_tools.fs_utils import create_random_test_file, remove
|
||||
from test_tools.iostat import IOstatBasic
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import Udev, sync
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
bs = Size(512, Unit.KibiByte)
|
||||
|
@ -16,8 +16,8 @@ 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.os_tools import sync
|
||||
from test_tools.scsi_debug import Logs, syslog_path
|
||||
from test_utils import os_utils
|
||||
from types.size import Size, Unit
|
||||
|
||||
mount_point = "/mnt/cas"
|
||||
@ -60,11 +60,11 @@ def test_flush_signal_core(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush cache."):
|
||||
cache.flush_cache()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -72,11 +72,11 @@ def test_flush_signal_core(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush core."):
|
||||
core.flush_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -90,7 +90,7 @@ def test_flush_signal_core(cache_mode):
|
||||
|
||||
with TestRun.step("Create big temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(5, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Wait for automatic flush from alru cleaning policy and check log."):
|
||||
wait_time = (
|
||||
@ -107,12 +107,12 @@ def test_flush_signal_core(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Unmount exported object and remove it from cache."):
|
||||
core.unmount()
|
||||
core.remove_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -158,11 +158,11 @@ def test_flush_signal_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush cache."):
|
||||
cache.flush_cache()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush and FUA requests and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -170,11 +170,11 @@ def test_flush_signal_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush core."):
|
||||
core.flush_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -188,7 +188,7 @@ def test_flush_signal_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create big temporary file on exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(5, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Wait for automatic flush from alru cleaning policy and check log."):
|
||||
wait_time = (
|
||||
@ -205,12 +205,12 @@ def test_flush_signal_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on exported object."):
|
||||
create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Unmount exported object and remove it from cache."):
|
||||
core.unmount()
|
||||
core.remove_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush and FUA requests."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -262,12 +262,12 @@ def test_flush_signal_multilevel_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on the 2nd exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(512, Unit.MebiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush both caches."):
|
||||
cache2.flush_cache()
|
||||
cache1.flush_cache()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush and FUA requests and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -275,12 +275,12 @@ def test_flush_signal_multilevel_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on the 2nd exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(512, Unit.MebiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Flush both cores."):
|
||||
core2.flush_core()
|
||||
core1.flush_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
Logs.check_syslog_for_signals()
|
||||
@ -298,7 +298,7 @@ def test_flush_signal_multilevel_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create big temporary file on the 2nd exported object."):
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(3, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Wait for automatic flush from alru cleaning policy and check log."):
|
||||
wait_time = (
|
||||
@ -315,13 +315,13 @@ def test_flush_signal_multilevel_cache(cache_mode):
|
||||
|
||||
with TestRun.step("Create temporary file on the 2nd exported object."):
|
||||
create_random_test_file(f"{mount_point}/tmp.file", Size(512, Unit.MebiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Unmount the 2nd exported object and remove cores from caches."):
|
||||
core2.unmount()
|
||||
core2.remove_core()
|
||||
core1.remove_core()
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request."):
|
||||
Logs.check_syslog_for_signals()
|
||||
|
@ -12,25 +12,19 @@ from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_tools.iostat import IOstatExtended
|
||||
from test_utils.os_utils import (
|
||||
from test_tools.os_tools import (
|
||||
kill_all_io,
|
||||
set_wbt_lat,
|
||||
get_wbt_lat,
|
||||
get_dut_cpu_number,
|
||||
)
|
||||
from test_tools.common.wait import wait
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import (
|
||||
CacheMode,
|
||||
CacheModeTrait,
|
||||
CleaningPolicy,
|
||||
FlushParametersAcp,
|
||||
SeqCutOffPolicy,
|
||||
CacheLineSize,
|
||||
Time,
|
||||
)
|
||||
from test_tools.blktrace import BlkTrace, BlkTraceMask, ActionKind, RwbsKind
|
||||
|
||||
|
||||
runtime = timedelta(days=30)
|
||||
|
||||
|
@ -8,7 +8,7 @@ import pytest
|
||||
from api.cas import casadm
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_utils.os_utils import (get_number_of_processors_from_cpuinfo,
|
||||
from test_tools.os_tools import (get_number_of_processors_from_cpuinfo,
|
||||
get_number_of_processes)
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -13,8 +13,9 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import get_mem_available, get_module_mem_footprint
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.memory import get_mem_available, get_module_mem_footprint
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
cores_count = 16
|
||||
|
@ -15,9 +15,9 @@ from api.cas.cache_config import (
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from core.test_run import TestRun
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.scsi_debug import Logs, syslog_path
|
||||
from test_tools.fs_utils import create_random_test_file
|
||||
from test_utils import os_utils
|
||||
from types.size import Size, Unit
|
||||
|
||||
mount_point = "/mnt/cas"
|
||||
@ -56,12 +56,12 @@ def test_flush_signal_propagation_cache():
|
||||
if core.is_mounted():
|
||||
core.unmount()
|
||||
core.mount(mount_point)
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Create temporary file on the exported object."):
|
||||
Logs._read_syslog(Logs.last_read_line)
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
sleep(3)
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
@ -102,12 +102,12 @@ def test_flush_signal_propagation_core():
|
||||
if core.is_mounted():
|
||||
core.unmount()
|
||||
core.mount(mount_point)
|
||||
os_utils.sync()
|
||||
sync()
|
||||
|
||||
with TestRun.step("Create temporary file on the exported object."):
|
||||
Logs._read_syslog(Logs.last_read_line)
|
||||
tmp_file = create_random_test_file(f"{mount_point}/tmp.file", Size(1, Unit.GibiByte))
|
||||
os_utils.sync()
|
||||
sync()
|
||||
sleep(3)
|
||||
|
||||
with TestRun.step(f"Check {syslog_path} for flush request and delete temporary file."):
|
||||
|
@ -17,7 +17,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskTypeLowerThan, DiskType
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import IoEngine, ReadWrite
|
||||
from test_utils.os_utils import Udev, set_wbt_lat, get_dut_cpu_physical_cores
|
||||
from test_tools.os_tools import set_wbt_lat, get_dut_cpu_physical_cores
|
||||
from test_tools.udev import Udev
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
from utils.performance import WorkloadParameter
|
||||
|
@ -13,7 +13,7 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, CpusAllowedPolicy
|
||||
from test_utils.os_utils import (
|
||||
from test_tools.os_tools import (
|
||||
get_number_of_processors_from_cpuinfo,
|
||||
set_wbt_lat,
|
||||
get_dut_cpu_physical_cores,
|
||||
|
@ -13,7 +13,7 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine, CpusAllowedPolicy
|
||||
from test_utils.os_utils import (
|
||||
from test_tools.os_tools import (
|
||||
set_wbt_lat,
|
||||
get_number_of_processors_from_cpuinfo,
|
||||
get_dut_cpu_physical_cores,
|
||||
|
@ -20,7 +20,7 @@ from api.cas.cli import add_core_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
get_fuzz_config,
|
||||
run_cmd_and_validate,
|
||||
|
@ -24,7 +24,7 @@ from tests.security.fuzzy.kernel.common.common import (
|
||||
get_fuzz_config,
|
||||
run_cmd_and_validate,
|
||||
)
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
|
||||
core_id_min = 0
|
||||
core_id_max = 4095
|
||||
|
@ -20,7 +20,7 @@ from api.cas.cli import add_core_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
run_cmd_and_validate,
|
||||
get_device_fuzz_config,
|
||||
|
@ -9,7 +9,7 @@ from api.cas.cli import script_try_add_cmd, remove_detached_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
run_cmd_and_validate,
|
||||
get_fuzz_config,
|
||||
|
@ -9,7 +9,7 @@ from api.cas.cli import script_try_add_cmd, remove_detached_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskTypeSet, DiskType
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
run_cmd_and_validate,
|
||||
get_fuzz_config,
|
||||
|
@ -7,7 +7,7 @@
|
||||
from api.cas.cli import script_try_add_cmd, remove_detached_cmd
|
||||
from core.test_run import TestRun
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
run_cmd_and_validate,
|
||||
get_device_fuzz_config,
|
||||
|
@ -19,7 +19,7 @@ from api.cas.cli import start_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Unit, Size
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
get_fuzz_config,
|
||||
|
@ -18,7 +18,7 @@ from api.cas.cli import remove_core_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -18,7 +18,7 @@ from api.cas.cli import remove_core_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -17,7 +17,7 @@ from api.cas.cli import remove_core_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -20,7 +20,7 @@ from api.cas.init_config import InitConfig
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -19,7 +19,7 @@ from api.cas.init_config import InitConfig
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -18,7 +18,7 @@ from api.cas.cli import stop_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -18,7 +18,7 @@ from api.cas.cli import stop_cmd
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.peach_fuzzer.peach_fuzzer import PeachFuzzer
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from tests.security.fuzzy.kernel.common.common import (
|
||||
prepare_cas_instance,
|
||||
get_fuzz_config,
|
||||
|
@ -14,7 +14,7 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools import fs_utils
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.os_utils import create_user, check_if_user_exists
|
||||
from test_tools.os_tools import create_user, check_if_user_exists
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -15,7 +15,7 @@ from api.cas.statistics import get_stats_dict, get_stat_value, OperationType
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
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
|
||||
|
||||
iterations = 10
|
||||
|
@ -17,7 +17,6 @@ from api.cas.cli_messages import (
|
||||
)
|
||||
from api.cas.statistics import (
|
||||
config_stats_ioclass,
|
||||
usage_stats,
|
||||
usage_stats_ioclass,
|
||||
request_stats,
|
||||
block_stats_core,
|
||||
@ -27,7 +26,8 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from test_utils.filesystem.file import File
|
||||
from test_utils.os_utils import sync, Udev
|
||||
from test_tools.os_tools import sync
|
||||
from test_tools.udev import Udev
|
||||
from connection.utils.output import CmdException
|
||||
from types.size import Size, Unit
|
||||
|
||||
|
@ -16,7 +16,7 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
cache_size = Size(1, Unit.GibiByte)
|
||||
|
@ -16,7 +16,7 @@ from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from types.size import Size, Unit
|
||||
|
||||
# One cache instance per every cache mode:
|
||||
|
@ -16,7 +16,7 @@ from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from core.test_run import TestRun
|
||||
from test_tools.disk_utils import Filesystem
|
||||
from types.size import Size, Unit
|
||||
from test_utils.os_utils import Udev
|
||||
from test_tools.udev import Udev
|
||||
from test_tools.fio.fio import Fio
|
||||
from test_tools.fio.fio_param import ReadWrite, IoEngine
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
from api.cas.init_config import InitConfig, opencas_conf_path
|
||||
from test_tools import fs_utils
|
||||
from core.test_run import TestRun
|
||||
from test_utils.os_utils import get_block_device_names_list
|
||||
from test_tools.disk_utils import get_block_device_names_list
|
||||
from types.size import Size, Unit
|
||||
|
||||
test_file_size = Size(500, Unit.KiloByte)
|
||||
|
Loading…
Reference in New Issue
Block a user