labgrid.driver package

Subpackages

Submodules

labgrid.driver.bareboxdriver module

class labgrid.driver.bareboxdriver.BareboxDriver(target, name, prompt='', autoboot='stop autoboot', interrupt='\n', bootstring='Linux version \\d', password='', login_timeout=60)[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.

On activation, the BareboxDriver will look for the barebox prompt on the console, stopping any autoboot counters if necessary, and provide access to the barebox shell.

Parameters
  • prompt (str) – barebox prompt to match

  • autoboot (regex) – optional, autoboot message to match

  • interrupt (str) – optional, string to interrupt autoboot (use “” for CTRL-C)

  • bootstring (regex) – optional, regex indicating that the Linux 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: Dict[str, Any] = {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}
__attrs_post_init__()[source]
on_activate()[source]

Activate the BareboxDriver

This function tries to login if not already active

on_deactivate()[source]

Deactivate the BareboxDriver

Simply sets the internal status to 0

run(cmd: str, *, timeout: int = 30)[source]

Run a command

reset()[source]

Reset the board via a CPU reset

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, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='autoboot', default='stop autoboot', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='login_timeout', default=60, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, prompt='', autoboot='stop autoboot', interrupt='\n', bootstring='Linux version \\d', password='', login_timeout=60) None

Method generated by attrs for class BareboxDriver.

__module__ = 'labgrid.driver.bareboxdriver'
__repr__()

Method generated by attrs for class BareboxDriver.

labgrid.driver.commandmixin module

class labgrid.driver.commandmixin.CommandMixin[source]

Bases: object

CommandMixin implementing common functions for drivers which support the CommandProtocol

__attrs_post_init__()[source]
wait_for(cmd, pattern, timeout=30.0, sleepduration=1)[source]

Wait until the pattern is detected in the output of cmd. Raises ExecutionError when the timeout expires.

Parameters
  • cmd (str) – command to run on the shell

  • pattern (str) – pattern as a string to look for in the output

  • timeout (float) – timeout for the pattern detection

  • sleepduration (int) – sleep time between the runs of the cmd

poll_until_success(cmd, *, expected=0, tries=None, timeout=30.0, sleepduration=1)[source]

Poll a command until a specific exit code is detected. Takes a timeout and the number of tries to run the cmd. The sleepduration argument sets the duration between runs of the cmd.

Parameters
  • cmd (str) – command to run on the shell

  • expected (int) – exitcode to detect

  • tries (int) – number of tries, can be None for infinite tries

  • timeout (float) – timeout for the exitcode detection

  • sleepduration (int) – sleep time between the runs of the cmd

Returns

whether the command finally executed sucessfully

Return type

bool

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({'__module__': 'labgrid.driver.commandmixin', '__doc__': '\n    CommandMixin implementing common functions for drivers which support the CommandProtocol\n    ', '__attrs_post_init__': <function CommandMixin.__attrs_post_init__>, 'wait_for': <function CommandMixin.wait_for>, 'poll_until_success': <function CommandMixin.poll_until_success>, '_run_check': <function CommandMixin._run_check>, 'run_check': <function CommandMixin.run_check>, '__dict__': <attribute '__dict__' of 'CommandMixin' objects>, '__weakref__': <attribute '__weakref__' of 'CommandMixin' objects>, '__annotations__': {}})
__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)[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

__attrs_post_init__()[source]
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

get_export_name()[source]

Get the name to be used for exported variables.

Falls back to the class name if the driver has no name.

get_export_vars()[source]

Get a dictionary of variables to be exported.

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class Driver.

__module__ = 'labgrid.driver.common'
__repr__()

Method generated by attrs for class Driver.

labgrid.driver.common.check_file(filename, *, command_prefix=[])[source]

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.

__attrs_post_init__()[source]
read(size=1, timeout=0.0)[source]
write(data)[source]
sendline(line)[source]
sendcontrol(char)[source]
expect(pattern, timeout=- 1)[source]
settle(quiet_time, timeout=120.0)[source]
resolve_conflicts(client)[source]
__dict__ = mappingproxy({'__module__': 'labgrid.driver.consoleexpectmixin', '__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    ', '__attrs_post_init__': <function ConsoleExpectMixin.__attrs_post_init__>, 'read': <function ConsoleExpectMixin.read>, 'write': <function ConsoleExpectMixin.write>, 'sendline': <function ConsoleExpectMixin.sendline>, 'sendcontrol': <function ConsoleExpectMixin.sendcontrol>, 'expect': <function ConsoleExpectMixin.expect>, 'settle': <function ConsoleExpectMixin.settle>, 'resolve_conflicts': <function ConsoleExpectMixin.resolve_conflicts>, '__dict__': <attribute '__dict__' of 'ConsoleExpectMixin' objects>, '__weakref__': <attribute '__weakref__' of 'ConsoleExpectMixin' objects>, '__annotations__': {}})
__module__ = 'labgrid.driver.consoleexpectmixin'
__weakref__

list of weak references to the object (if defined)

labgrid.driver.deditecrelaisdriver module

class labgrid.driver.deditecrelaisdriver.DeditecRelaisDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'relais': {<class 'labgrid.resource.remote.NetworkDeditecRelais8'>, 'DeditecRelais8'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class DeditecRelaisDriver.

__module__ = 'labgrid.driver.deditecrelaisdriver'
__repr__()

Method generated by attrs for class DeditecRelaisDriver.

labgrid.driver.dockerdriver module

Class for connecting to a docker daemon running on the host machine.

class labgrid.driver.dockerdriver.DockerDriver(target, name, image_uri=None, command=None, volumes=None, container_name=None, environment=None, host_config=None, network_services=None)[source]

Bases: labgrid.protocol.powerprotocol.PowerProtocol, labgrid.driver.common.Driver

The DockerDriver is used to create docker containers. This is done via communication with a docker daemon.

When a container is created the container is labeled with an cleanup strategy identifier. Currently only one strategy is implemented. This strategy simply deletes all labgrid created containers before each test run. This is to ensure cleanup of dangling containers from crashed tests or hanging containers.

Image pruning is not done by the driver.

For detailed information about the arguments see the “Docker SDK for Python” documentation https://docker-py.readthedocs.io/en/stable/containers.html#container-objects

Parameters

bindings (dict) – The labgrid bindings

Args passed to docker.create_container:

image_uri (str): The uri of the image to fetch command (str): The command to execute once container has been created volumes (list): The volumes to declare environment (list): Docker environment variables to set host_config (dict): Docker host configuration parameters network_services (list): Sequence of dicts each specifying a network service that the docker container exposes.

bindings: Dict[str, Any] = {'docker_daemon': {'DockerDaemon'}}
__attrs_post_init__()[source]
on_activate()[source]

On activation: 1. Import docker module (_client and _container remain available) 2. Connect to the docker daemon 3. Pull requested image from docker registry if needed 4. Create the new container according to parameters from conf

on_deactivate()[source]

Remove container after use

on()[source]

Start the container created during activation

off()[source]

Stop the container created during activation

cycle()[source]

Cycle the docker container by stopping and starting it

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image_uri', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='command', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='volumes', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='container_name', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='environment', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='host_config', default=None, validator=<optional validator for <instance_of validator for type <class 'dict'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='network_services', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image_uri=None, command=None, volumes=None, container_name=None, environment=None, host_config=None, network_services=None) None

Method generated by attrs for class DockerDriver.

__module__ = 'labgrid.driver.dockerdriver'
__repr__()

Method generated by attrs for class DockerDriver.

labgrid.driver.exception module

exception labgrid.driver.exception.ExecutionError(msg, stdout=None, stderr=None)[source]

Bases: Exception

__attrs_attrs__ = (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='stdout', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='stderr', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(msg, stdout=None, stderr=None) None

Method generated by attrs for class ExecutionError.

__module__ = 'labgrid.driver.exception'
__repr__()

Method generated by attrs for class ExecutionError.

__weakref__

list of weak references to the object (if defined)

exception labgrid.driver.exception.CleanUpError(msg)[source]

Bases: Exception

__attrs_attrs__ = (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)
__init__(msg) None

Method generated by attrs for class CleanUpError.

__module__ = 'labgrid.driver.exception'
__repr__()

Method generated by attrs for class CleanUpError.

__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)[source]

Bases: labgrid.driver.consoleexpectmixin.ConsoleExpectMixin, labgrid.driver.common.Driver, labgrid.protocol.consoleprotocol.ConsoleProtocol

Driver implementing the ConsoleProtocol interface using a subprocess

__attrs_post_init__()[source]
open()[source]

Starts the subprocess, does nothing if it is already closed

close()[source]

Stops the subprocess, does nothing if it is already closed

on_deactivate()[source]

Called by the Target when this object has been deactivated

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='cmd', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, cmd, txdelay=0.0) None

Method generated by attrs for class ExternalConsoleDriver.

__module__ = 'labgrid.driver.externalconsoledriver'
__repr__()

Method generated by attrs for class ExternalConsoleDriver.

labgrid.driver.fake module

class labgrid.driver.fake.FakeConsoleDriver(target, name, txdelay=0.0)[source]

Bases: labgrid.driver.consoleexpectmixin.ConsoleExpectMixin, labgrid.driver.common.Driver, labgrid.protocol.consoleprotocol.ConsoleProtocol

__attrs_post_init__()[source]
open()[source]
close()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, txdelay=0.0) None

