OS tools refactor:

- make udev, runlevel, memory and wget separate files
- rename os_utils to os_tools and move it to test_tools
- remove ModuleRemoveMethod and set modprobe as default
- fix regex in is_kernel_module_loaded method
- remove get_sys_block_path
- move get_block_device_names method to disk tools

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-11 07:54:25 +01:00
parent ae9b036b47
commit 7512420e2a
17 changed files with 533 additions and 518 deletions

View File

@@ -6,8 +6,8 @@ from time import sleep
from core.test_run_utils import TestRun
from storage_devices.device import Device
from test_utils import os_utils
from connection.utils.output import CmdException
from test_tools.os_tools import load_kernel_module, is_kernel_module_loaded, unload_kernel_module
class ScsiDebug:
@@ -24,7 +24,7 @@ class ScsiDebug:
def reload(self):
self.teardown()
sleep(1)
load_output = os_utils.load_kernel_module(self.module_name, self.params)
load_output = load_kernel_module(self.module_name, self.params)
if load_output.exit_code != 0:
raise CmdException(f"Failed to load {self.module_name} module", load_output)
TestRun.LOGGER.info(f"{self.module_name} loaded successfully.")
@@ -32,8 +32,8 @@ class ScsiDebug:
TestRun.scsi_debug_devices = Device.get_scsi_debug_devices()
def teardown(self):
if os_utils.is_kernel_module_loaded(self.module_name):
os_utils.unload_kernel_module(self.module_name)
if is_kernel_module_loaded(self.module_name):
unload_kernel_module(self.module_name)
plugin_class = ScsiDebug