Skip to content
Permalink
Browse files

Merge pull request #564 from Emantor/fix/various

Various smaller fixes and cleanups
  • Loading branch information
jluebbe committed Feb 11, 2020
2 parents a6c6e3f + ca51017 commit 49be4eb07e374e22e1db5d1362717a02b00411bd
@@ -51,6 +51,7 @@ Breaking changes in 0.3.0
dir. Hence coordinator specific files like ``places.yaml`` and
``resources.yaml`` are now also stored in the crossbar configuration folder.
Previously it would use ``..``.
- The ``HawkbitTestClient`` and ``USBStick`` classes have been removed

Release 0.2.0 (released Jan 4, 2019)
------------------------------------
@@ -198,6 +198,11 @@ by running ``crossbar start`` inside of the repository.
crossbar is a network messaging framework for building distributed
applications, which labgrid plugs into.

.. note:: For long running deployments, you should copy and customize the
``.crossbar/config.yaml`` file for your use case. This includes
setting a different ``workdir`` and may include changing the running
port.

Exporter
~~~~~~~~

@@ -625,47 +625,3 @@ labgrid contains some command line tools which are used for remote access to
resources.
See :doc:`man/client`, :doc:`man/device-config` and :doc:`man/exporter` for
more information.

USB stick emulation
--------------------
labgrid makes it posible to use a target as an emulated USB stick, allowing
upload, modification, plug and unplug events.
To use a target as an emulated USB stick, several requirements have to be met:

- OTG support on one of the device USB ports
- losetup from util-linux
- mount from util-linux
- A kernel build with `CONFIG_USB_GADGETFS=m`
- A network connection to the target to use the :ref:`SSHDriver <conf-sshdriver>` for file uploads

To use USB stick emulation, import :any:`USBStick` from `labgrid.external` and bind
it to the desired target:

.. code-block:: python
from labgrid.external import USBStick
stick = USBStick(target, '/home/')
The above code block creates the stick and uses the `/home` directory to store
the device images. USBStick images can now be uploaded using the `upload_image`
method. Once an image is selected, files can be uploaded and retrived using the
`put_file` and `get_file` methods. The `plug_in` and `plug_out` functions plug
the emulated USB stick in and out.

hawkBit management API
----------------------

labgrid provides an interface to the hawkbit management API.
This allows a labgrid test to create targets, rollouts and manage deployments.

::

from labgrid.external import HawkbitTestClient

client = HawkbitTestClient('local', '8080', 'admin', 'admin')


The above code connects to a running hawkbit instance on the local computer and
uses the default credentials to log in. The :any:`HawkbitTestClient` provides various
helper functions to add targets, define distribution sets and assign targets.
@@ -147,7 +147,7 @@ def _run(self, cmd, codec="utf-8", decodeerrors="strict", timeout=None): # pylin
"error executing command: {}".format(complete_cmd)
)

stdout, stderr = sub.communicate()
stdout, stderr = sub.communicate(timeout=timeout)
stdout = stdout.decode(codec, decodeerrors).split('\n')
stdout.pop()
if stderr is None:

This file was deleted.

This file was deleted.

0 comments on commit 49be4eb

Please sign in to comment.
You can’t perform that action at this time.