labgrid.protocol package

Submodules

labgrid.protocol.bootstrapprotocol module

class labgrid.protocol.bootstrapprotocol.BootstrapProtocol[source]

Bases: abc.ABC

load(filename: str)[source]
__abstractmethods__ = frozenset({'load'})
__module__ = 'labgrid.protocol.bootstrapprotocol'

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

__abstractmethods__ = frozenset({'get_status', 'run', 'wait_for', 'run_check'})
__module__ = 'labgrid.protocol.commandprotocol'

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'})
__module__ = 'labgrid.protocol.consoleprotocol'
__abstractmethods__ = frozenset({'read', 'write'})
__module__ = 'labgrid.protocol.consoleprotocol'

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'})
__module__ = 'labgrid.protocol.digitaloutputprotocol'

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({'read', 'write'})
__module__ = 'labgrid.protocol.filesystemprotocol'

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'})
__module__ = 'labgrid.protocol.filetransferprotocol'

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_service_status', 'get_hostname', 'get_ip'})
__module__ = 'labgrid.protocol.infoprotocol'

labgrid.protocol.linuxbootprotocol module

class labgrid.protocol.linuxbootprotocol.LinuxBootProtocol[source]

Bases: abc.ABC

boot(name: str)[source]
await_boot()[source]
reset()[source]
__abstractmethods__ = frozenset({'boot', 'reset', 'await_boot'})
__module__ = 'labgrid.protocol.linuxbootprotocol'

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({'read', 'write'})
__module__ = 'labgrid.protocol.mmioprotocol'

labgrid.protocol.powerprotocol module

class labgrid.protocol.powerprotocol.PowerProtocol[source]

Bases: abc.ABC

on()[source]
off()[source]
cycle()[source]
__abstractmethods__ = frozenset({'cycle', 'off', 'on'})
__module__ = 'labgrid.protocol.powerprotocol'

labgrid.protocol.resetprotocol module

class labgrid.protocol.resetprotocol.ResetProtocol[source]

Bases: abc.ABC

reset()[source]
__abstractmethods__ = frozenset({'reset'})
__module__ = 'labgrid.protocol.resetprotocol'