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_post_init__()[source]
transition(status, *, step)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, cmp=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, cmp=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?

__attrs_post_init__()[source]
on_client_bound(client)[source]

Called by the Target after a new client has been bound

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

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, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))
__init__(target, name) → None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'labgrid.strategy.common'
__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

__attrs_post_init__()[source]
invalidate()[source]
transition(state, via=None)[source]
find_abs_path(state, via=None)[source]
find_rel_path(path)[source]
property graph
classmethod depends(*dependencies)[source]
__module__ = 'labgrid.strategy.graphstrategy'

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_post_init__()[source]
transition(status, *, step)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, cmp=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_post_init__()[source]
transition(status)[source]
__attrs_attrs__ = (Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, cmp=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False), Attribute(name='status', default=<Status.unknown: 0>, validator=None, repr=True, cmp=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.