labgrid.strategy package¶
Submodules¶
labgrid.strategy.bareboxstrategy module¶
-
class
labgrid.strategy.bareboxstrategy.
Status
[source]¶ Bases:
enum.Enum
An enumeration.
-
unknown
= 0¶
-
off
= 1¶
-
barebox
= 2¶
-
shell
= 3¶
-
__module__
= 'labgrid.strategy.bareboxstrategy'¶
-
-
class
labgrid.strategy.bareboxstrategy.
BareboxStrategy
(target, name, status=<Status.unknown: 0>)[source]¶ Bases:
labgrid.strategy.common.Strategy
BareboxStrategy - Strategy to switch to barebox or shell
-
bindings
= {'barebox': <class 'labgrid.driver.bareboxdriver.BareboxDriver'>, 'power': <class 'labgrid.protocol.powerprotocol.PowerProtocol'>, 'shell': <class 'labgrid.driver.shelldriver.ShellDriver'>}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, status=<Status.unknown: 0>) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.bareboxstrategy'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.strategy.common module¶
-
exception
labgrid.strategy.common.
StrategyError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False),)¶
-
__init__
(msg) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.common'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
labgrid.strategy.common.
Strategy
(target, name)[source]¶ Bases:
labgrid.driver.common.Driver
Represents a strategy which places a target into a requested state by calling specific drivers. A strategy usually needs to know some details of a given target.
Life cycle: - create - bind (n times) - usage
TODO: This might also be just a driver?
-
resolve_conflicts
(client)[source]¶ Called by the Target to allow this object to deactivate conflicting clients.
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.common'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.strategy.dockerstrategy module¶
-
class
labgrid.strategy.dockerstrategy.
Status
[source]¶ Bases:
enum.Enum
The possible states of a docker container
-
unknown
= 0¶
-
gone
= 1¶
-
accessible
= 2¶
-
__module__
= 'labgrid.strategy.dockerstrategy'¶
-
-
class
labgrid.strategy.dockerstrategy.
DockerStrategy
(target, name, status=<Status.unknown: 0>)[source]¶ Bases:
labgrid.strategy.common.Strategy
DockerStrategy enables the user to directly transition to a state where a fresh docker container has been created and is ready for access (e.g. shell access via SSH if the docker image runs an SSH daemon).
-
bindings
= {'docker_driver': <class 'labgrid.driver.dockerdriver.DockerDriver'>}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, status=<Status.unknown: 0>) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.dockerstrategy'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.strategy.graphstrategy module¶
-
exception
labgrid.strategy.graphstrategy.
GraphStrategyError
(msg)[source]¶ Bases:
labgrid.strategy.common.StrategyError
-
__module__
= 'labgrid.strategy.graphstrategy'¶
-
-
exception
labgrid.strategy.graphstrategy.
InvalidGraphStrategyError
(msg)[source]¶ Bases:
labgrid.strategy.graphstrategy.GraphStrategyError
-
__module__
= 'labgrid.strategy.graphstrategy'¶
-
-
exception
labgrid.strategy.graphstrategy.
GraphStrategyRuntimeError
(msg)[source]¶ Bases:
labgrid.strategy.graphstrategy.GraphStrategyError
-
__module__
= 'labgrid.strategy.graphstrategy'¶
-
-
class
labgrid.strategy.graphstrategy.
GraphStrategy
(target, name)[source]¶ Bases:
labgrid.strategy.common.Strategy
-
property
graph
¶
-
__module__
= 'labgrid.strategy.graphstrategy'¶
-
property
labgrid.strategy.shellstrategy module¶
-
class
labgrid.strategy.shellstrategy.
Status
[source]¶ Bases:
enum.Enum
An enumeration.
-
unknown
= 0¶
-
off
= 1¶
-
shell
= 2¶
-
__module__
= 'labgrid.strategy.shellstrategy'¶
-
-
class
labgrid.strategy.shellstrategy.
ShellStrategy
(target, name, status=<Status.unknown: 0>)[source]¶ Bases:
labgrid.strategy.common.Strategy
ShellStrategy - Strategy to switch to shell
-
bindings
= {'power': <class 'labgrid.protocol.powerprotocol.PowerProtocol'>, 'shell': <class 'labgrid.driver.shelldriver.ShellDriver'>}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, status=<Status.unknown: 0>) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.shellstrategy'¶
-
__repr__
()¶ Automatically created by attrs.
-
labgrid.strategy.ubootstrategy module¶
-
class
labgrid.strategy.ubootstrategy.
Status
[source]¶ Bases:
enum.Enum
An enumeration.
-
unknown
= 0¶
-
off
= 1¶
-
uboot
= 2¶
-
shell
= 3¶
-
__module__
= 'labgrid.strategy.ubootstrategy'¶
-
-
class
labgrid.strategy.ubootstrategy.
UBootStrategy
(target, name, status=<Status.unknown: 0>)[source]¶ Bases:
labgrid.strategy.common.Strategy
UbootStrategy - Strategy to switch to uboot or shell
-
bindings
= {'power': <class 'labgrid.protocol.powerprotocol.PowerProtocol'>, 'shell': <class 'labgrid.driver.shelldriver.ShellDriver'>, 'uboot': <class 'labgrid.driver.ubootdriver.UBootDriver'>}¶
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__init__
(target, name, status=<Status.unknown: 0>) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'labgrid.strategy.ubootstrategy'¶
-
__repr__
()¶ Automatically created by attrs.
-