labgrid.external package¶
Submodules¶
labgrid.external.hawkbit module¶
-
class
labgrid.external.hawkbit.
HawkbitTestClient
(host, port, username, password, version=1.0) → None[source]¶ Bases:
object
-
add_target
(target_id: str, token: str)[source]¶ Add a target to the HawkBit Installation
Parameters: - target_id (-) – the (unique) device name of the target to add
- token (-) – pre-shared key to authenticate the target
-
delete_target
(target_id: str)[source]¶ Delete a target from the HawkBit Installation
Parameters: target_id (-) – the (unique) device name of the target to delete
-
delete_swmodule
(module_id: str)[source]¶ Delete a softwaremodule from the HawkBit Installation
Parameters: module_id (-) – the ID given by hawkBit for the module
-
delete_distributionset
(distset_id: str)[source]¶ Delete a distrubitionset from the HawkBit Installation
Parameters: distset_id (-) – the ID of the distribution set to delete
-
delete_artifact
(module_id: str, artifact_id: str)[source]¶ Delete an artifact from the HawkBit Installation
Parameters: artifact_id (-) – the ID of the artifact to delete
-
__attrs_attrs__
= (Attribute(name='host', 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), Attribute(name='port', 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), Attribute(name='username', 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), Attribute(name='password', 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), Attribute(name='version', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False))¶
-
__dict__
= mappingproxy({'add_distributionset': <function HawkbitTestClient.add_distributionset>, 'get_endpoint': <function HawkbitTestClient.get_endpoint>, '__init__': <function HawkbitTestClient.__init__>, '__doc__': None, 'post_json': <function HawkbitTestClient.post_json>, 'add_rollout': <function HawkbitTestClient.add_rollout>, 'post': <function HawkbitTestClient.post>, 'delete_artifact': <function HawkbitTestClient.delete_artifact>, 'start_rollout': <function HawkbitTestClient.start_rollout>, '__attrs_post_init__': <function HawkbitTestClient.__attrs_post_init__>, 'add_swmodule': <function HawkbitTestClient.add_swmodule>, '__weakref__': <attribute '__weakref__' of 'HawkbitTestClient' objects>, '__attrs_attrs__': (Attribute(name='host', 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), Attribute(name='port', 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), Attribute(name='username', 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), Attribute(name='password', 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), Attribute(name='version', default=1.0, validator=<instance_of validator for type <class 'float'>>, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False)), 'delete': <function HawkbitTestClient.delete>, 'assign_target': <function HawkbitTestClient.assign_target>, 'add_target': <function HawkbitTestClient.add_target>, 'delete_swmodule': <function HawkbitTestClient.delete_swmodule>, 'delete_target': <function HawkbitTestClient.delete_target>, '__module__': 'labgrid.external.hawkbit', 'add_artifact': <function HawkbitTestClient.add_artifact>, '__repr__': <function HawkbitTestClient.__repr__>, 'post_binary': <function HawkbitTestClient.post_binary>, '__dict__': <attribute '__dict__' of 'HawkbitTestClient' objects>, 'delete_distributionset': <function HawkbitTestClient.delete_distributionset>})¶
-
__init__
(host, port, username, password, version=1.0) → None¶
-
__module__
= 'labgrid.external.hawkbit'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.external.hawkbit.
HawkbitError
(msg) → None[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False),)¶
-
__init__
(msg) → None¶
-
__module__
= 'labgrid.external.hawkbit'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
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¶
-
__module__
= 'labgrid.external.usbstick'¶
-
__new__
(value)¶
-
-
class
labgrid.external.usbstick.
USBStick
(target, image_dir, image_name='') → None[source]¶ Bases:
object
The USBStick class provides an easy to use interface to describe a target as an USB Stick.
-
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.
-
__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='image_dir', 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), Attribute(name='image_name', default='', 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))¶
-
__dict__
= mappingproxy({'put_file': <function USBStick.put_file>, '__init__': <function USBStick.__init__>, '__dict__': <attribute '__dict__' of 'USBStick' objects>, '__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='image_dir', 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), Attribute(name='image_name', default='', 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)), '__doc__': 'The USBStick class provides an easy to use interface to describe a\n target as an USB Stick.', '__repr__': <function USBStick.__repr__>, '__module__': 'labgrid.external.usbstick', 'upload_image': <function USBStick.upload_image>, '__weakref__': <attribute '__weakref__' of 'USBStick' objects>, 'get_file': <function USBStick.get_file>, '__attrs_post_init__': <function USBStick.__attrs_post_init__>, 'plug_out': <function USBStick.plug_out>, 'switch_image': <function USBStick.switch_image>, 'plug_in': <function USBStick.plug_in>})¶
-
__init__
(target, image_dir, image_name='') → None¶
-
__module__
= 'labgrid.external.usbstick'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.external.usbstick.
StateError
(msg) → None[source]¶ Bases:
Exception
Exception which indicates a error in the state handling of the test
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False),)¶
-
__init__
(msg) → None¶
-
__module__
= 'labgrid.external.usbstick'¶
-
__repr__
()¶ Automatically created by attrs.
-
__weakref__
¶ list of weak references to the object (if defined)
-