Mbed Host Tests
|
Base class for all plugins used with host tests. More...
Public Member Functions | |
__init__ (self) | |
setup (self, *args, **kwargs) | |
Interface methods. | |
execute (self, capability, *args, **kwargs) | |
Executes capability by name. | |
is_os_supported (self, os_name=None) | |
print_plugin_error (self, text) | |
Interface helper methods - overload only if you need to have custom behaviour. | |
print_plugin_info (self, text, NL=True) | |
Function prints notification in console and exits always with True. | |
print_plugin_char (self, char) | |
check_mount_point_ready (self, destination_disk, init_delay=0.2, loop_delay=0.25, target_id=None, timeout=60) | |
Waits until destination_disk is ready and can be accessed by e.g. | |
check_serial_port_ready (self, serial_port, target_id=None, timeout=60) | |
Function checks (using mbed-ls) and updates serial port name information for DUT with specified target_id. | |
check_parameters (self, capability, *args, **kwargs) | |
This function should be ran each time we call execute() to check if none of the required parameters is missing. | |
run_command (self, cmd, shell=True) | |
Runs command from command line. | |
mbed_os_info (self) | |
Returns information about host OS. | |
mbed_os_support (self) | |
Function used to determine host OS. | |
Public Attributes | |
plugin_logger = ht_loggers.get(self.type, ht_loggers['BasePlugin']) | |
Static Public Attributes | |
str | name = "HostTestPluginBase" |
Interface: | |
str | type = "BasePlugin" |
list | capabilities = [] |
list | required_parameters = [] |
bool | stable = False |
Base class for all plugins used with host tests.
Definition at line 32 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.__init__ | ( | self | ) |
ctor
Reimplemented in mbed_host_tests.host_tests_plugins.module_copy_jn51xx.HostTestPluginCopyMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_copy_mbed.HostTestPluginCopyMethod_Mbed, mbed_host_tests.host_tests_plugins.module_copy_mps2.HostTestPluginCopyMethod_MPS2, mbed_host_tests.host_tests_plugins.module_copy_pyocd.HostTestPluginCopyMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_copy_shell.HostTestPluginCopyMethod_Shell, mbed_host_tests.host_tests_plugins.module_copy_silabs.HostTestPluginCopyMethod_Silabs, mbed_host_tests.host_tests_plugins.module_copy_stlink.HostTestPluginCopyMethod_Stlink, mbed_host_tests.host_tests_plugins.module_power_cycle_mbed.HostTestPluginPowerCycleResetMethod, mbed_host_tests.host_tests_plugins.module_reset_jn51xx.HostTestPluginResetMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_reset_mbed.HostTestPluginResetMethod_Mbed, mbed_host_tests.host_tests_plugins.module_reset_mps2.HostTestPluginResetMethod_MPS2, mbed_host_tests.host_tests_plugins.module_reset_pyocd.HostTestPluginResetMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_reset_silabs.HostTestPluginResetMethod_SiLabs, and mbed_host_tests.host_tests_plugins.module_reset_stlink.HostTestPluginResetMethod_Stlink.
Definition at line 49 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.check_mount_point_ready | ( | self, | |
destination_disk, | |||
init_delay = 0.2, | |||
loop_delay = 0.25, | |||
target_id = None, | |||
timeout = 60 ) |
Waits until destination_disk is ready and can be accessed by e.g.
copy commands
destination_disk | Mount point (disk) which will be checked for readiness |
init_delay | - Initial delay time before first access check |
loop_delay | - polling delay for access check |
timeout | Mount point pooling timeout in seconds |
Definition at line 116 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.check_parameters | ( | self, | |
capability, | |||
* | args, | ||
** | kwargs ) |
This function should be ran each time we call execute() to check if none of the required parameters is missing.
capability | Capability name |
args | Additional parameters |
kwargs | Additional parameters |
Definition at line 211 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.check_serial_port_ready | ( | self, | |
serial_port, | |||
target_id = None, | |||
timeout = 60 ) |
Function checks (using mbed-ls) and updates serial port name information for DUT with specified target_id.
If no target_id is specified function returns old serial port name.
serial_port | Current serial port name |
target_id | Target ID of a device under test which serial port will be checked and updated if needed |
timeout | Serial port pooling timeout in seconds |
Definition at line 173 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.execute | ( | self, | |
capability, | |||
* | args, | ||
** | kwargs ) |
Executes capability by name.
capability | Capability name |
args | Additional arguments |
kwargs | Additional arguments |
Each capability e.g. may directly just call some command line program or execute building pythonic function
Reimplemented in mbed_host_tests.host_tests_plugins.module_copy_jn51xx.HostTestPluginCopyMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_copy_mbed.HostTestPluginCopyMethod_Mbed, mbed_host_tests.host_tests_plugins.module_copy_mps2.HostTestPluginCopyMethod_MPS2, mbed_host_tests.host_tests_plugins.module_copy_pyocd.HostTestPluginCopyMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_copy_shell.HostTestPluginCopyMethod_Shell, mbed_host_tests.host_tests_plugins.module_copy_silabs.HostTestPluginCopyMethod_Silabs, mbed_host_tests.host_tests_plugins.module_copy_stlink.HostTestPluginCopyMethod_Stlink, mbed_host_tests.host_tests_plugins.module_copy_ublox.HostTestPluginCopyMethod_ublox, mbed_host_tests.host_tests_plugins.module_power_cycle_mbed.HostTestPluginPowerCycleResetMethod, mbed_host_tests.host_tests_plugins.module_reset_jn51xx.HostTestPluginResetMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_reset_mbed.HostTestPluginResetMethod_Mbed, mbed_host_tests.host_tests_plugins.module_reset_mps2.HostTestPluginResetMethod_MPS2, mbed_host_tests.host_tests_plugins.module_reset_pyocd.HostTestPluginResetMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_reset_silabs.HostTestPluginResetMethod_SiLabs, mbed_host_tests.host_tests_plugins.module_reset_stlink.HostTestPluginResetMethod_Stlink, and mbed_host_tests.host_tests_plugins.module_reset_ublox.HostTestPluginResetMethod_ublox.
Definition at line 69 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.is_os_supported | ( | self, | |
os_name = None ) |
In some cases a plugin will not work under particular OS mainly because command / software used to implement plugin functionality is not available e.g. on MacOS or Linux.
Reimplemented in mbed_host_tests.host_tests_plugins.module_copy_jn51xx.HostTestPluginCopyMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_copy_stlink.HostTestPluginCopyMethod_Stlink, mbed_host_tests.host_tests_plugins.module_copy_ublox.HostTestPluginCopyMethod_ublox, mbed_host_tests.host_tests_plugins.module_reset_jn51xx.HostTestPluginResetMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_reset_stlink.HostTestPluginResetMethod_Stlink, and mbed_host_tests.host_tests_plugins.module_reset_ublox.HostTestPluginResetMethod_ublox.
Definition at line 79 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.mbed_os_info | ( | self | ) |
Returns information about host OS.
Definition at line 246 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.mbed_os_support | ( | self | ) |
Function used to determine host OS.
This function should be ported for new OS support
Definition at line 257 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.print_plugin_char | ( | self, | |
char ) |
Function prints char on stdout
Definition at line 109 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.print_plugin_error | ( | self, | |
text ) |
Interface helper methods - overload only if you need to have custom behaviour.
Function prints error in console and exits always with False
text | Text to print |
Definition at line 93 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.print_plugin_info | ( | self, | |
text, | |||
NL = True ) |
Function prints notification in console and exits always with True.
text | Text to print |
NL | Deprecated! Newline will be added behind text if this flag is True |
Definition at line 100 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.run_command | ( | self, | |
cmd, | |||
shell = True ) |
Runs command from command line.
cmd | Command to execute |
shell | True if shell command should be executed (eg. ls, ps) |
Function prints 'cmd' return code if execution failed
Definition at line 227 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.setup | ( | self, | |
* | args, | ||
** | kwargs ) |
Interface methods.
Configure plugin, this function should be called before plugin execute() method is used.
Reimplemented in mbed_host_tests.host_tests_plugins.module_copy_jn51xx.HostTestPluginCopyMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_copy_mbed.HostTestPluginCopyMethod_Mbed, mbed_host_tests.host_tests_plugins.module_copy_mps2.HostTestPluginCopyMethod_MPS2, mbed_host_tests.host_tests_plugins.module_copy_pyocd.HostTestPluginCopyMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_copy_shell.HostTestPluginCopyMethod_Shell, mbed_host_tests.host_tests_plugins.module_copy_silabs.HostTestPluginCopyMethod_Silabs, mbed_host_tests.host_tests_plugins.module_copy_stlink.HostTestPluginCopyMethod_Stlink, mbed_host_tests.host_tests_plugins.module_copy_ublox.HostTestPluginCopyMethod_ublox, mbed_host_tests.host_tests_plugins.module_power_cycle_mbed.HostTestPluginPowerCycleResetMethod, mbed_host_tests.host_tests_plugins.module_reset_jn51xx.HostTestPluginResetMethod_JN51xx, mbed_host_tests.host_tests_plugins.module_reset_mbed.HostTestPluginResetMethod_Mbed, mbed_host_tests.host_tests_plugins.module_reset_mps2.HostTestPluginResetMethod_MPS2, mbed_host_tests.host_tests_plugins.module_reset_pyocd.HostTestPluginResetMethod_pyOCD, mbed_host_tests.host_tests_plugins.module_reset_silabs.HostTestPluginResetMethod_SiLabs, mbed_host_tests.host_tests_plugins.module_reset_stlink.HostTestPluginResetMethod_Stlink, and mbed_host_tests.host_tests_plugins.module_reset_ublox.HostTestPluginResetMethod_ublox.
Definition at line 64 of file host_test_plugins.py.
|
static |
Definition at line 44 of file host_test_plugins.py.
|
static |
Interface:
Interface attributes defining plugin name, type etc.
Definition at line 42 of file host_test_plugins.py.
mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.plugin_logger = ht_loggers.get(self.type, ht_loggers['BasePlugin']) |
Definition at line 58 of file host_test_plugins.py.
|
static |
Definition at line 46 of file host_test_plugins.py.
|
static |
Definition at line 47 of file host_test_plugins.py.
|
static |
Definition at line 43 of file host_test_plugins.py.