labgrid package¶
Subpackages¶
- labgrid.driver package
- Subpackages
- Submodules
- labgrid.driver.bareboxdriver module
- labgrid.driver.commandmixin module
- labgrid.driver.common module
- labgrid.driver.consoleexpectmixin module
- labgrid.driver.exception module
- labgrid.driver.externalconsoledriver module
- labgrid.driver.fake module
- labgrid.driver.fastbootdriver module
- labgrid.driver.infodriver module
- labgrid.driver.onewiredriver module
- labgrid.driver.openocddriver module
- labgrid.driver.powerdriver module
- labgrid.driver.serialdriver module
- labgrid.driver.shelldriver module
- labgrid.driver.sshdriver module
- labgrid.driver.ubootdriver module
- labgrid.driver.usbloader module
- labgrid.driver.usbstorage module
- labgrid.external package
- labgrid.protocol package
- Submodules
- labgrid.protocol.bootstrapprotocol module
- labgrid.protocol.commandprotocol module
- labgrid.protocol.consoleprotocol module
- labgrid.protocol.digitaloutputprotocol module
- labgrid.protocol.filesystemprotocol module
- labgrid.protocol.filetransferprotocol module
- labgrid.protocol.infoprotocol module
- labgrid.protocol.linuxbootprotocol module
- labgrid.protocol.mmioprotocol module
- labgrid.protocol.powerprotocol module
- labgrid.provider package
- labgrid.pytestplugin package
- labgrid.remote package
- labgrid.resource package
- labgrid.strategy package
- labgrid.util package
Submodules¶
labgrid.binding module¶
-
exception
labgrid.binding.
StateError
(msg)[source]¶ Bases:
Exception
-
msg
= Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
exception
labgrid.binding.
BindingError
(msg)[source]¶ Bases:
Exception
-
msg
= Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
class
labgrid.binding.
BindingState
[source]¶ Bases:
enum.Enum
An enumeration.
-
error
= -1¶
-
idle
= 0¶
-
bound
= 1¶
-
active
= 2¶
-
-
class
labgrid.binding.
BindingMixin
(target)[source]¶ Bases:
object
Handles the binding and activation of drivers and their supplying resources and drivers.
One client can be bound to many suppliers, and one supplier can be bound by many clients.
Conflicting access to one supplier can be avoided by deactivating conflicting clients before activation (using the resolve_conflicts callback).
-
bindings
= {}¶
-
target
= Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
state
= Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=True, init=False, convert=None, metadata=mappingproxy({}))¶
-
labgrid.config module¶
Config convenience class
This class encapsulates access functions to the environment configuration
-
class
labgrid.config.
Config
(filename)[source]¶ Bases:
object
-
filename
= Attribute(name='filename', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
resolve_path
(path)[source]¶ Resolve an absolute path
Parameters: path (str) – path to resolve Returns: the absolute path Return type: str
-
get_tool
(tool)[source]¶ Retrieve an entry from the tools subkey
Parameters: tool (str) – the tool to retrieve the path for Returns: path to the requested tools Return type: str
-
get_image_path
(kind)[source]¶ Retrieve an entry from the images subkey
Parameters: kind (str) – the kind of the image to retrieve the path for Returns: path to the image Return type: str Raises: KeyError
– if the requested image can not be found in the configuration
-
get_option
(name, default=None)[source]¶ Retrieve an entry from the options subkey
Parameters: - name (str) – name of the option
- default (str) – A default parameter in case the option can not be found
Returns: value of the option or default parameter
Return type: str
Raises: KeyError
– if the requested image can not be found in the configuration
-
labgrid.environment module¶
-
class
labgrid.environment.
Environment
(config_file='config.yaml', interact=<built-in function input>)[source]¶ Bases:
object
An environment encapsulates targets.
-
config_file
= Attribute(name='config_file', default='config.yaml', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
interact
= Attribute(name='interact', default=<built-in function input>, validator=None, repr=False, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
labgrid.exceptions module¶
-
exception
labgrid.exceptions.
NoConfigFoundError
(msg)[source]¶ Bases:
Exception
-
msg
= Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
-
exception
labgrid.exceptions.
NoSupplierFoundError
(msg)[source]¶ Bases:
Exception
-
msg
= Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
labgrid.factory module¶
-
class
labgrid.factory.
TargetFactory
[source]¶ Bases:
object
-
reg_resource
(cls)[source]¶ Register a resource with the factory.
Returns the class to allow using it as a decorator.
-
-
labgrid.factory.
target_factory
= <labgrid.factory.TargetFactory object>¶ Global TargetFactory instance
This instance is used to register Resource and Driver classes so that Targets can be created automatically from YAML files.
labgrid.step module¶
-
class
labgrid.step.
StepEvent
(step, data, *, resource=None, stream=False)[source]¶ Bases:
object
-
age
¶
-
labgrid.stepreporter module¶
labgrid.target module¶
-
class
labgrid.target.
Target
(name, env=None)[source]¶ Bases:
object
-
activate
(client)[source]¶ Activate the client by activating all bound suppliers. This may require deactivating other clients.
-
await_resources
(resources, timeout=None)[source]¶ Poll the given resources and wait until they are available.
-
bind_driver
(client)[source]¶ Bind the driver to all suppliers (resources and other drivers).
Currently, we only support binding all suppliers at once.
-
deactivate
(client)[source]¶ Recursively deactivate the client’s clients and itself.
This is needed to ensure that no client has an inactive supplier.
-
env
= Attribute(name='env', default=None, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-
get_active_driver
(cls)[source]¶ Helper function to get the active driver of the target. Returns the active driver found, otherwise None.
Arguments: cls – driver-class to return as a resource
-
get_driver
(cls, *, activate=True)[source]¶ Helper function to get a driver of the target. Returns the first valid driver found, otherwise None.
Arguments: cls – driver-class to return as a resource activate – activate the driver (default True)
-
get_resource
(cls, *, await=True)[source]¶ Helper function to get a resource of the target. Returns the first valid resource found, otherwise None.
Arguments: cls – resource-class to return as a resource await – wait for the resource to become available (default True)
-
name
= Attribute(name='name', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))¶
-