
- 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>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
#
|
|
# Copyright(c) 2020-2021 Intel Corporation
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
#
|
|
from time import sleep
|
|
|
|
from core.test_run_utils import TestRun
|
|
from storage_devices.device import Device
|
|
from connection.utils.output import CmdException
|
|
from test_tools.os_tools import load_kernel_module, is_kernel_module_loaded, unload_kernel_module
|
|
|
|
|
|
class ScsiDebug:
|
|
def __init__(self, params, config):
|
|
self.params = params
|
|
self.module_name = "scsi_debug"
|
|
|
|
def pre_setup(self):
|
|
pass
|
|
|
|
def post_setup(self):
|
|
self.reload()
|
|
|
|
def reload(self):
|
|
self.teardown()
|
|
sleep(1)
|
|
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.")
|
|
sleep(10)
|
|
TestRun.scsi_debug_devices = Device.get_scsi_debug_devices()
|
|
|
|
def teardown(self):
|
|
if is_kernel_module_loaded(self.module_name):
|
|
unload_kernel_module(self.module_name)
|
|
|
|
|
|
plugin_class = ScsiDebug
|