Refactor disk tools and fs tools

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-11 18:56:23 +01:00
parent 6dd9c9ca8c
commit fd869a0afc
25 changed files with 179 additions and 176 deletions

View File

@@ -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}")