labgrid.driver package¶
Subpackages¶
Submodules¶
labgrid.driver.bareboxdriver module¶
-
class
labgrid.driver.bareboxdriver.BareboxDriver(target, prompt='')[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin,labgrid.driver.common.Driver,labgrid.protocol.commandprotocol.CommandProtocol,labgrid.protocol.linuxbootprotocol.LinuxBootProtocolBareboxDriver - Driver to control barebox via the console
-
bindings= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
prompt= Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
run(cmd, *, step)[source]¶ Runs the specified cmd on the shell and returns the output.
Arguments: cmd - cmd to run on the shell
-
run_check(cmd)[source]¶ Runs the specified cmd on the shell and returns the output if successful, raises ExecutionError otherwise.
Arguments: cmd - cmd to run on the shell
-
labgrid.driver.commandmixin module¶
labgrid.driver.common module¶
-
class
labgrid.driver.common.Driver(target)[source]¶ Bases:
labgrid.binding.BindingMixinRepresents 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
labgrid.driver.consoleexpectmixin module¶
labgrid.driver.exception module¶
labgrid.driver.externalconsoledriver module¶
-
class
labgrid.driver.externalconsoledriver.ExternalConsoleDriver(target, cmd)[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin,labgrid.driver.common.Driver,labgrid.protocol.consoleprotocol.ConsoleProtocolDriver implementing the ConsoleProtocol interface using a subprocess
-
cmd= Attribute(name='cmd', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
labgrid.driver.fake module¶
-
class
labgrid.driver.fake.FakeConsoleDriver(target)[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin,labgrid.driver.common.Driver,labgrid.protocol.consoleprotocol.ConsoleProtocol
-
class
labgrid.driver.fake.FakeCommandDriver(target)[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin,labgrid.driver.common.Driver,labgrid.protocol.commandprotocol.CommandProtocol
-
class
labgrid.driver.fake.FakeFileTransferDriver(target)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.filetransferprotocol.FileTransferProtocol
labgrid.driver.fastbootdriver module¶
-
class
labgrid.driver.fastbootdriver.AndroidFastbootDriver(target, image=None)[source]¶ Bases:
labgrid.driver.common.Driver-
bindings= {'fastboot': {<class 'labgrid.resource.remote.NetworkAndroidFastboot'>, <class 'labgrid.resource.udev.AndroidFastboot'>}}¶
-
image= Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
labgrid.driver.infodriver module¶
-
class
labgrid.driver.infodriver.InfoDriver(target)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.infoprotocol.InfoProtocolInfoDriver implementing the InfoProtocol on top of CommandProtocol drivers
-
bindings= {'command': <class 'labgrid.protocol.commandprotocol.CommandProtocol'>}¶
-
labgrid.driver.onewiredriver module¶
-
class
labgrid.driver.onewiredriver.OneWirePIODriver(target)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol-
bindings= {'port': <class 'labgrid.resource.onewireport.OneWirePIO'>}¶
-
labgrid.driver.powerdriver module¶
-
class
labgrid.driver.powerdriver.ManualPowerDriver(target, name)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.powerprotocol.PowerProtocolManualPowerDriver - Driver to tell the user to control a target’s power
-
name= Attribute(name='name', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
class
labgrid.driver.powerdriver.ExternalPowerDriver(target, cmd_on, cmd_off, cmd_cycle=None, delay=2.0)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.powerprotocol.PowerProtocolExternalPowerDriver - Driver using an external command to control a target’s power
-
cmd_on= Attribute(name='cmd_on', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
cmd_off= Attribute(name='cmd_off', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
cmd_cycle= Attribute(name='cmd_cycle', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
delay= Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
class
labgrid.driver.powerdriver.NetworkPowerDriver(target, delay=2.0)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.powerprotocol.PowerProtocolNetworkPowerDriver - Driver using a networked power switch to control a target’s power
-
bindings= {'port': <class 'labgrid.resource.power.NetworkPowerPort'>}¶
-
delay= Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
class
labgrid.driver.powerdriver.DigitalOutputPowerDriver(target, cmd_on, cmd_off, delay=1.0)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.powerprotocol.PowerProtocolDigitalOutputPowerDriver - Driver using a DigitalOutput to reset the target and subprocesses to turn it on and off
-
bindings= {'output': <class 'labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol'>}¶
-
cmd_on= Attribute(name='cmd_on', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
cmd_off= Attribute(name='cmd_off', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
delay= Attribute(name='delay', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
labgrid.driver.serialdriver module¶
-
class
labgrid.driver.serialdriver.SerialDriver(target)[source]¶ Bases:
labgrid.driver.consoleexpectmixin.ConsoleExpectMixin,labgrid.driver.common.Driver,labgrid.protocol.consoleprotocol.ConsoleProtocolDriver implementing the ConsoleProtocol interface over a SerialPort connection
-
bindings= {'port': {<class 'labgrid.resource.serialport.NetworkSerialPort'>, <class 'labgrid.resource.base.SerialPort'>}}¶
-
labgrid.driver.shelldriver module¶
The ShellDriver provides the CommandProtocol, ConsoleProtocol and InfoProtocol on top of a SerialPort.
-
class
labgrid.driver.shelldriver.ShellDriver(target, prompt, login_prompt, username, password='', keyfile='')[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin,labgrid.driver.common.Driver,labgrid.protocol.commandprotocol.CommandProtocolShellDriver - Driver to execute commands on the shell
-
bindings= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
prompt= Attribute(name='prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
login_prompt= Attribute(name='login_prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
username= Attribute(name='username', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
password= Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
keyfile= Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
run(cmd, *, step)[source]¶ Runs the specified cmd on the shell and returns the output.
Arguments: cmd - cmd to run on the shell
-
run_check(cmd)[source]¶ Runs the specified cmd on the shell and returns the output if successful, raises ExecutionError otherwise.
Arguments: cmd - cmd to run on the shell
-
labgrid.driver.sshdriver module¶
The SSHDriver uses SSH as a transport to implement CommandProtocol and FileTransferProtocol
-
class
labgrid.driver.sshdriver.SSHDriver(target, keyfile='')[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin,labgrid.driver.common.Driver,labgrid.protocol.commandprotocol.CommandProtocol,labgrid.protocol.filetransferprotocol.FileTransferProtocolSSHDriver - Driver to execute commands via SSH
-
bindings= {'networkservice': <class 'labgrid.resource.networkservice.NetworkService'>}¶
-
keyfile= Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
run(cmd)[source]¶ Execute cmd on the target.
This method runs the specified cmd as a command on its target. It uses the ssh shell command to run the command and parses the exitcode. cmd - command to be run on the target
returns: (stdout, stderr, returncode)
-
labgrid.driver.ubootdriver module¶
The U-Boot Module contains the UBootDriver
-
class
labgrid.driver.ubootdriver.UBootDriver(target, prompt='', password='', init_commands=NOTHING)[source]¶ Bases:
labgrid.driver.commandmixin.CommandMixin,labgrid.driver.common.Driver,labgrid.protocol.commandprotocol.CommandProtocol,labgrid.protocol.linuxbootprotocol.LinuxBootProtocolUBootDriver - Driver to control uboot via the console
-
bindings= {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}¶
-
prompt= Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
password= Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
init_commands= Attribute(name='init_commands', default=Factory(factory=<class 'tuple'>), validator=None, repr=True, cmp=True, hash=True, init=True, convert=<class 'tuple'>, metadata=mappingproxy({}))¶
-
run(cmd)[source]¶ Runs the specified cmd on the shell and returns the output.
Arguments: cmd - cmd to run on the shell
-
run_check(cmd)[source]¶ Runs the specified cmd on the shell and returns the output if successful, raises ExecutionError otherwise.
Arguments: cmd - cmd to run on the shell
-
labgrid.driver.usbloader module¶
-
class
labgrid.driver.usbloader.MXSUSBDriver(target, image=None)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.bootstrapprotocol.BootstrapProtocol-
bindings= {'loader': {<class 'labgrid.resource.remote.NetworkMXSUSBLoader'>, <class 'labgrid.resource.udev.MXSUSBLoader'>}}¶
-
image= Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
class
labgrid.driver.usbloader.IMXUSBDriver(target, image=None)[source]¶ Bases:
labgrid.driver.common.Driver,labgrid.protocol.bootstrapprotocol.BootstrapProtocol-
bindings= {'loader': {<class 'labgrid.resource.remote.NetworkIMXUSBLoader'>, <class 'labgrid.resource.udev.IMXUSBLoader'>}}¶
-
image= Attribute(name='image', default=None, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-