labgrid.protocol package

Submodules

labgrid.protocol.bootstrapprotocol module

class labgrid.protocol.bootstrapprotocol.BootstrapProtocol[source]

Bases: abc.ABC

abstract load(filename: str)[source]
__abstractmethods__ = frozenset({'load'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.bootstrapprotocol', 'load': <function BootstrapProtocol.load>, '__dict__': <attribute '__dict__' of 'BootstrapProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'BootstrapProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'load'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.bootstrapprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.commandprotocol module

class labgrid.protocol.commandprotocol.CommandProtocol[source]

Bases: abc.ABC

Abstract class for the CommandProtocol

abstract run(command: str)[source]

Run a command

abstract run_check(command: str)[source]

Run a command, return str if succesful, ExecutionError otherwise

abstract get_status()[source]

Get status of the Driver

abstract wait_for()[source]

Wait for a shell command to return with the specified output

abstract poll_until_success()[source]

Repeatedly call a shell command until it succeeds

__abstractmethods__ = frozenset({'get_status', 'poll_until_success', 'run', 'run_check', 'wait_for'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.commandprotocol', '__doc__': 'Abstract class for the CommandProtocol', 'run': <function CommandProtocol.run>, 'run_check': <function CommandProtocol.run_check>, 'get_status': <function CommandProtocol.get_status>, 'wait_for': <function CommandProtocol.wait_for>, 'poll_until_success': <function CommandProtocol.poll_until_success>, '__dict__': <attribute '__dict__' of 'CommandProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'CommandProtocol' objects>, '__abstractmethods__': frozenset({'run_check', 'get_status', 'run', 'poll_until_success', 'wait_for'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.commandprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.consoleprotocol module

class labgrid.protocol.consoleprotocol.ConsoleProtocol[source]

Bases: abc.ABC

Abstract class for the ConsoleProtocol

abstract read()[source]

Read data from underlying port

abstract write(data: bytes)[source]

Write data to underlying port

sendline(line: str)[source]
sendcontrol(char: str)[source]
expect(pattern: str)[source]
class Client[source]

Bases: abc.ABC

abstract get_console_matches()[source]
abstract notify_console_match(pattern, match)[source]
__abstractmethods__ = frozenset({'get_console_matches', 'notify_console_match'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.consoleprotocol', 'get_console_matches': <function ConsoleProtocol.Client.get_console_matches>, 'notify_console_match': <function ConsoleProtocol.Client.notify_console_match>, '__dict__': <attribute '__dict__' of 'Client' objects>, '__weakref__': <attribute '__weakref__' of 'Client' objects>, '__doc__': None, '__abstractmethods__': frozenset({'notify_console_match', 'get_console_matches'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.consoleprotocol'
__weakref__

list of weak references to the object (if defined)

__abstractmethods__ = frozenset({'read', 'write'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.consoleprotocol', '__doc__': 'Abstract class for the ConsoleProtocol', 'read': <function ConsoleProtocol.read>, 'write': <function ConsoleProtocol.write>, 'sendline': <function ConsoleProtocol.sendline>, 'sendcontrol': <function ConsoleProtocol.sendcontrol>, 'expect': <function ConsoleProtocol.expect>, 'Client': <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol.Client'>, '__dict__': <attribute '__dict__' of 'ConsoleProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'ConsoleProtocol' objects>, '__abstractmethods__': frozenset({'write', 'read'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.consoleprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.digitaloutputprotocol module

class labgrid.protocol.digitaloutputprotocol.DigitalOutputProtocol[source]

Bases: abc.ABC

Abstract class providing the OneWireProtocol interface

abstract get()[source]

Implementations should return the status of the OneWirePort.

abstract set(status)[source]

Implementations should set the status of the OneWirePort

__abstractmethods__ = frozenset({'get', 'set'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.digitaloutputprotocol', '__doc__': 'Abstract class providing the OneWireProtocol interface', 'get': <function DigitalOutputProtocol.get>, 'set': <function DigitalOutputProtocol.set>, '__dict__': <attribute '__dict__' of 'DigitalOutputProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'DigitalOutputProtocol' objects>, '__abstractmethods__': frozenset({'get', 'set'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.digitaloutputprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.filesystemprotocol module

class labgrid.protocol.filesystemprotocol.FileSystemProtocol[source]

Bases: abc.ABC

abstract read(filename: str)[source]
abstract write(filename: str, data: bytes, append: bool)[source]
__abstractmethods__ = frozenset({'read', 'write'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.filesystemprotocol', 'read': <function FileSystemProtocol.read>, 'write': <function FileSystemProtocol.write>, '__dict__': <attribute '__dict__' of 'FileSystemProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'FileSystemProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'write', 'read'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.filesystemprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.filetransferprotocol module

class labgrid.protocol.filetransferprotocol.FileTransferProtocol[source]

Bases: abc.ABC

abstract put(filename: str, remotepath: str)[source]
abstract get(filename: str, destination: str)[source]
__abstractmethods__ = frozenset({'get', 'put'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.filetransferprotocol', 'put': <function FileTransferProtocol.put>, 'get': <function FileTransferProtocol.get>, '__dict__': <attribute '__dict__' of 'FileTransferProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'FileTransferProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'get', 'put'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.filetransferprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.infoprotocol module

class labgrid.protocol.infoprotocol.InfoProtocol[source]

Bases: abc.ABC

Abstract class providing the InfoProtocol interface

abstract get_ip(interface: str = 'eth0')[source]

Implementations should return the IP-adress for the supplied interface.

abstract get_hostname()[source]

Implementations should return the hostname for the supplied interface.

abstract get_service_status(service)[source]

Implementations should return the status of a service

__abstractmethods__ = frozenset({'get_hostname', 'get_ip', 'get_service_status'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.infoprotocol', '__doc__': 'Abstract class providing the InfoProtocol interface', 'get_ip': <function InfoProtocol.get_ip>, 'get_hostname': <function InfoProtocol.get_hostname>, 'get_service_status': <function InfoProtocol.get_service_status>, '__dict__': <attribute '__dict__' of 'InfoProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'InfoProtocol' objects>, '__abstractmethods__': frozenset({'get_ip', 'get_service_status', 'get_hostname'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.infoprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.linuxbootprotocol module

class labgrid.protocol.linuxbootprotocol.LinuxBootProtocol[source]

Bases: abc.ABC

abstract boot(name: str)[source]
abstract await_boot()[source]
abstract reset()[source]
__abstractmethods__ = frozenset({'await_boot', 'boot', 'reset'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.linuxbootprotocol', 'boot': <function LinuxBootProtocol.boot>, 'await_boot': <function LinuxBootProtocol.await_boot>, 'reset': <function LinuxBootProtocol.reset>, '__dict__': <attribute '__dict__' of 'LinuxBootProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'LinuxBootProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'reset', 'await_boot', 'boot'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.linuxbootprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.mmioprotocol module

class labgrid.protocol.mmioprotocol.MMIOProtocol[source]

Bases: abc.ABC

abstract read(address: int, size: int, count: int) → bytes[source]
abstract write(address: int, size: int, data: bytes) → None[source]
__abstractmethods__ = frozenset({'read', 'write'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.mmioprotocol', 'read': <function MMIOProtocol.read>, 'write': <function MMIOProtocol.write>, '__dict__': <attribute '__dict__' of 'MMIOProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'MMIOProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'write', 'read'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.mmioprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.powerprotocol module

class labgrid.protocol.powerprotocol.PowerProtocol[source]

Bases: abc.ABC

abstract on()[source]
abstract off()[source]
abstract cycle()[source]
__abstractmethods__ = frozenset({'cycle', 'off', 'on'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.powerprotocol', 'on': <function PowerProtocol.on>, 'off': <function PowerProtocol.off>, 'cycle': <function PowerProtocol.cycle>, '__dict__': <attribute '__dict__' of 'PowerProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'PowerProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'cycle', 'off', 'on'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.powerprotocol'
__weakref__

list of weak references to the object (if defined)

labgrid.protocol.resetprotocol module

class labgrid.protocol.resetprotocol.ResetProtocol[source]

Bases: abc.ABC

abstract reset()[source]
__abstractmethods__ = frozenset({'reset'})
__dict__ = mappingproxy({'__module__': 'labgrid.protocol.resetprotocol', 'reset': <function ResetProtocol.reset>, '__dict__': <attribute '__dict__' of 'ResetProtocol' objects>, '__weakref__': <attribute '__weakref__' of 'ResetProtocol' objects>, '__doc__': None, '__abstractmethods__': frozenset({'reset'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.resetprotocol'
__weakref__

list of weak references to the object (if defined)