| 1 |
.. image:: https://raw.githubusercontent.com/labgrid-project/labgrid/master/labgrid_logo.png |
| 2 |
:alt: labgrid logo |
| 3 |
:align: center |
| 4 |
|
| 5 |
Welcome to labgrid |
| 6 |
================== |
| 7 |
|license| |unit-tests| |docker-build| |coverage-status| |docs-status| |chat| |calver| |
| 8 |
|
| 9 |
Labgrid is an embedded board control python library with a focus on testing, development |
| 10 |
and general automation. |
| 11 |
It includes a remote control layer to control boards connected to other hosts. |
| 12 |
|
| 13 |
* `Getting started <#Getting-started>`_ |
| 14 |
|
| 15 |
* `Purpose and Features <#purpose-and-features>`_ |
| 16 |
|
| 17 |
* `Documentation <#documentation>`_ |
| 18 |
|
| 19 |
* `Contributing <#contributing>`_ |
| 20 |
|
| 21 |
* `Background <#background>`_ |
| 22 |
|
| 23 |
* `Installation <#installation>`_ |
| 24 |
|
| 25 |
* `Install Latest Release <#install-latest-release>`_ |
| 26 |
|
| 27 |
* `Install Development State <#install-development-state>`_ |
| 28 |
|
| 29 |
Getting started |
| 30 |
--------------- |
| 31 |
There is a tutorial series on the Pengutronix Youtube channel you can follow to |
| 32 |
get started: `Labgrid Tutorial Playlist |
| 33 |
<https://www.youtube.com/playlist?list=PLPy6BX4pJosCEq7CIU06bt2WM7lFAy1CF>`_. |
| 34 |
|
| 35 |
The other starting point is in the `documentation |
| 36 |
<https://labgrid.readthedocs.io/en/latest/getting_started.html>`__. |
| 37 |
|
| 38 |
Purpose and Features |
| 39 |
-------------------- |
| 40 |
The idea behind labgrid is to create an abstraction of the hardware control |
| 41 |
layer needed for testing of embedded systems, automatic software installation |
| 42 |
and automation during development. |
| 43 |
Labgrid itself is *not* a testing framework, but is intended to be combined with |
| 44 |
`pytest <https://docs.pytest.org>`_ (and additional pytest plugins). |
| 45 |
Please see `Design Decisions |
| 46 |
<https://labgrid.readthedocs.io/en/latest/design_decisions.html>`_ for more |
| 47 |
background information. |
| 48 |
|
| 49 |
It currently supports: |
| 50 |
|
| 51 |
- remote client-exporter-coordinator infrastructure to make boards available |
| 52 |
from different computers on a network |
| 53 |
- pytest plugin to write automated tests for embedded systems |
| 54 |
- CLI and library usage for development and automation |
| 55 |
- interaction with bootloader and Linux shells on top of serial console or SSH |
| 56 |
- power/reset management via drivers for power switches |
| 57 |
- upload of binaries and device bootstrapping via USB |
| 58 |
- control of digital outputs, SD card and USB multiplexers |
| 59 |
- integration of audio/video/measurement devices for remote development and |
| 60 |
testing |
| 61 |
- Docker/QEMU integration |
| 62 |
|
| 63 |
While labgrid is currently used for daily development on embedded boards and for |
| 64 |
automated testing, several planned features are not yet implemented and the APIs |
| 65 |
may be changed as more use-cases appear. |
| 66 |
We appreciate code contributions and feedback on using labgrid on other |
| 67 |
environments (see `Contributing |
| 68 |
<https://labgrid.readthedocs.io/en/latest/development.html#contributing>`__ for |
| 69 |
details). |
| 70 |
Please consider contacting us (via a GitHub issue) before starting larger |
| 71 |
changes, so we can discuss design trade-offs early and avoid redundant work. |
| 72 |
You can also look at `Ideas |
| 73 |
<https://labgrid.readthedocs.io/en/latest/development.html#ideas>`_ for |
| 74 |
enhancements which are not yet implemented. |
| 75 |
|
| 76 |
Documentation |
| 77 |
------------- |
| 78 |
labgrid's documentation is hosted on `Read the Docs <http://labgrid.readthedocs.io/en/latest/>`_. |
| 79 |
|
| 80 |
Contributing |
| 81 |
------------ |
| 82 |
See our `Development Docs <http://labgrid.readthedocs.io/en/latest/development.html>`_. |
| 83 |
|
| 84 |
Visit us in our IRC channel ``#labgrid`` on libera.chat (bridged to the |
| 85 |
`Matrix channel #labgrid:matrix.org <https://app.element.io/#/room/#labgrid:matrix.org>`_) |
| 86 |
|
| 87 |
Background |
| 88 |
---------- |
| 89 |
Work on labgrid started at `Pengutronix <http://pengutronix.de/>`_ in late 2016 |
| 90 |
and is currently in active use and development. |
| 91 |
|
| 92 |
Installation |
| 93 |
------------ |
| 94 |
See the `Installation section |
| 95 |
<http://labgrid.readthedocs.io/en/latest/getting_started.html#installation>`_ |
| 96 |
for more details. |
| 97 |
|
| 98 |
Install Latest Release |
| 99 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 100 |
Install labgrid via PyPi: |
| 101 |
|
| 102 |
.. code-block:: bash |
| 103 |
|
| 104 |
$ virtualenv -p python3 venv |
| 105 |
$ source venv/bin/activate |
| 106 |
venv $ pip install --upgrade pip |
| 107 |
venv $ pip install labgrid |
| 108 |
|
| 109 |
Install Development State |
| 110 |
^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 111 |
Clone the git repository: |
| 112 |
|
| 113 |
.. code-block:: bash |
| 114 |
|
| 115 |
$ git clone https://github.com/labgrid-project/labgrid |
| 116 |
|
| 117 |
Create and activate a virtualenv for labgrid: |
| 118 |
|
| 119 |
.. code-block:: bash |
| 120 |
|
| 121 |
$ virtualenv -p python3 venv |
| 122 |
$ source venv/bin/activate |
| 123 |
venv $ pip install --upgrade pip |
| 124 |
|
| 125 |
|
| 126 |
Install labgrid into the virtualenv: |
| 127 |
|
| 128 |
.. code-block:: bash |
| 129 |
|
| 130 |
venv $ pip install . |
| 131 |
|
| 132 |
Tests can now run via: |
| 133 |
|
| 134 |
.. code-block:: bash |
| 135 |
|
| 136 |
venv $ python -m pytest --lg-env <config> |
| 137 |
|
| 138 |
To install sphinx and the dependencies needed for generating man pages and documentation run: |
| 139 |
|
| 140 |
.. code-block:: bash |
| 141 |
|
| 142 |
venv $ pip install '.[doc]' |
| 143 |
|
| 144 |
.. |license| image:: https://img.shields.io/badge/license-LGPLv2.1-blue.svg |
| 145 |
:alt: LGPLv2.1 |
| 146 |
:target: https://raw.githubusercontent.com/labgrid-project/labgrid/master/LICENSE |
| 147 |
|
| 148 |
.. |unit-tests| image:: https://github.com/labgrid-project/labgrid/workflows/unit%20tests/badge.svg |
| 149 |
:alt: unit tests status |
| 150 |
:target: https://github.com/labgrid-project/labgrid/actions?query=workflow%3A%22unit+tests%22+branch%3Amaster |
| 151 |
|
| 152 |
.. |docker-build| image:: https://github.com/labgrid-project/labgrid/workflows/docker%20build/badge.svg |
| 153 |
:alt: docker build status |
| 154 |
:target: https://github.com/labgrid-project/labgrid/actions?query=workflow%3A%22docker+build%22+branch%3Amaster |
| 155 |
|
| 156 |
.. |coverage-status| image:: https://codecov.io/gh/labgrid-project/labgrid/branch/master/graph/badge.svg |
| 157 |
:alt: coverage status |
| 158 |
:target: https://codecov.io/gh/labgrid-project/labgrid |
| 159 |
|
| 160 |
.. |docs-status| image:: https://readthedocs.org/projects/labgrid/badge/?version=latest |
| 161 |
:alt: documentation status |
| 162 |
:target: https://labgrid.readthedocs.io/en/latest/?badge=latest |
| 163 |
|
| 164 |
.. |chat| image:: https://matrix.to/img/matrix-badge.svg |
| 165 |
:alt: chat |
| 166 |
:target: https://app.element.io/#/room/#labgrid:matrix.org |
| 167 |
|
| 168 |
.. |calver| image:: https://img.shields.io/badge/calver-YY.MINOR%5B.MICRO%5D-22bfda.svg |
| 169 |
:alt: chat |
| 170 |
:target: https://calver.org/ |