|
Mbed Host Tests
|
Base class for all plugins used with host tests. More...
Public Member Functions | |
| def | __init__ (self) |
| def | setup (self, args, kwargs) |
| Interface methods. More... | |
| def | execute (self, capability, args, kwargs) |
| Executes capability by name. More... | |
| def | is_os_supported (self, os_name=None) |
| def | print_plugin_error (self, text) |
| Interface helper methods - overload only if you need to have custom behaviour. More... | |
| def | print_plugin_info (self, text, NL=True) |
| Function prints notification in console and exits always with True. More... | |
| def | print_plugin_char (self, char) |
| def | 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. More... | |
| def | 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. More... | |
| def | 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. More... | |
| def | run_command (self, cmd, shell=True) |
| Runs command from command line. More... | |
| def | mbed_os_info (self) |
| Returns information about host OS. More... | |
| def | mbed_os_support (self) |
| Function used to determine host OS. More... | |
Public Attributes | |
| plugin_logger | |
Static Public Attributes | |
| string | name = "HostTestPluginBase" |
| Interface: More... | |
| string | 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.
| def mbed_host_tests.host_tests_plugins.host_test_plugins.HostTestPluginBase.__init__ | ( | self | ) |
ctor
Definition at line 49 of file host_test_plugins.py.
| def 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.
| def 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.
| def 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.
| def 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
Definition at line 69 of file host_test_plugins.py.
| def 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.
Definition at line 79 of file host_test_plugins.py.
| def 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.
| def 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.
| def 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.
| def 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.
| def 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.
| def 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.
| def 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.
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 |
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.