Method generated by attrs for class FakeConsoleDriver.

__module__ = 'labgrid.driver.fake'
__repr__()

Method generated by attrs for class FakeConsoleDriver.

class labgrid.driver.fake.FakeCommandDriver(target, name)[source]

Bases: labgrid.driver.commandmixin.CommandMixin, labgrid.driver.common.Driver, labgrid.protocol.commandprotocol.CommandProtocol

run(*args, timeout=None)[source]

Run a command

run_check(*args)[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]

get_status()[source]

Get status of the Driver

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class FakeCommandDriver.

__module__ = 'labgrid.driver.fake'
__repr__()

Method generated by attrs for class FakeCommandDriver.

class labgrid.driver.fake.FakeFileTransferDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.filetransferprotocol.FileTransferProtocol

get(*args)[source]
put(*args)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class FakeFileTransferDriver.

__module__ = 'labgrid.driver.fake'
__repr__()

Method generated by attrs for class FakeFileTransferDriver.

class labgrid.driver.fake.FakePowerDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.powerprotocol.PowerProtocol

on(*args)[source]
off(*args)[source]
cycle(*args)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class FakePowerDriver.

__module__ = 'labgrid.driver.fake'
__repr__()

Method generated by attrs for class FakePowerDriver.

labgrid.driver.fastbootdriver module

