labgrid.driver package¶
Submodules¶
labgrid.driver.bareboxdriver module¶
-
class
labgrid.driver.bareboxdriver.
BareboxDriver
(target, name, prompt='', autoboot='stop autoboot', interrupt='n', startstring='[\n]barebox 20\d+', bootstring='Linux version \d', password='', login_timeout=60) → None[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin
,labgrid.driver.common.Driver
,labgrid.protocol.commandprotocol.CommandProtocol
,labgrid.protocol.linuxbootprotocol.LinuxBootProtocol
- BareboxDriver - Driver to control barebox via the console.
- BareboxDriver binds on top of a ConsoleProtocol.
Parameters: - prompt (str) – The default Barebox Prompt
- startstring (str) – string that indicates that Barebox is starting
- bootstring (str) – string that indicates that the Kernel is booting
- password (str) – optional, password to use for access to the shell
- login_timeout (int) – optional, timeout for access to the shell
-
bindings
= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
on_activate
()[source]¶ Activate the BareboxDriver
This function tries to login if not already active
-
get_status
()[source]¶ Retrieve status of the BareboxDriver 0 means inactive, 1 means active.
Returns: status of the driver Return type: int
-
await_boot
()[source]¶ Wait for the initial Linux version string to verify we succesfully jumped into the kernel.
-
boot
(name: str)[source]¶ Boot the default or a specific boot entry
Parameters: name (str) – name of the entry to boot
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='autoboot', default='stop autoboot', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='startstring', default='[\\n]barebox 20\\d+', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='login_timeout', default=60, validator=<instance_of validator for type <class 'int'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, prompt='', autoboot='stop autoboot', interrupt='\n', startstring='[\\n]barebox 20\\d+', bootstring='Linux version \\d', password='', login_timeout=60) → None¶
-
__module__
= 'labgrid.driver.bareboxdriver'¶
-
__repr__
()¶ Automatically created by attrs.
labgrid.driver.commandmixin module¶
-
class
labgrid.driver.commandmixin.
CommandMixin
[source]¶ Bases:
object
CommandMixin implementing common functions for drivers which support the CommandProtocol
-
run_check
(cmd: str, *, timeout=30, codec='utf-8', decodeerrors='strict')[source]¶ External run_check function, only available if the driver is active. Runs the supplied command and returns the stdout, raises an ExecutionError otherwise.
Parameters: cmd (str) – command to run on the shell Returns: stdout of the executed command Return type: List[str]
-
__dict__
= mappingproxy({'__weakref__': <attribute '__weakref__' of 'CommandMixin' objects>, 'wait_for': <function CommandMixin.wait_for>, '_run_check': <function CommandMixin._run_check>, '__doc__': '\n CommandMixin implementing common functions for drivers which support the CommandProtocol\n ', '__attrs_post_init__': <function CommandMixin.__attrs_post_init__>, 'run_check': <function CommandMixin.run_check>, '__dict__': <attribute '__dict__' of 'CommandMixin' objects>, '__module__': 'labgrid.driver.commandmixin'})¶
-
__module__
= 'labgrid.driver.commandmixin'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.driver.common module¶
-
class
labgrid.driver.common.
Driver
(target, name) → None[source]¶ Bases:
labgrid.binding.BindingMixin
Represents a driver which is used externally or by other drivers. It implements functionality based on directly accessing the Resource or by building on top of other Drivers.
Life cycle: - create - bind (n times) - activate - usage - deactivate
-
get_priority
(protocol)[source]¶ Retrieve the priority for a given protocol
Arguments: protocol - protocol to search for in the MRO
Returns: value of the priority if it is found, 0 otherwise. Return type: Int
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.common'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.consoleexpectmixin module¶
-
class
labgrid.driver.consoleexpectmixin.
ConsoleExpectMixin
[source]¶ Bases:
object
Console driver mixin to implement the read, write, expect and sendline methods. It uses the internal _read and _write methods.
The class using the ConsoleExpectMixin must provide a logger and a txdelay attribute.
-
__dict__
= mappingproxy({'sendline': <function ConsoleExpectMixin.sendline>, '__dict__': <attribute '__dict__' of 'ConsoleExpectMixin' objects>, 'read': <function ConsoleExpectMixin.read>, '__doc__': '\n Console driver mixin to implement the read, write, expect and sendline methods. It uses\n the internal _read and _write methods.\n\n The class using the ConsoleExpectMixin must provide a logger and a txdelay attribute.\n ', 'write': <function ConsoleExpectMixin.write>, '__module__': 'labgrid.driver.consoleexpectmixin', 'expect': <function ConsoleExpectMixin.expect>, 'sendcontrol': <function ConsoleExpectMixin.sendcontrol>, '__attrs_post_init__': <function ConsoleExpectMixin.__attrs_post_init__>, 'resolve_conflicts': <function ConsoleExpectMixin.resolve_conflicts>, '__weakref__': <attribute '__weakref__' of 'ConsoleExpectMixin' objects>})¶
-
__module__
= 'labgrid.driver.consoleexpectmixin'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.driver.exception module¶
-
exception
labgrid.driver.exception.
ExecutionError
(msg, stdout=None, stderr=None) → None[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='stdout', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='stderr', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(msg, stdout=None, stderr=None) → None¶
-
__module__
= 'labgrid.driver.exception'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.driver.exception.
CleanUpError
(msg) → None[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False),)¶
-
__init__
(msg) → None¶
-
__module__
= 'labgrid.driver.exception'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.driver.externalconsoledriver module¶
-
class
labgrid.driver.externalconsoledriver.
ExternalConsoleDriver
(target, name, cmd, txdelay=0.0) → None[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin
,labgrid.driver.common.Driver
,labgrid.protocol.consoleprotocol.ConsoleProtocol
Driver implementing the ConsoleProtocol interface using a subprocess
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='cmd', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, cmd, txdelay=0.0) → None¶
-
__module__
= 'labgrid.driver.externalconsoledriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.fake module¶
-
class
labgrid.driver.fake.
FakeCommandDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin
,labgrid.driver.common.Driver
,labgrid.protocol.commandprotocol.CommandProtocol
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.fake'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.fake.
FakeConsoleDriver
(target, name, txdelay=0.0) → None[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin
,labgrid.driver.common.Driver
,labgrid.protocol.consoleprotocol.ConsoleProtocol
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, txdelay=0.0) → None¶
-
__module__
= 'labgrid.driver.fake'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.fake.
FakeFileTransferDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.filetransferprotocol.FileTransferProtocol
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.fake'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.fake.
FakePowerDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.powerprotocol.PowerProtocol
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.fake'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.fastbootdriver module¶
-
class
labgrid.driver.fastbootdriver.
AndroidFastbootDriver
(target, name, image=None) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'fastboot': {<class 'labgrid.resource.udev.AndroidFastboot'>, <class 'labgrid.resource.remote.NetworkAndroidFastboot'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, image=None) → None¶
-
__module__
= 'labgrid.driver.fastbootdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.infodriver module¶
-
class
labgrid.driver.infodriver.
InfoDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.infoprotocol.InfoProtocol
InfoDriver implementing the InfoProtocol on top of CommandProtocol drivers
-
bindings
= {'command': <class 'labgrid.protocol.commandprotocol.CommandProtocol'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.infodriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.modbusdriver module¶
-
class
labgrid.driver.modbusdriver.
ModbusCoilDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol
-
bindings
= {'coil': <class 'labgrid.resource.modbus.ModbusTCPCoil'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.modbusdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.networkusbstoragedriver module¶
-
class
labgrid.driver.networkusbstoragedriver.
NetworkUSBStorageDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'storage': {<class 'labgrid.resource.remote.NetworkUSBMassStorage'>, <class 'labgrid.resource.remote.NetworkUSBSDMuxDevice'>, <class 'labgrid.resource.udev.USBSDMuxDevice'>, <class 'labgrid.resource.udev.USBMassStorage'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.networkusbstoragedriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.onewiredriver module¶
-
class
labgrid.driver.onewiredriver.
OneWirePIODriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol
-
bindings
= {'port': <class 'labgrid.resource.onewireport.OneWirePIO'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.onewiredriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.openocddriver module¶
-
class
labgrid.driver.openocddriver.
OpenOCDDriver
(target, name, config, search=[], image=None) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.bootstrapprotocol.BootstrapProtocol
-
bindings
= {'interface': {<class 'labgrid.resource.remote.NetworkAlteraUSBBlaster'>, <class 'labgrid.resource.udev.AlteraUSBBlaster'>}}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='config', default=NOTHING, validator=<instance_of validator for type (<class 'str'>, <class 'list'>)>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='search', default=[], validator=<optional validator for <instance_of validator for type (<class 'str'>, <class 'list'>)> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, config, search=[], image=None) → None¶
-
__module__
= 'labgrid.driver.openocddriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.powerdriver module¶
-
class
labgrid.driver.powerdriver.
PowerResetMixin
→ None[source]¶ Bases:
labgrid.protocol.resetprotocol.ResetProtocol
ResetMixin implements the ResetProtocol for drivers which support the PowerProtocol
-
priorities
= {<class 'labgrid.protocol.resetprotocol.ResetProtocol'>: -10}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= ()¶
-
__init__
() → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
ManualPowerDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
ManualPowerDriver - Driver to tell the user to control a target’s power
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
ExternalPowerDriver
(target, name, cmd_on, cmd_off, cmd_cycle=None, delay=2.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
ExternalPowerDriver - Driver using an external command to control a target’s power
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='cmd_on', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='cmd_off', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='cmd_cycle', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, cmd_on, cmd_off, cmd_cycle=None, delay=2.0) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
NetworkPowerDriver
(target, name, delay=2.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
NetworkPowerDriver - Driver using a networked power switch to control a target’s power
-
bindings
= {'port': <class 'labgrid.resource.power.NetworkPowerPort'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, delay=2.0) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
DigitalOutputPowerDriver
(target, name, delay=1.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
DigitalOutputPowerDriver uses a DigitalOutput to control the power of a DUT.
-
bindings
= {'output': <class 'labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, delay=1.0) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
YKUSHPowerDriver
(target, name, delay=2.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
YKUSHPowerDriver - Driver using a YEPKIT YKUSH switchable USB hub to control a target’s power - https://www.yepkit.com/products/ykush
-
bindings
= {'port': <class 'labgrid.resource.ykushpowerport.YKUSHPowerPort'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, delay=2.0) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.powerdriver.
USBPowerDriver
(target, name, delay=2.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.driver.powerdriver.PowerResetMixin
,labgrid.protocol.powerprotocol.PowerProtocol
USBPowerDriver - Driver using a power switchable USB hub and the uhubctl tool (https://github.com/mvp/uhubctl) to control a target’s power
-
bindings
= {'hub': {<class 'labgrid.resource.remote.NetworkUSBPowerPort'>, <class 'labgrid.resource.udev.USBPowerPort'>}}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, delay=2.0) → None¶
-
__module__
= 'labgrid.driver.powerdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.qemudriver module¶
The QEMUDriver implements a driver to use a QEMU target
-
class
labgrid.driver.qemudriver.
QEMUDriver
(target, name, qemu_bin, machine, cpu, memory, extra_args, boot_args=None, kernel=None, disk=None, rootfs=None, dtb=None, flash=None) → None[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin
,labgrid.driver.common.Driver
,labgrid.protocol.powerprotocol.PowerProtocol
,labgrid.protocol.consoleprotocol.ConsoleProtocol
The QEMUDriver implements an interface to start targets as qemu instances.
The kernel, flash, rootfs and dtb arguments refer to images and paths declared in the environment configuration.
Parameters: - qemu_bin (str) – reference to the tools key for the QEMU binary
- machine (str) – QEMU machine type
- cpu (str) – QEMU cpu type
- memory (str) – QEMU memory size (ends with M or G)
- extra_args (str) – extra QEMU arguments, they are passed directly to the QEMU binary
- boot_args (str) – optional, additional kernel boot argument
- kernel (str) – optional, reference to the images key for the kernel
- disk (str) – optional, reference to the images key for the disk image
- flash (str) – optional, reference to the images key for the flash image
- rootfs (str) – optional, reference to the paths key for use as the virtio-9p filesystem
- dtb (str) – optional, reference to the image key for the device tree
-
on
()[source]¶ Start the QEMU subprocess, accept the unix socket connection and afterwards start the emulator using a QMP Command
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='qemu_bin', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='machine', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='cpu', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='memory', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='extra_args', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='boot_args', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='kernel', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='disk', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='rootfs', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='dtb', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='flash', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, qemu_bin, machine, cpu, memory, extra_args, boot_args=None, kernel=None, disk=None, rootfs=None, dtb=None, flash=None) → None¶
-
__module__
= 'labgrid.driver.qemudriver'¶
-
__repr__
()¶ Automatically created by attrs.
labgrid.driver.quartushpsdriver module¶
-
class
labgrid.driver.quartushpsdriver.
QuartusHPSDriver
(target, name, image=None) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'interface': {<class 'labgrid.resource.remote.NetworkAlteraUSBBlaster'>, <class 'labgrid.resource.udev.AlteraUSBBlaster'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, image=None) → None¶
-
__module__
= 'labgrid.driver.quartushpsdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.resetdriver module¶
-
class
labgrid.driver.resetdriver.
DigitalOutputResetDriver
(target, name, delay=1.0) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.resetprotocol.ResetProtocol
DigitalOutputResetDriver - Driver using a DigitalOutput to reset the target
-
bindings
= {'output': <class 'labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='delay', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, delay=1.0) → None¶
-
__module__
= 'labgrid.driver.resetdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.serialdigitaloutput module¶
-
class
labgrid.driver.serialdigitaloutput.
SerialPortDigitalOutputDriver
(target, name, signal) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol
Controls the state of a GPIO using the control lines of a serial port.
This driver uses the flow-control pins of a serial port (for example an USB-UART-dongle) to control some external power switch. You may connect some kind of relay board to the flow control pins.
The serial port should NOT be used for serial communication at the same time. This will probably reset the flow-control signals.
Usable signals are DTR and RTS.
-
bindings
= {'serial': <class 'labgrid.driver.serialdriver.SerialDriver'>}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='signal', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, signal) → None¶
-
__module__
= 'labgrid.driver.serialdigitaloutput'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.serialdriver module¶
-
class
labgrid.driver.serialdriver.
SerialDriver
(target, name, txdelay=0.0) → None[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin
,labgrid.driver.common.Driver
,labgrid.protocol.consoleprotocol.ConsoleProtocol
Driver implementing the ConsoleProtocol interface over a SerialPort connection
-
bindings
= {'port': {<class 'labgrid.resource.serialport.NetworkSerialPort'>, <class 'labgrid.resource.base.SerialPort'>}}¶
-
message
= 'The installed pyserial version does not contain important RFC2217 fixes.\nYou can install the labgrid fork via:\npip uninstall pyserial\npip install https://github.com/labgrid-project/pyserial/archive/v3.4.0.1.zip#egg=pyserial\n'¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, txdelay=0.0) → None¶
-
__module__
= 'labgrid.driver.serialdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.shelldriver module¶
The ShellDriver provides the CommandProtocol, ConsoleProtocol and InfoProtocol on top of a SerialPort.
-
class
labgrid.driver.shelldriver.
ShellDriver
(target, name, prompt, login_prompt, username, password='', keyfile='', login_timeout=60, console_ready='', await_login_timeout=2) → None[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin
,labgrid.driver.common.Driver
,labgrid.protocol.commandprotocol.CommandProtocol
,labgrid.protocol.filetransferprotocol.FileTransferProtocol
ShellDriver - Driver to execute commands on the shell ShellDriver binds on top of a ConsoleProtocol.
Parameters: - prompt (regex) – the shell prompt to detect
- login_prompt (regex) – the login prompt to detect
- username (str) – username to login with
- password (str) – password to login with
- keyfile (str) – keyfile to bind mount over users authorized keys
- login_timeout (int) – optional, timeout for login prompt detection
-
bindings
= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
get_status
()[source]¶ Returns the status of the shell-driver. 0 means not connected/found, 1 means shell
-
put_bytes
(buf: bytes, remotefile: str)[source]¶ Upload a file to the target. Will silently overwrite the remote file if it already exists.
Parameters: - buf (bytes) – file contents
- remotefile (str) – destination filename on the target
Raises: IOError
– if the provided localfile could not be foundExecutionError
– if something else went wrong
-
put
(localfile: str, remotefile: str)[source]¶ Upload a file to the target. Will silently overwrite the remote file if it already exists.
Parameters: - localfile (str) – source filename on the local machine
- remotefile (str) – destination filename on the target
Raises: IOError
– if the provided localfile could not be foundExecutionError
– if something else went wrong
-
get_bytes
(remotefile: str)[source]¶ Download a file from the target.
Parameters: remotefile (str) – source filename on the target
Returns: (bytes) file contents
Raises: IOError
– if localfile could be writtenExecutionError
– if something went wrong
-
get
(remotefile: str, localfile: str)[source]¶ Download a file from the target. Will silently overwrite the local file if it already exists.
Parameters: - remotefile (str) – source filename on the target
- localfile (str) – destination filename on the local machine (can be relative)
Raises: IOError
– if localfile could be writtenExecutionError
– if something went wrong
-
run_script
(data: bytes, timeout: int = 60)[source]¶ Upload a script to the target and run it.
Parameters: - data (bytes) – script data
- timeout (int) – timeout for the script to finish execution
Returns: str, stderr: str, return_value: int)
Return type: Tuple of (stdout
Raises: IOError
– if the provided localfile could not be foundExecutionError
– if something else went wrong
-
run_script_file
(scriptfile: str, *args, timeout: int = 60)[source]¶ Upload a script file to the target and run it.
Parameters: - scriptfile (str) – source file on the local file system to upload to the target
- *args – (list of str): any arguments for the script as positional arguments
- timeout (int) – timeout for the script to finish execution
Returns: str, stderr: str, return_value: int)
Return type: Tuple of (stdout
Raises: ExecutionError
– if something went wrongIOError
– if the provided localfile could not be found
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='login_prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='username', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='login_timeout', default=60, validator=<instance_of validator for type <class 'int'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='console_ready', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='await_login_timeout', default=2, validator=<instance_of validator for type <class 'int'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, prompt, login_prompt, username, password='', keyfile='', login_timeout=60, console_ready='', await_login_timeout=2) → None¶
-
__module__
= 'labgrid.driver.shelldriver'¶
-
__repr__
()¶ Automatically created by attrs.
labgrid.driver.sigrokdriver module¶
-
class
labgrid.driver.sigrokdriver.
SigrokDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
The SigrokDriver uses sigrok-cli to record samples and expose them as python dictionaries.
Parameters: bindings (dict) – driver to use with sigrok -
bindings
= {'sigrok': {<class 'labgrid.resource.remote.NetworkSigrokUSBDevice'>, <class 'labgrid.resource.sigrok.SigrokDevice'>, <class 'labgrid.resource.udev.SigrokUSBDevice'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.sigrokdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.smallubootdriver module¶
-
class
labgrid.driver.smallubootdriver.
SmallUBootDriver
(target, name, prompt='', password='', interrupt='n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\d+', bootstring='Linux version \d', boot_secret='a', login_timeout=60.0) → None[source]¶ Bases:
labgrid.driver.ubootdriver.UBootDriver
SmallUBootDriver is meant as a driver for UBoot with only little functionality compared to standard a standard UBoot. Especially is copes with the following limitations:
- The UBoot does not have a real password-prompt but can be activated by entering a “secret” after a message was displayed.
- The command line is does not have a build-in echo command. Thus this driver uses ‘Unknown Command’ messages as marker before and after the output of a command.
- Since there is no echo we can not return the exit code of the command. Commands will always return 0 unless the command was not found.
This driver needs the following features activated in UBoot to work:
- The UBoot must not have real password prompt. Instead it must be keyword activated. For example it should be activated by a dialog like the following: UBoot: “Autobooting in 1s…” Labgrid: “secret” UBoot: <switching to console>
- The UBoot must be able to parse multiple commands in a single line separated by “;”.
- The UBoot must support the “bootm” command to boot from a memory location.
This driver was created especially for the following devices:
- TP-Link WR841 v11
-
boot
(name)[source]¶ Boot the device from the given memory location using ‘bootm’.
Parameters: name (str) – address to boot
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='init_commands', default=Factory(factory=<class 'tuple'>, takes_self=False), validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<class 'tuple'>, kw_only=False), Attribute(name='password_prompt', default='enter Password:', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='boot_expression', default='U-Boot 20\\d+', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='boot_secret', default='a', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='login_timeout', default=60.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, prompt='', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', boot_secret='a', login_timeout=60.0) → None¶
-
__module__
= 'labgrid.driver.smallubootdriver'¶
-
__repr__
()¶ Automatically created by attrs.
labgrid.driver.sshdriver module¶
The SSHDriver uses SSH as a transport to implement CommandProtocol and FileTransferProtocol
-
class
labgrid.driver.sshdriver.
SSHDriver
(target, name, keyfile='', stderr_merge=False) → None[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin
,labgrid.driver.common.Driver
,labgrid.protocol.commandprotocol.CommandProtocol
,labgrid.protocol.filetransferprotocol.FileTransferProtocol
SSHDriver - Driver to execute commands via SSH
-
bindings
= {'networkservice': <class 'labgrid.resource.networkservice.NetworkService'>}¶
-
priorities
= {<class 'labgrid.protocol.filetransferprotocol.FileTransferProtocol'>: 10, <class 'labgrid.protocol.commandprotocol.CommandProtocol'>: 10}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='stderr_merge', default=False, validator=<instance_of validator for type <class 'bool'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, keyfile='', stderr_merge=False) → None¶
-
__module__
= 'labgrid.driver.sshdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.ubootdriver module¶
The U-Boot Module contains the UBootDriver
-
class
labgrid.driver.ubootdriver.
UBootDriver
(target, name, prompt='', password='', interrupt='n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\d+', bootstring='Linux version \d', login_timeout=30) → None[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin
,labgrid.driver.common.Driver
,labgrid.protocol.commandprotocol.CommandProtocol
,labgrid.protocol.linuxbootprotocol.LinuxBootProtocol
UBootDriver - Driver to control uboot via the console. UBootDriver binds on top of a ConsoleProtocol.
Parameters: - prompt (str) – The default UBoot Prompt
- password (str) – optional password to unlock UBoot
- init_commands (Tuple[str]) – a tuple of commands to run after unlock
- interrupt (str) – interrupt character to use to go to prompt
- password_prompt (str) – string to detect the password prompt
- boot_expression (str) – string to search for on UBoot start
- bootstring (str) – string that indicates that the Kernel is booting
- login_timeout (int) – optional, timeout for login prompt detection
-
bindings
= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
on_activate
()[source]¶ Activate the UBootDriver
This function checks for a prompt and awaits it if not already active
-
run
(cmd, timeout=None)[source]¶ Runs the specified command on the shell and returns the output.
Parameters: cmd (str) – command to run on the shell Returns: if successful, None otherwise Return type: Tuple[List[str],List[str], int]
-
get_status
()[source]¶ Retrieve status of the UBootDriver. 0 means inactive, 1 means active.
Returns: status of the driver Return type: int
-
await_boot
()[source]¶ Wait for the initial Linux version string to verify we succesfully jumped into the kernel.
-
boot
(name)[source]¶ Boot the default or a specific boot entry
Parameters: name (str) – name of the entry to boot
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='init_commands', default=Factory(factory=<class 'tuple'>, takes_self=False), validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<class 'tuple'>, kw_only=False), Attribute(name='password_prompt', default='enter Password:', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='boot_expression', default='U-Boot 20\\d+', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='login_timeout', default=30, validator=<instance_of validator for type <class 'int'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, prompt='', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', login_timeout=30) → None¶
-
__module__
= 'labgrid.driver.ubootdriver'¶
-
__repr__
()¶ Automatically created by attrs.
labgrid.driver.usbloader module¶
-
class
labgrid.driver.usbloader.
MXSUSBDriver
(target, name, image=None) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.bootstrapprotocol.BootstrapProtocol
-
bindings
= {'loader': {<class 'labgrid.resource.remote.NetworkMXSUSBLoader'>, <class 'labgrid.resource.udev.MXSUSBLoader'>}}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, image=None) → None¶
-
__module__
= 'labgrid.driver.usbloader'¶
-
__repr__
()¶ Automatically created by attrs.
-
-
class
labgrid.driver.usbloader.
IMXUSBDriver
(target, name, image=None) → None[source]¶ Bases:
labgrid.driver.common.Driver
,labgrid.protocol.bootstrapprotocol.BootstrapProtocol
-
bindings
= {'loader': {<class 'labgrid.resource.remote.NetworkIMXUSBLoader'>, <class 'labgrid.resource.udev.IMXUSBLoader'>, <class 'labgrid.resource.remote.NetworkMXSUSBLoader'>, <class 'labgrid.resource.udev.MXSUSBLoader'>}}¶
-
__abstractmethods__
= frozenset()¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, image=None) → None¶
-
__module__
= 'labgrid.driver.usbloader'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.usbsdmuxdriver module¶
-
class
labgrid.driver.usbsdmuxdriver.
USBSDMuxDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
The USBSDMuxDriver uses the usbsdmux tool (https://github.com/pengutronix/usbsdmux) to control the USB-SD-Mux hardware
Parameters: bindings (dict) – driver to use with usbsdmux -
bindings
= {'mux': {<class 'labgrid.resource.remote.NetworkUSBSDMuxDevice'>, <class 'labgrid.resource.udev.USBSDMuxDevice'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.usbsdmuxdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.usbstorage module¶
-
class
labgrid.driver.usbstorage.
USBStorageDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'storage': {<class 'labgrid.resource.udev.USBSDMuxDevice'>, <class 'labgrid.resource.udev.USBMassStorage'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.usbstorage'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.usbtmcdriver module¶
-
class
labgrid.driver.usbtmcdriver.
USBTMCDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'tmc': {<class 'labgrid.resource.remote.NetworkUSBTMC'>, <class 'labgrid.resource.udev.USBTMC'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.usbtmcdriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.usbvideodriver module¶
-
class
labgrid.driver.usbvideodriver.
USBVideoDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
-
bindings
= {'video': {<class 'labgrid.resource.udev.USBVideo'>, <class 'labgrid.resource.remote.NetworkUSBVideo'>}}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.usbvideodriver'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.driver.xenadriver module¶
-
class
labgrid.driver.xenadriver.
XenaDriver
(target, name) → None[source]¶ Bases:
labgrid.driver.common.Driver
Xena Driver
-
bindings
= {'xena_manager': <class 'labgrid.resource.xenamanager.XenaManager'>}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶
-
__module__
= 'labgrid.driver.xenadriver'¶
-
__repr__
()¶ Automatically created by attrs.
-