labgrid.external package

Submodules

labgrid.external.hawkbit module

class labgrid.external.hawkbit.HawkbitTestClient(host, port, username, password, version=1.0)[source]

Bases: object

host = Attribute(name='host', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
port = Attribute(name='port', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
username = Attribute(name='username', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
password = Attribute(name='password', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
version = Attribute(name='version', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
add_target(device_address: str, token: str)[source]

Add a target to the HawkBit Installation

Parameters:
  • device_address (-) – the device address of the added target
  • token (-) – token to uniquely identify the target
add_swmodule()[source]
add_distributionset()[source]
add_artifact(filename: str)[source]
assign_target()[source]
post_json(endpoint: str, data: dict)[source]
post_binary(endpoint: str, filename: str)[source]
get_endpoint(endpoint: str)[source]
exception labgrid.external.hawkbit.HawkbiError(msg)[source]

Bases: Exception

msg = Attribute(name='msg', default=NOTHING, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))

labgrid.external.usbstick module

The USBStick module provides support to interactively use a simulated USB device in a test.

class labgrid.external.usbstick.USBStatus[source]

Bases: enum.Enum

This class describes the USBStick Status

unplugged = 0
plugged = 1
mounted = 2
class labgrid.external.usbstick.USBStick(target, image_dir, image_name='')[source]

Bases: object

The USBStick class provides an easy to use interface to describe a target as an USB Stick.

target = Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
image_dir = Attribute(name='image_dir', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
image_name = Attribute(name='image_name', default='', validator=<instance_of validator for type <class 'str'>>, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))
plug_in()[source]

Insert the USBStick

This function plugs the virtual USB Stick in, making it available to the connected computer.

plug_out()[source]

Plugs out the USBStick

Plugs out the USBStick from the connected computer, does nothing if it is already unplugged

put_file(filename, destination='')[source]

Put a file onto the USBStick Image

Puts a file onto the USB Stick, raises a StateError if it is not mounted on the host computer.

get_file(filename)[source]

Gets a file from the USBStick Image

Gets a file from the USB Stick, raises a StateError if it is not mounted on the host computer.

upload_image(image)[source]

Upload a complete image as a new USB Stick

This replaces the current USB Stick image, storing it permanently on the RiotBoard.

switch_image(image_name)[source]

Switch between already uploaded images on the target.

exception labgrid.external.usbstick.StateError(msg)[source]

Bases: Exception

Exception which indicates a error in the state handling of the test

msg = Attribute(name='msg', default=NOTHING, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None, metadata=mappingproxy({}))