class labgrid.driver.fastbootdriver.AndroidFastbootDriver(target, name, boot_image=None, flash_images={}, sparse_size=None)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'fastboot': {'AndroidFastboot', 'NetworkAndroidFastboot'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

__call__(*args)[source]

Call self as a function.

boot(filename=None)[source]
flash(partition, filename=None)[source]
flash_all()[source]
run(cmd)[source]
continue_boot()[source]
getvar(var)[source]

Return variable value via ‘fastboot getvar <var>’.

oem_getenv(var)[source]

Return barebox environment variable value via ‘fastboot oem getenv <var>’.

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='boot_image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='flash_images', default={}, validator=<optional validator for <instance_of validator for type <class 'dict'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='sparse_size', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, boot_image=None, flash_images={}, sparse_size=None) None

Method generated by attrs for class AndroidFastbootDriver.

__module__ = 'labgrid.driver.fastbootdriver'
__repr__()

Method generated by attrs for class AndroidFastbootDriver.

labgrid.driver.filedigitaloutput module

class labgrid.driver.filedigitaloutput.FileDigitalOutputDriver(target, name, filepath, false_repr='0\n', true_repr='1\n')[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

Two arbitrary string values false_repr and true_repr are defined as representations for False and True. These values are written to a file and read from it. If the file’s content does not match any of the representations it defaults to False. A prime example for using this driver is Linux’s sysfs.

__attrs_post_init__()[source]
get()[source]

Implementations should return the status of the digital output.

set(status)[source]

Implementations should set the status of the digital output

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='filepath', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='false_repr', default='0\n', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='true_repr', default='1\n', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, filepath, false_repr='0\n', true_repr='1\n') None

Method generated by attrs for class FileDigitalOutputDriver.

__module__ = 'labgrid.driver.filedigitaloutput'
__repr__()

Method generated by attrs for class FileDigitalOutputDriver.

labgrid.driver.flashromdriver module

class labgrid.driver.flashromdriver.FlashromDriver(target, name, image=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

The Flashrom driver used the flashrom utility to write an image to a raw rom. The driver is a pure wrapper of the flashrom utility

bindings: Dict[str, Any] = {'flashrom_resource': {'Flashrom', <class 'labgrid.resource.flashrom.NetworkFlashrom'>}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

__call__(*args)[source]

Call self as a function.

load(filename=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class FlashromDriver.

__module__ = 'labgrid.driver.flashromdriver'
__repr__()

Method generated by attrs for class FlashromDriver.

labgrid.driver.flashscriptdriver module

class labgrid.driver.flashscriptdriver.FlashScriptDriver(target, name, script=None, args=NOTHING)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'device': {'NetworkUSBFlashableDevice', 'USBFlashableDevice'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

flash(script=None, args=None)[source]

Transfers and remotely executes the script

Parameters

script (str) – optional, path to the script to write to bound Flashable Device

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='script', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='args', default=Factory(factory=<class 'list'>, takes_self=False), validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, script=None, args=NOTHING) None

Method generated by attrs for class FlashScriptDriver.

__module__ = 'labgrid.driver.flashscriptdriver'
__repr__()

Method generated by attrs for class FlashScriptDriver.

labgrid.driver.gpiodriver module

All GPIO-related drivers

class labgrid.driver.gpiodriver.GpioDigitalOutputDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'gpio': {'NetworkSysfsGPIO', 'SysfsGPIO'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class GpioDigitalOutputDriver.

__module__ = 'labgrid.driver.gpiodriver'
__repr__()

Method generated by attrs for class GpioDigitalOutputDriver.

labgrid.driver.httpvideodriver module

class labgrid.driver.httpvideodriver.HTTPVideoDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.videoprotocol.VideoProtocol

bindings: Dict[str, Any] = {'video': 'HTTPVideoStream'}
get_qualities()[source]
stream(quality_hint=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class HTTPVideoDriver.

__module__ = 'labgrid.driver.httpvideodriver'
__repr__()

Method generated by attrs for class HTTPVideoDriver.

labgrid.driver.lxaiobusdriver module

class labgrid.driver.lxaiobusdriver.LXAIOBusPIODriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'pio': {'LXAIOBusPIO', 'NetworkLXAIOBusPIO'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class LXAIOBusPIODriver.

__module__ = 'labgrid.driver.lxaiobusdriver'
__repr__()

Method generated by attrs for class LXAIOBusPIODriver.

labgrid.driver.lxausbmuxdriver module

class labgrid.driver.lxausbmuxdriver.LXAUSBMuxDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

The LXAUSBMuxDriver uses the usbmuxctl tool to control the USBMux hardware

bindings: Dict[str, Any] = {'mux': {'LXAUSBMux', 'NetworkLXAUSBMux'}}
__attrs_post_init__()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class LXAUSBMuxDriver.

__module__ = 'labgrid.driver.lxausbmuxdriver'
__repr__()

Method generated by attrs for class LXAUSBMuxDriver.

labgrid.driver.manualswitchdriver module

class labgrid.driver.manualswitchdriver.ManualSwitchDriver(target, name, description=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

__attrs_post_init__()[source]
set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='description', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, description=None) None

Method generated by attrs for class ManualSwitchDriver.

__module__ = 'labgrid.driver.manualswitchdriver'
__repr__()

Method generated by attrs for class ManualSwitchDriver.

labgrid.driver.modbusdriver module

class labgrid.driver.modbusdriver.ModbusCoilDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'coil': 'ModbusTCPCoil'}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class ModbusCoilDriver.

__module__ = 'labgrid.driver.modbusdriver'
__repr__()

Method generated by attrs for class ModbusCoilDriver.

labgrid.driver.mqtt module

exception labgrid.driver.mqtt.MQTTError[source]

Bases: Exception

__module__ = 'labgrid.driver.mqtt'
__weakref__

list of weak references to the object (if defined)

class labgrid.driver.mqtt.TasmotaPowerDriver(target, name, delay=2.0, client=None, status=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.powerprotocol.PowerProtocol

bindings: Dict[str, Any] = {'power': {'TasmotaPowerPort'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_client', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_status', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=2.0, client=None, status=None) None

Method generated by attrs for class TasmotaPowerDriver.

__module__ = 'labgrid.driver.mqtt'
__repr__()

Method generated by attrs for class TasmotaPowerDriver.

labgrid.driver.networkinterfacedriver module

class labgrid.driver.networkinterfacedriver.NetworkInterfaceDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'iface': {'RemoteNetworkInterface', 'USBNetworkInterface'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

get_export_vars()[source]

Get a dictionary of variables to be exported.

configure(settings)[source]

Set a configuration on this interface and activate it.

wait_state(expected, timeout=60)[source]

Wait until the expected state is reached or the timeout expires.

Possible states include disconnected and activated. See NM’s DeviceState for more details.

disable()[source]

Disable and remove the created labgrid connection.

get_active_settings()[source]

Get the currently active settings from this interface.

get_settings()[source]

Get the settings of the labgrid connection for this interface.

get_state()[source]

Get the current state of this interface.

This includes information such as the addresses or WiFi connection.

get_dhcpd_leases()[source]

Get the list of active DHCP leases in shared mode.

This requires read access to /var/lib/NetworkManager/dnsmasq-* on the exporter.

request_scan()[source]

Request a scan to update the list visible access points.

get_access_points(scan=None)[source]

Get the list of currently visible access points.

When scan is None (the default), it will automatically trigger a scan if the last scan is more than 30 seconds old.

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class NetworkInterfaceDriver.

__module__ = 'labgrid.driver.networkinterfacedriver'
__repr__()

Method generated by attrs for class NetworkInterfaceDriver.

labgrid.driver.onewiredriver module

class labgrid.driver.onewiredriver.OneWirePIODriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'port': 'OneWirePIO'}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class OneWirePIODriver.

__module__ = 'labgrid.driver.onewiredriver'
__repr__()

Method generated by attrs for class OneWirePIODriver.

labgrid.driver.openocddriver module

class labgrid.driver.openocddriver.OpenOCDDriver(target, name, config=NOTHING, search=NOTHING, image=None, interface_config=None, board_config=None, load_commands=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

bindings: Dict[str, Any] = {'interface': {'AlteraUSBBlaster', 'NetworkAlteraUSBBlaster', 'NetworkUSBDebugger', 'USBDebugger'}}
__attrs_post_init__()[source]
load(filename=None)[source]
execute(commands: list)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='config', default=Factory(factory=<class 'list'>, takes_self=False), validator=<optional validator for <instance_of validator for type (<class 'str'>, <class 'list'>)> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='search', default=Factory(factory=<class 'list'>, takes_self=False), validator=<optional validator for <instance_of validator for type (<class 'str'>, <class 'list'>)> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='interface_config', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='board_config', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='load_commands', default=None, validator=<optional validator for <instance_of validator for type <class 'list'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, config=NOTHING, search=NOTHING, image=None, interface_config=None, board_config=None, load_commands=None) None

Method generated by attrs for class OpenOCDDriver.

__module__ = 'labgrid.driver.openocddriver'
__repr__()

Method generated by attrs for class OpenOCDDriver.

labgrid.driver.powerdriver module

class labgrid.driver.powerdriver.PowerResetMixin[source]

Bases: labgrid.protocol.resetprotocol.ResetProtocol

ResetMixin implements the ResetProtocol for drivers which support the PowerProtocol

priorities = {<class 'labgrid.protocol.resetprotocol.ResetProtocol'>: -10}
__attrs_post_init__()[source]
reset()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = ()
__init__() None

Method generated by attrs for class PowerResetMixin.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class PowerResetMixin.

class labgrid.driver.powerdriver.ManualPowerDriver(target, name)[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

on()[source]
off()[source]
cycle()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class ManualPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class ManualPowerDriver.

class labgrid.driver.powerdriver.SiSPMPowerDriver(target, name, delay=2.0)[source]

Bases: labgrid.driver.common.Driver, labgrid.driver.powerdriver.PowerResetMixin, labgrid.protocol.powerprotocol.PowerProtocol

SiSPMPowerDriver - Driver using a SiS-PM (Silver Shield PM) to control a target’s power using the sispmctl tool - http://sispmctl.sourceforge.net/

bindings: Dict[str, Any] = {'port': {'NetworkSiSPMPowerPort', 'SiSPMPowerPort'}}
__attrs_post_init__()[source]
on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=2.0) None

Method generated by attrs for class SiSPMPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class SiSPMPowerDriver.

class labgrid.driver.powerdriver.ExternalPowerDriver(target, name, cmd_on, cmd_off, cmd_cycle=None, delay=2.0)[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

on()[source]
off()[source]
cycle()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='cmd_on', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='cmd_off', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='cmd_cycle', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, cmd_on, cmd_off, cmd_cycle=None, delay=2.0) None

Method generated by attrs for class ExternalPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class ExternalPowerDriver.

class labgrid.driver.powerdriver.NetworkPowerDriver(target, name, delay=2.0)[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: Dict[str, Any] = {'port': <class 'labgrid.resource.power.NetworkPowerPort'>}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=2.0) None

Method generated by attrs for class NetworkPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class NetworkPowerDriver.

class labgrid.driver.powerdriver.DigitalOutputPowerDriver(target, name, delay=1.0)[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: Dict[str, Any] = {'output': <class 'labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol'>}
__attrs_post_init__()[source]
on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=1.0) None

Method generated by attrs for class DigitalOutputPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class DigitalOutputPowerDriver.

class labgrid.driver.powerdriver.YKUSHPowerDriver(target, name, delay=2.0)[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: Dict[str, Any] = {'port': 'YKUSHPowerPort'}
__attrs_post_init__()[source]
on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=2.0) None

Method generated by attrs for class YKUSHPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class YKUSHPowerDriver.

class labgrid.driver.powerdriver.USBPowerDriver(target, name, delay=2.0)[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: Dict[str, Any] = {'hub': {'NetworkUSBPowerPort', 'USBPowerPort'}}
__attrs_post_init__()[source]
on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=2.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=2.0) None

Method generated by attrs for class USBPowerDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class USBPowerDriver.

class labgrid.driver.powerdriver.PDUDaemonDriver(target, name, delay=5.0)[source]

Bases: labgrid.driver.common.Driver, labgrid.driver.powerdriver.PowerResetMixin, labgrid.protocol.powerprotocol.PowerProtocol

PDUDaemonDriver - Driver using a PDU port available via pdudaemon

bindings: Dict[str, Any] = {'port': 'PDUDaemonPort'}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on()[source]
off()[source]
cycle()[source]
get()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=5.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=5.0) None

Method generated by attrs for class PDUDaemonDriver.

__module__ = 'labgrid.driver.powerdriver'
__repr__()

Method generated by attrs for class PDUDaemonDriver.

labgrid.driver.provider module

class labgrid.driver.provider.BaseProviderDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

__attrs_post_init__()[source]
get_export_vars()[source]

Get a dictionary of variables to be exported.

stage(filename)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class BaseProviderDriver.

__module__ = 'labgrid.driver.provider'
__repr__()

Method generated by attrs for class BaseProviderDriver.

class labgrid.driver.provider.TFTPProviderDriver(target, name)[source]

Bases: labgrid.driver.provider.BaseProviderDriver

bindings: Dict[str, Any] = {'provider': {'RemoteTFTPProvider', 'TFTPProvider'}}
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class TFTPProviderDriver.

__module__ = 'labgrid.driver.provider'
__repr__()

Method generated by attrs for class TFTPProviderDriver.

class labgrid.driver.provider.NFSPProviderDriver(target, name)[source]

Bases: labgrid.driver.provider.BaseProviderDriver

bindings: Dict[str, Any] = {'provider': {'NFSProvider', 'RemoteNFSProvider'}}
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class NFSPProviderDriver.

__module__ = 'labgrid.driver.provider'
__repr__()

Method generated by attrs for class NFSPProviderDriver.

class labgrid.driver.provider.HTTPProviderDriver(target, name)[source]

Bases: labgrid.driver.provider.BaseProviderDriver

bindings: Dict[str, Any] = {'provider': {'HTTPProvider', 'RemoteHTTPProvider'}}
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class HTTPProviderDriver.

__module__ = 'labgrid.driver.provider'
__repr__()

Method generated by attrs for class HTTPProviderDriver.

labgrid.driver.pyvisadriver module

class labgrid.driver.pyvisadriver.PyVISADriver(target, name)[source]

Bases: labgrid.driver.common.Driver

The PyVISADriver provides a transparent layer to the PyVISA module allowing to get a pyvisa resource

Parameters

bindings (dict) – driver to use with PyVISA

bindings: Dict[str, Any] = {'pyvisa_resource': 'PyVISADevice'}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

get_session()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class PyVISADriver.

__module__ = 'labgrid.driver.pyvisadriver'
__repr__()

Method generated by attrs for class PyVISADriver.

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, bios=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

  • bios (str) – optional, reference to the image key for the bios image

__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

on()[source]

Start the QEMU subprocess, accept the unix socket connection and afterwards start the emulator using a QMP Command

off()[source]

Stop the emulator using a monitor command and await the exitcode

cycle()[source]

Cycle the emulator by restarting it

monitor_command(command)[source]

Execute a monitor_command via the QMP

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='qemu_bin', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='machine', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='cpu', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='memory', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='extra_args', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='boot_args', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='kernel', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='disk', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='rootfs', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='dtb', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='flash', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='bios', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, qemu_bin, machine, cpu, memory, extra_args, boot_args=None, kernel=None, disk=None, rootfs=None, dtb=None, flash=None, bios=None) None

Method generated by attrs for class QEMUDriver.

__module__ = 'labgrid.driver.qemudriver'
__repr__()

Method generated by attrs for class QEMUDriver.

labgrid.driver.quartushpsdriver module

class labgrid.driver.quartushpsdriver.QuartusHPSDriver(target, name, image=None)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'interface': {'AlteraUSBBlaster', 'NetworkAlteraUSBBlaster'}}
__attrs_post_init__()[source]
flash(filename=None, address=0)[source]
erase(address=None, size=None)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class QuartusHPSDriver.

__module__ = 'labgrid.driver.quartushpsdriver'
__repr__()

Method generated by attrs for class QuartusHPSDriver.

labgrid.driver.resetdriver module

class labgrid.driver.resetdriver.DigitalOutputResetDriver(target, name, delay=1.0)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.resetprotocol.ResetProtocol

DigitalOutputResetDriver - Driver using a DigitalOutput to reset the target

bindings: Dict[str, Any] = {'output': <class 'labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol'>}
__attrs_post_init__()[source]
reset()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=1.0) None

Method generated by attrs for class DigitalOutputResetDriver.

__module__ = 'labgrid.driver.resetdriver'
__repr__()

Method generated by attrs for class DigitalOutputResetDriver.

labgrid.driver.serialdigitaloutput module

class labgrid.driver.serialdigitaloutput.SerialPortDigitalOutputDriver(target, name, signal, invert)[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: Dict[str, Any] = {'serial': <class 'labgrid.driver.serialdriver.SerialDriver'>}
__attrs_post_init__()[source]
get()[source]

Implementations should return the status of the digital output.

set(value)[source]

Implementations should set the status of the digital output

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='signal', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='invert', default=NOTHING, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, signal, invert) None

Method generated by attrs for class SerialPortDigitalOutputDriver.

__module__ = 'labgrid.driver.serialdigitaloutput'
__repr__()

Method generated by attrs for class SerialPortDigitalOutputDriver.

labgrid.driver.serialdriver module

class labgrid.driver.serialdriver.SerialDriver(target, name, txdelay=0.0, timeout=3.0)[source]

Bases: labgrid.driver.consoleexpectmixin.ConsoleExpectMixin, labgrid.driver.common.Driver, labgrid.protocol.consoleprotocol.ConsoleProtocol

Driver implementing the ConsoleProtocol interface over a SerialPort connection

bindings: Dict[str, Any] = {'port': {'NetworkSerialPort', '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'
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

get_export_vars()[source]

Get a dictionary of variables to be exported.

open()[source]

Opens the serialport, does nothing if it is already closed

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='txdelay', default=0.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='timeout', default=3.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, txdelay=0.0, timeout=3.0) None

Method generated by attrs for class SerialDriver.

__module__ = 'labgrid.driver.serialdriver'
__repr__()

Method generated by attrs for class SerialDriver.

close()[source]

Closes the serialport, does nothing if it is already closed

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, post_login_settle_time=0)[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.

On activation, the ShellDriver will look for the login prompt on the console, and login to provide shell access.

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

  • console_ready (regex) – optional, pattern used by the kernel to inform the user that a console can be activated by pressing enter.

  • await_login_timeout (int) – optional, time in seconds of silence that needs to pass before sending a newline to device.

  • post_login_settle_time (int) – optional, seconds of silence after logging in before check for a prompt. Useful when the console is interleaved with boot output which may interrupt prompt detection.

bindings: Dict[str, Any] = {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

run(cmd, timeout=30.0, codec='utf-8', decodeerrors='strict')[source]

Run a command

get_status()[source]

Returns the status of the shell-driver. 0 means not connected/found, 1 means shell

put_ssh_key(keyfile_path)[source]
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

ExecutionError – if something 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 found

  • ExecutionError – 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

ExecutionError – 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 not be written

  • ExecutionError – 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

ExecutionError – if something 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 wrong

  • IOError – if the provided localfile could not be found

get_default_interface_device_name(version=4)[source]

Retrieve the default route’s interface device name.

Parameters

version (int) – IP version

Returns

Name of the device of the default route

Raises

ExecutionError – if no or multiple routes are set up

get_ip_addresses(device=None)[source]

Retrieves IP addresses for given interface name.

Note that although the return type is named IPv4Interface/IPv6Interface, it contains an IP address with the corresponding network prefix.

Parameters

device (str) – Name of the interface to query, defaults to default route’s device name.

Returns

List of IPv4Interface or IPv6Interface objects

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='login_prompt', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='username', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='login_timeout', default=60, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='console_ready', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='await_login_timeout', default=2, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='post_login_settle_time', default=0, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, prompt, login_prompt, username, password='', keyfile='', login_timeout=60, console_ready='', await_login_timeout=2, post_login_settle_time=0) None

Method generated by attrs for class ShellDriver.

__module__ = 'labgrid.driver.shelldriver'
__repr__()

Method generated by attrs for class ShellDriver.

labgrid.driver.sigrokdriver module

class labgrid.driver.sigrokdriver.SigrokCommon(target, name)[source]

Bases: labgrid.driver.common.Driver

__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class SigrokCommon.

__module__ = 'labgrid.driver.sigrokdriver'
__repr__()

Method generated by attrs for class SigrokCommon.

class labgrid.driver.sigrokdriver.SigrokDriver(target, name)[source]

Bases: labgrid.driver.sigrokdriver.SigrokCommon

The SigrokDriver uses sigrok-cli to record samples and expose them as python dictionaries.

Parameters

bindings (dict) – driver to use with sigrok

bindings: Dict[str, Any] = {'sigrok': {<class 'labgrid.resource.udev.SigrokUSBDevice'>, <class 'labgrid.resource.sigrok.SigrokDevice'>, <class 'labgrid.resource.remote.NetworkSigrokUSBDevice'>}}
capture(filename, samplerate='200k')[source]
stop()[source]
analyze(args, filename=None)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class SigrokDriver.

__module__ = 'labgrid.driver.sigrokdriver'
__repr__()

Method generated by attrs for class SigrokDriver.

class labgrid.driver.sigrokdriver.SigrokPowerDriver(target, name, delay=3.0, max_voltage=None, max_current=None)[source]

Bases: labgrid.driver.sigrokdriver.SigrokCommon, labgrid.driver.powerdriver.PowerResetMixin, labgrid.protocol.powerprotocol.PowerProtocol

The SigrokPowerDriverDriver uses sigrok-cli to control a PSU and collect measurements.

Parameters

bindings (dict) – driver to use with sigrok

bindings: Dict[str, Any] = {'sigrok': {<class 'labgrid.resource.remote.NetworkSigrokUSBSerialDevice'>, <class 'labgrid.resource.udev.SigrokUSBSerialDevice'>}}
on()[source]
off()[source]
cycle()[source]
set_voltage_target(value)[source]
set_current_limit(value)[source]
get()[source]
measure()[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='delay', default=3.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='max_voltage', default=None, validator=<optional validator for <instance_of validator for type <class 'float'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<function optional.<locals>.optional_converter>, kw_only=False, inherited=False, on_setattr=None), Attribute(name='max_current', default=None, validator=<optional validator for <instance_of validator for type <class 'float'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<function optional.<locals>.optional_converter>, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, delay=3.0, max_voltage=None, max_current=None) None

Method generated by attrs for class SigrokPowerDriver.

__module__ = 'labgrid.driver.sigrokdriver'
__repr__()

Method generated by attrs for class SigrokPowerDriver.

labgrid.driver.smallubootdriver module

class labgrid.driver.smallubootdriver.SmallUBootDriver(target, name, prompt='', autoboot='stop autoboot', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', boot_command='run bootcmd', boot_timeout=30, boot_secret='a', login_timeout=60)[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

Parameters
  • boot_secret (str) – optional, secret used to unlock prompt

  • login_timeout (int) – optional, timeout for login prompt detection,

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, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='autoboot', default='stop autoboot', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='init_commands', default=Factory(factory=<class 'tuple'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<class 'tuple'>, kw_only=False, inherited=True, on_setattr=None), Attribute(name='password_prompt', default='enter Password:', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='boot_expression', default='U-Boot 20\\d+', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='boot_command', default='run bootcmd', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='boot_timeout', default=30, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='boot_secret', default='a', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='login_timeout', default=60, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, prompt='', autoboot='stop autoboot', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', boot_command='run bootcmd', boot_timeout=30, boot_secret='a', login_timeout=60) None

Method generated by attrs for class SmallUBootDriver.

__module__ = 'labgrid.driver.smallubootdriver'
__repr__()

Method generated by attrs for class SmallUBootDriver.

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)[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: Dict[str, Any] = {'networkservice': 'NetworkService'}
priorities = {<class 'labgrid.protocol.commandprotocol.CommandProtocol'>: 10, <class 'labgrid.protocol.filetransferprotocol.FileTransferProtocol'>: 10}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

run(cmd, codec='utf-8', decodeerrors='strict', timeout=None)[source]

Run a command

interact(cmd=None)[source]
forward_local_port(remoteport, localport=None)[source]

Forward a local port to a remote port on the target

A context manager that keeps a local port forwarded to a remote port as long as the context remains valid. A connection can be made to the returned port on localhost and it will be forwarded to the remote port on the target device

usage:
with ssh.forward_local_port(8080) as localport:

# Use localhost:localport here to connect to port 8080 on the # target

returns: localport

forward_remote_port(remoteport, localport)[source]

Forward a remote port on the target to a local port

A context manager that keeps a remote port forwarded to a local port as long as the context remains valid. A connection can be made to the remote on the target device will be forwarded to the returned local port on localhost

usage:
with ssh.forward_remote_port(8080, 8081) as localport:

# Connections to port 8080 on the target will be redirected to # localhost:8081

scp(*, src, dst)[source]
rsync(*, src, dst, extra=[])[source]
sshfs(*, path, mountpoint)[source]
get_status()[source]

The SSHDriver is always connected, return 1

put(filename, remotepath='')[source]
get(filename, destination='.')[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='keyfile', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='stderr_merge', default=False, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, keyfile='', stderr_merge=False) None

Method generated by attrs for class SSHDriver.

__module__ = 'labgrid.driver.sshdriver'
__repr__()

Method generated by attrs for class SSHDriver.

labgrid.driver.ubootdriver module

The U-Boot Module contains the UBootDriver

class labgrid.driver.ubootdriver.UBootDriver(target, name, prompt='', autoboot='stop autoboot', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', boot_command='run bootcmd', login_timeout=30, boot_timeout=30)[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) – optional, U-Boot prompt

  • password (str) – optional, password to unlock U-Boot

  • init_commands (tuple) – optional, tuple of commands to run after unlock

  • autoboot (str) – optional, string to search for to interrupt autoboot

  • interrupt (str) – optional, character to interrupt autoboot and go to prompt

  • password_prompt (str) – optional, string to detect the password prompt

  • boot_expression (str) – optional, string to search for on U-Boot start

  • bootstring (str) – optional, string that indicates that the Kernel is booting

  • boot_command (str) – optional boot command to boot target

  • login_timeout (int) – optional, timeout for login prompt detection

  • boot_timeout (int) – optional, timeout for initial Linux Kernel version detection

bindings: Dict[str, Any] = {'console': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'>}
__attrs_post_init__()[source]
on_activate()[source]

Activate the UBootDriver

This function checks for a prompt and awaits it if not already active

on_deactivate()[source]

Deactivate the UBootDriver

Simply sets the internal status to 0

run(cmd, timeout=30)[source]

Runs the specified command on the shell and returns the output.

Parameters
  • cmd (str) – command to run on the shell

  • timeout (int) – optional, how long to wait for completion

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

reset()[source]

Reset the board via a CPU reset

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, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='prompt', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='autoboot', default='stop autoboot', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='password', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='interrupt', default='\n', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='init_commands', default=Factory(factory=<class 'tuple'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<class 'tuple'>, kw_only=False, inherited=False, on_setattr=None), Attribute(name='password_prompt', default='enter Password:', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='boot_expression', default='U-Boot 20\\d+', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='bootstring', default='Linux version \\d', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='boot_command', default='run bootcmd', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='login_timeout', default=30, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='boot_timeout', default=30, validator=<instance_of validator for type <class 'int'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, prompt='', autoboot='stop autoboot', password='', interrupt='\n', init_commands=NOTHING, password_prompt='enter Password:', boot_expression='U-Boot 20\\d+', bootstring='Linux version \\d', boot_command='run bootcmd', login_timeout=30, boot_timeout=30) None

Method generated by attrs for class UBootDriver.

__module__ = 'labgrid.driver.ubootdriver'
__repr__()

Method generated by attrs for class UBootDriver.

labgrid.driver.usbaudiodriver module

class labgrid.driver.usbaudiodriver.USBAudioInputDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

This driver provides access to a USB audio input device using ALSA and gstreamer.

When using this driver in a Python venv, you may need to allow access to the gi (GObject Introspection) module from the system. This can be done by crating a symlink: ln -s /usr/lib/python3/dist-packages/gi $VENV/lib/python*/site-packages/

bindings: Dict[str, Any] = {'res': {'NetworkUSBAudioInput', 'USBAudioInput'}}
__attrs_post_init__()[source]
start_sender()[source]

Return a subprocess which provides audio data in a matroska container on stdout

create_gst_src()[source]

Returns a newly create gstreamer bin with a single audio output pad.

measure_level()[source]

Returns the current peak and rms value (measured with the gst level element)

play()[source]

Plays the captured audio via gstreamer’s autoaudiosink

__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class USBAudioInputDriver.

__module__ = 'labgrid.driver.usbaudiodriver'
__repr__()

Method generated by attrs for class USBAudioInputDriver.

labgrid.driver.usbhidrelay module

class labgrid.driver.usbhidrelay.HIDRelayDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol

bindings: Dict[str, Any] = {'relay': {<class 'labgrid.resource.remote.NetworkHIDRelay'>, 'HIDRelay'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

set(status)[source]

Implementations should set the status of the digital output

get()[source]

Implementations should return the status of the digital output.

__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class HIDRelayDriver.

__module__ = 'labgrid.driver.usbhidrelay'
__repr__()

Method generated by attrs for class HIDRelayDriver.

labgrid.driver.usbloader module

class labgrid.driver.usbloader.MXSUSBDriver(target, name, image=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

bindings: Dict[str, Any] = {'loader': {'MXSUSBLoader', 'NetworkMXSUSBLoader'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

load(filename=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class MXSUSBDriver.

__module__ = 'labgrid.driver.usbloader'
__repr__()

Method generated by attrs for class MXSUSBDriver.

class labgrid.driver.usbloader.IMXUSBDriver(target, name, image=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

bindings: Dict[str, Any] = {'loader': {'IMXUSBLoader', 'MXSUSBLoader', 'NetworkIMXUSBLoader', 'NetworkMXSUSBLoader'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

load(filename=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class IMXUSBDriver.

__module__ = 'labgrid.driver.usbloader'
__repr__()

Method generated by attrs for class IMXUSBDriver.

class labgrid.driver.usbloader.RKUSBDriver(target, name, image=None, usb_loader=None)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

bindings: Dict[str, Any] = {'loader': {'NetworkRKUSBLoader', 'RKUSBLoader'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

load(filename=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='usb_loader', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None, usb_loader=None) None

Method generated by attrs for class RKUSBDriver.

__module__ = 'labgrid.driver.usbloader'
__repr__()

Method generated by attrs for class RKUSBDriver.

class labgrid.driver.usbloader.UUUDriver(target, name, image=None, cmd='spl')[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

bindings: Dict[str, Any] = {'loader': {'IMXUSBLoader', 'MXSUSBLoader', 'NetworkIMXUSBLoader', 'NetworkMXSUSBLoader'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

load(filename=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='cmd', default='spl', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None, cmd='spl') None

Method generated by attrs for class UUUDriver.

__module__ = 'labgrid.driver.usbloader'
__repr__()

Method generated by attrs for class UUUDriver.

class labgrid.driver.usbloader.BDIMXUSBDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.bootstrapprotocol.BootstrapProtocol

This is a Driver for the Boundary Devices imx_usb_loader available from https://github.com/boundarydevices/imx_usb_loader

It supports loading the second stage bootloader to a SDP gadget implemented by the first stage bootloader in SRAM. Accordingly, the image to upload must be specified explicitly.

bindings: Dict[str, Any] = {'loader': {'IMXUSBLoader', 'NetworkIMXUSBLoader'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

load(filename)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class BDIMXUSBDriver.

__module__ = 'labgrid.driver.usbloader'
__repr__()

Method generated by attrs for class BDIMXUSBDriver.

labgrid.driver.usbsdmuxdriver module

class labgrid.driver.usbsdmuxdriver.USBSDMuxDriver(target, name)[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: Dict[str, Any] = {'mux': {'NetworkUSBSDMuxDevice', 'USBSDMuxDevice'}}
__attrs_post_init__()[source]
set_mode(mode)[source]
get_mode()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class USBSDMuxDriver.

__module__ = 'labgrid.driver.usbsdmuxdriver'
__repr__()

Method generated by attrs for class USBSDMuxDriver.

labgrid.driver.usbsdwiredriver module

class labgrid.driver.usbsdwiredriver.USBSDWireDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

The USBSDWireDriver uses the sd-mux-ctrl tool to control SDWire hardware

Parameters

bindings (dict) – driver to use with usbsdmux

bindings: Dict[str, Any] = {'mux': {'NetworkUSBSDWireDevice', 'USBSDWireDevice'}}
__attrs_post_init__()[source]
set_mode(mode)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class USBSDWireDriver.

__module__ = 'labgrid.driver.usbsdwiredriver'
__repr__()

Method generated by attrs for class USBSDWireDriver.

labgrid.driver.usbstoragedriver module

class labgrid.driver.usbstoragedriver.Mode(value)[source]

Bases: enum.Enum

An enumeration.

DD = 'dd'
BMAPTOOL = 'bmaptool'
__module__ = 'labgrid.driver.usbstoragedriver'
class labgrid.driver.usbstoragedriver.USBStorageDriver(target, name, image=None)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'storage': {'NetworkUSBMassStorage', 'NetworkUSBSDMuxDevice', 'NetworkUSBSDWireDevice', 'USBMassStorage', 'USBSDMuxDevice', 'USBSDWireDevice'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

write_image(filename=None, mode=Mode.DD, partition=None, skip=0, seek=0)[source]

Writes the file specified by filename or if not specified by config image subkey to the bound USB storage root device or partition.

Parameters
  • filename (str) – optional, path to the image to write to bound USB storage

  • mode (Mode) – optional, Mode.DD or Mode.BMAPTOOL (defaults to Mode.DD)

  • partition (int or None) – optional, write to the specified partition or None for writing to root device (defaults to None)

  • skip (int) – optional, skip n 512-sized blocks at start of input file (defaults to 0)

  • seek (int) – optional, skip n 512-sized blocks at start of output (defaults to 0)

get_size()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class USBStorageDriver.

__module__ = 'labgrid.driver.usbstoragedriver'
__repr__()

Method generated by attrs for class USBStorageDriver.

class labgrid.driver.usbstoragedriver.NetworkUSBStorageDriver(target, name, image=None)[source]

Bases: labgrid.driver.usbstoragedriver.USBStorageDriver

__attrs_post_init__()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='image', default=None, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name, image=None) None

Method generated by attrs for class NetworkUSBStorageDriver.

__module__ = 'labgrid.driver.usbstoragedriver'
__repr__()

Method generated by attrs for class NetworkUSBStorageDriver.

labgrid.driver.usbtmcdriver module

class labgrid.driver.usbtmcdriver.USBTMCDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

bindings: Dict[str, Any] = {'tmc': {'NetworkUSBTMC', 'USBTMC'}}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

command(cmd)[source]
query(cmd, binary=False, raw=False)[source]
identify()[source]
get_channel_info(channel)[source]
get_channel_values(channel)[source]
get_screenshot()[source]
get_bool(cmd)[source]
get_int(cmd)[source]
get_decimal(cmd)[source]
get_str(cmd)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class USBTMCDriver.

__module__ = 'labgrid.driver.usbtmcdriver'
__repr__()

Method generated by attrs for class USBTMCDriver.

labgrid.driver.usbvideodriver module

class labgrid.driver.usbvideodriver.USBVideoDriver(target, name)[source]

Bases: labgrid.driver.common.Driver, labgrid.protocol.videoprotocol.VideoProtocol

bindings: Dict[str, Any] = {'video': {'NetworkUSBVideo', 'USBVideo'}}
get_qualities()[source]
select_caps(hint=None)[source]
get_pipeline(path, caps, controls=None)[source]
stream(caps_hint=None, controls=None)[source]
__abstractmethods__ = frozenset({})
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class USBVideoDriver.

__module__ = 'labgrid.driver.usbvideodriver'
__repr__()

Method generated by attrs for class USBVideoDriver.

labgrid.driver.xenadriver module

class labgrid.driver.xenadriver.XenaDriver(target, name)[source]

Bases: labgrid.driver.common.Driver

Xena Driver

bindings: Dict[str, Any] = {'xena_manager': 'XenaManager'}
__attrs_post_init__()[source]
on_activate()[source]

Called by the Target when this object has been activated

on_deactivate()[source]

Called by the Target when this object has been deactivated

get_session()[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))
__init__(target, name) None

Method generated by attrs for class XenaDriver.

__module__ = 'labgrid.driver.xenadriver'
__repr__()

Method generated by attrs for class XenaDriver.