labgrid.protocol package

Submodules

labgrid.protocol.bootstrapprotocol module

class labgrid.protocol.bootstrapprotocol.BootstrapProtocol[source]

Bases: abc.ABC

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

run(command: str)[source]

Run a command

run_check(command: str)[source]

Run a command, return str if succesful, ExecutionError otherwise

get_status()[source]

Get status of the Driver

wait_for()[source]

Wait for a shell command to return with the specified output

poll_until_success()[source]

Repeatedly call a shell command until it succeeds

__abstractmethods__ = frozenset({'run', 'run_check', 'poll_until_success', 'wait_for', 'get_status'})
__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', 'run_check', 'poll_until_success', 'wait_for', 'get_status'}), '_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

read()[source]

Read data from underlying port

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

get_console_matches()[source]
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({'get_console_matches', 'notify_console_match'}), '_abc_impl': <_abc_data object>})
__module__ = 'labgrid.protocol.consoleprotocol'
__weakref__

list of weak references to the object (if defined)

__abstractmethods__ = frozenset({'write', 'read'})
__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

get()[source]

Implementations should return the status of the OneWirePort.

set(status)[source]

Implementations should set the status of the OneWirePort

__abstractmethods__ = frozenset({'set', 'get'})
__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({'set', 'get'}), '_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

read(filename: str)[source]
write(filename: str, data: bytes, append: bool)[source]
__abstractmethods__ = frozenset({'write', 'read'})
__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

put(filename: str, remotepath: str)[source]
get(filename: str, destination: str)[source]
__abstractmethods__ = frozenset({'put', 'get'})
__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({'put', 'get'}), '_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

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

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

get_hostname()[source]

Implementations should return the hostname for the supplied interface.

get_service_status(service)[source]

Implementations should return the status of a service

__abstractmethods__ = frozenset({'get_ip', 'get_hostname', '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_hostname', 'get_service_status'}), '_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

boot(name: str)[source]
await_boot()[source]
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({'await_boot', 'boot', 'reset'}), '_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

read(address: int, size: int, count: int) → bytes[source]
write(address: int, size: int, data: bytes) → None[source]
__abstractmethods__ = frozenset({'write', 'read'})
__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

on()[source]
off()[source]
cycle()[source]
__abstractmethods__ = frozenset({'off', 'cycle', '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({'off', 'cycle', '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

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)