Refactor disk tools and fs tools
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -14,8 +14,8 @@ from packaging import version
|
||||
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.device import Device
|
||||
from test_tools.disk_utils import get_sysfs_path
|
||||
from test_tools.fs_utils import check_if_file_exists
|
||||
from test_tools.disk_tools import get_sysfs_path
|
||||
from test_tools.fs_tools import check_if_file_exists, is_mounted
|
||||
from test_utils.filesystem.file import File
|
||||
from connection.utils.retry import Retry
|
||||
|
||||
@@ -110,13 +110,6 @@ def get_kernel_module_parameter(module_name, parameter):
|
||||
return File(param_file_path).read()
|
||||
|
||||
|
||||
def is_mounted(path: str):
|
||||
if path is None or path.isspace():
|
||||
raise Exception("Checked path cannot be empty")
|
||||
command = f"mount | grep --fixed-strings '{path.rstrip('/')} '"
|
||||
return TestRun.executor.run(command).exit_code == 0
|
||||
|
||||
|
||||
def mount_debugfs():
|
||||
if not is_mounted(DEBUGFS_MOUNT_POINT):
|
||||
TestRun.executor.run_expect_success(f"mount -t debugfs none {DEBUGFS_MOUNT_POINT}")
|
||||
|
||||
Reference in New Issue
Block a user