labgrid Training
Automated software tests are great! Come up with a couple of test cases, write some code and from that point onwards you can always make somewhat sure that your newly written code does not break old assumptions by running pytest, cargo test or meson test.
Paired with a continuous integration pipeline, that runs these tests in an automated fashion (e.g. for each merge/pull request), many possible software errors can be found before they even make it to the main branch of your project.
But what if the software you want to test needs to interact with some kind of hardware? E.g. because it is an embedded system that uses an architecture that is very much not like the one you use on your development system?
That's where labgrid comes into play!
At a glance
- Type of Training: Private training for your team
- Location: On-site
- Duration: Two or three days
- Number of Attendees: 1 to 5 attendees
- Written Language: English
- Spoken Language: English or German
- Agenda: See chapter "The Workshop"
- Necessary Prior Knowledge: Basics of using Embedded Linux and Python
- Target Audience: Embedded Linux developers and Embedded Linux testers
- Required Hardware: Will be provided
In order to conduct the training at your premises, the following requirements must be met:
- Training room
- Projector for presentations
- Laptop or other PC with Linux installed for each participant
- Unfiltered internet connection via network cable
- Power sockets for each seat
A few words about labgrid
labgrid makes it possible to remote-control Embedded Linux devices, either interactively or to conduct integration tests of an Embedded Linux on the actual hardware.
The labgrid project consists of a couple of components:
A Python library that provides abstractions for various kinds of devices.
These abstractions encompass devices like power switches to turn a device under test (DUT) on or off, devices that can be used to load new software into the DUT, but also different ways to communicate with the DUT, like serial adapters or SSH.
A client ⇄ coordinator ⇄ exporter infrastructure that allows using DUTs over a network and also allows locking and reservation of a device to prevent conflicts between users.
This way a single device can be shared between multiple users. Or even multiple users and a continuous integration pipeline that autonomously runs jobs on devices, all on its own.
By sharing a single DUT between users and test jobs you can get great utilization of a small number of prototype DUTs.
The workshop
In our two day workshop we want to enable you and your team to get started with labgrid immediately. This includes both the interactive use case where you want to share a number of DUTs between multiple developers, as well as the automated testing use case.
To make sure we are not wasting time on infrastructure setup and troubleshooting, we will bring a full set of pre-configured devices and lab infrastructure consisting of LXA TACs and other common remote-control equipment for each participant. Our hardware covers the most common use cases.
The workshop is split into two main parts. First an interactive lecture, where we walk through prepared examples, that illustrate typical labgrid use cases. Second a workshop, where the participants come up with their own solutions to automate different test scenarios.
- Day 1 (Lecture): Basic labgrid Usage
- Introduction to the various parts of a labgrid setup.
- An overview of the different hardware (and software) components used to control DUTs.
- Interactive labgrid usage via labgrid-client.
- Using labgrid as a Python library.
- Using labgrid strategies to automate state transitions (DUT powered off → flashing → power on → booting → login → shell).
- Integration with pytest to automate execution of tests.
- Day 2 (Lecture): Advanced Topics
- (Re-)initializing a DUT into a well-known state for reproducible tests.
- Testing of updates including data migration and fallback.
- Discussion of complex scenarios like provisioning with secure boot enabled.
- Automatic execution of tests using Gitlab CI.
- Discussion of options for integrating your specific hardware via labgrid and outlining possible test cases.
The lecture part alternates between theoretical lectures and practical exercises on the device. Practical exercises make up 50% to 70% of the duration.
- Day 3 (Workshop, optional): Kick-starting your labgrid Lab
- Expansion of the test setup from day 1 by the workshop participants.
- Automating the test execution using GitLab CI.
- Discuss ways to integrate your team's hardware into a remotelab infrastructure and to write tests for it.
The optional workshop is carried out in pair programming with a few developers and our experts.
Contact
Did we catch your interest? Then feel free to contact us and request your individual quote:
info@pengutronix.de
We are also open to customizing the workshop contents to your team.