Skip to main content
labgrid logo

Welcome to labgrid

LGPLv2.1 unit tests status docker build status coverage status documentation status chat chat

Labgrid is an embedded board control python library with a focus on testing, development and general automation. It includes a remote control layer to control boards connected to other hosts.

Getting started

There is a tutorial series on the Pengutronix Youtube channel you can follow to get started: Labgrid Tutorial Playlist.

The other starting point is in the documentation.

Purpose and Features

The idea behind labgrid is to create an abstraction of the hardware control layer needed for testing of embedded systems, automatic software installation and automation during development. Labgrid itself is not a testing framework, but is intended to be combined with pytest (and additional pytest plugins). Please see Design Decisions for more background information.

It currently supports:

  • remote client-exporter-coordinator infrastructure to make boards available from different computers on a network

  • pytest plugin to write automated tests for embedded systems

  • CLI and library usage for development and automation

  • interaction with bootloader and Linux shells on top of serial console or SSH

  • power/reset management via drivers for power switches

  • upload of binaries and device bootstrapping via USB

  • control of digital outputs, SD card and USB multiplexers

  • integration of audio/video/measurement devices for remote development and testing

  • Docker/QEMU integration

While labgrid is currently used for daily development on embedded boards and for automated testing, several planned features are not yet implemented and the APIs may be changed as more use-cases appear. We appreciate code contributions and feedback on using labgrid on other environments (see Contributing for details). Please consider contacting us (via a GitHub issue) before starting larger changes, so we can discuss design trade-offs early and avoid redundant work. You can also look at Ideas for enhancements which are not yet implemented.

Documentation

labgrid’s documentation is hosted on Read the Docs.

Contributing

See our Development Docs.

Visit us in our IRC channel #labgrid on libera.chat (bridged to the Matrix channel #labgrid:matrix.org)

Background

Work on labgrid started at Pengutronix in late 2016 and is currently in active use and development.

Installation

See the Installation section for more details.

Install Latest Release

Install labgrid via PyPi:

$ virtualenv -p python3 venv
$ source venv/bin/activate
venv $ pip install --upgrade pip
venv $ pip install labgrid

Install Development State

Clone the git repository:

$ git clone https://github.com/labgrid-project/labgrid

Create and activate a virtualenv for labgrid:

$ virtualenv -p python3 venv
$ source venv/bin/activate
venv $ pip install --upgrade pip

Install labgrid into the virtualenv:

venv $ pip install .

Tests can now run via:

venv $ python -m pytest --lg-env <config>

To install sphinx and the dependencies needed for generating man pages and documentation run:

venv $ pip install '.[doc]'

Metadata

Release files for labgrid 26.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for labgrid 26.0.1
File Size Uploaded
labgrid-26.0.1.tar.gz 491.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for labgrid 26.0.1
File Interpreter ABI Platform
labgrid-26.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 770.9 kB

Release files / labgrid-26.0.1.tar.gz

Download URL labgrid-26.0.1.tar.gz
Size 491.4 kB
Tags Source
SHA-256 checksum
How to use checksums
330e54c49f7660619ecaccbe72576ca548643fea1312d0f538fdedd73671c1b5
BLAKE2b-256 checksum
How to use checksums
12afb9489d6c76b9c29b34b72c11865584d149f97d93116afa951d61548ae7bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / labgrid-26.0.1-py3-none-any.whl

Download URL labgrid-26.0.1-py3-none-any.whl
Size 279.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
203bc35abcbc2071c441c83ab4723ae7f6cb6a7067bd7880d24d7f3703bada53
BLAKE2b-256 checksum
How to use checksums
08ddc70b289281ad738be63841a0690f1a782760213f6150435cdc4a0f33d355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page