Module 14 · Lesson 77 of 92

Designing the board test suite

Design a board test suite, trace each result to the hardware and build that produced it, and report failures and gaps in coverage.

  • Beginner to advanced
  • 9 min read
  • 16 min lab
What you will need

Ubuntu 24.04 in WSL2 or a VM for the written exercises. The board and fixture examples are for a Raspberry Pi 4.

Your place in the module
By the end you can 4 objectives
  • Assign board checks to smoke and full test profiles.
  • Write a versioned board manifest with test criteria and fixture requirements.
  • Link a LAVA test result to a build, a physical board, and a run attempt.
  • Produce a per-build report with distinct outcomes for failures and missing coverage.
Video coming soonDesigning the board test suite
The video for this lesson is being recorded. Read the lesson below in the meantime.
Recall first from labgrid and hardware-in-the-loop
  • A labgrid place groups matched resources and can be acquired for exclusive use through labgrid.
  • A pytest test runs on the runner and can use a labgrid target and its configured drivers to operate the board.
  • An SD-Mux gives the writer host and the target access to the same card at different times.
01

Choose what the smoke and full suites verify

3 min read

The rig is running, so now you decide what actually gets tested. This lesson answers the smoke-versus-full split, the per-board manifest, and how results map back to hardware and reach a dashboard.

A Raspberry Pi 4 can reach a shell while its wired Ethernet fails to transfer data. Linux exposes devices through sysfs, so a device listing gives you evidence that an interface is present. To establish that the Ethernet port works for your image, you need evidence of traffic through that port. A board suite gives those observations different test names and defines which one counts toward the behavior you intend to verify. sysfs(5)

Start with the behaviors the image promises on the board. For a Raspberry Pi 4 image that runs from a microSD card and uses wired Ethernet, a smoke run could check that user space responds, that the root filesystem came from the expected medium, and that the wired interface can exchange traffic with a known lab peer. Give each check a stable case ID and its own verdict. Collect the expected and observed values so a failed verdict explains what the test saw.

Define the user-space check around a specific action. For example, after the console reaches the expected login, have the test authenticate and run a command that emits a token unique to that attempt. A login prompt alone establishes less than a successful command. For the root check, use the mount record for / from /proc/self/mountinfo in the test process's mount namespace. For an image whose root is mounted directly from a block device, compare its mount device identity against the expected root partition resolved for the run. An image using an overlay needs a check that also establishes the identity of its backing filesystem. proc_pid_mountinfo(5)

For Ethernet, use a reachable peer on the fixture and constrain the traffic to the intended wired interface. Record which interface and peer were used. On a board with both Wi-Fi and Ethernet, an unconstrained request can succeed over Wi-Fi and leave the wired port unverified. Check the peer's availability independently when possible. If the peer is confirmed down, record an infrastructure problem and leave the Ethernet verdict unknown. If the peer and fixture are healthy and the board cannot exchange traffic within the case's deadline, the test has evidence for a failure.

The full profile includes those smoke cases and adds the behaviors that need more time, equipment, or repeated operations. On the same board and image, it might add a sustained Ethernet transfer with a specified minimum rate and a checksum check at the receiver. It might also check that a file written to a designated writable test volume survives a controlled reboot and still has the expected checksum. Scope writes to the test volume and clean up after the check so the next run starts from known conditions. Set acceptance limits from the requirements for this image and fixture. Record the units and measured values so a later report can explain a failure against the limit in force at the time.

Give cases explicit dependencies. If the board never reaches responsive user space, the root and network checks that run from its shell are blocked. Retain the boot evidence and record why the dependent cases could not execute. A full profile may still collect independent evidence from the fixture. A profile called “full” claims the coverage listed in its definition, so a full pass has a precise meaning even when the image has features outside the suite's scope.

Smoke and full coverageSmokeFullUser spaceCommandrespondsCommandrespondsRoot mediumVerify mountVerify mountWired EthernetPeer exchangeExchange andsustainedtransferStoragepersistenceOutsideprofileVerify afterreboot
The full profile includes the smoke checks and adds longer functional checks.
02

Write the board manifest and identify the hardware

4 min read

Keep a versioned manifest for each board profile. A Raspberry Pi 4 profile for a microSD image can share test implementations with a Raspberry Pi 5 profile while selecting its own boot medium, applicable cases, and fixture requirements. Define the profile by board model, applicable hardware revisions, and image variant. Then list the case IDs, the suites they belong to, prerequisites, deadlines, pass criteria, and evidence to preserve. Version the criteria along with the manifest or reference a versioned test definition. In either case, an old report should point to the exact rule that produced its verdict.

Here is an excerpt from an illustrative Raspberry Pi 4 manifest. The case names and role names belong to this suite. A real manifest would also reference the versioned criteria and deadlines for each case.

Case ID Profiles Expected behavior Fixture or evidence
boot.userspace Smoke, full A command returns the current attempt's token Serial console and token in the log
root.expected-medium Smoke, full The root mount resolves to the expected microSD partition Mount record and resolved partition identity
ethernet.wired-peer Smoke, full Traffic reaches the fixture peer through the wired port Known peer, selected interface, and exchange result
storage.reboot-persistence Full A test file survives reboot with the expected checksum Dedicated writable test volume and both checksums

Give fixture resources logical names in the manifest, such as wired-peer and test-volume. Resolve those names for the specific rig and store the resolved values with the run. The same case can then execute at another station with a different peer address while preserving enough evidence to reproduce either attempt. Declare applicability before execution. If an image provides no writable test volume by design, the persistence case can be marked inapplicable with that reason. If the manifest requires the volume and the rig lacks it on the day, the case is blocked and the expected coverage remains incomplete.

Record hardware at two levels. The model and revision tell you which results can be grouped for comparison. The lab's asset ID or actual LAVA device hostname tells you which physical unit ran the job. Record the fixture or station ID too, since two identical boards can be connected to different cables, power supplies, and peers. Take these values from the run's actual device assignment and lab inventory. A job request for a device type identifies eligible hardware. The assigned device identifies what was tested.

Use that identity when reading failures. If Ethernet starts failing on one unit after several builds, compare attempts on another unit with the same board profile. Where the fixture can be changed independently, hold the build and suite constant and record each board and fixture pairing. Failures following a fixture suggest a different investigation from failures following a build across fixtures. Preserve each attempt so somebody can verify that the compared results used the same test criteria and image.

Evidence for a case resultCase resultManifest revisioncase and criteriaBuild identityexact tested artifactsPhysical boardmodel, revision, unit IDFixture identitystation and resolved resourcesJob attemptjob ID and logsCase resultManifest revisioncase and criteriaBuild identityexact tested artifactsPhysical boardmodel, revision, unit IDFixture identitystation and resolvedresourcesJob attemptjob ID and logs
A test result links the case definition to the exact build, board, and fixture used.
03

Turn recorded results into a per-build report

4 min read

In LAVA, inspect both the job outcome and the individual test-case results. A job can run through its steps while a case reports failure. A job can also stop before a test definition emits any results. Keep the LAVA job ID and a link to the job log, and use the case results for the verdicts they actually establish. When importing results, map a case to your stable ID using its suite and case name. Compare the imported cases against the manifest. If a serial connection fails before the runner starts, the missing cases remain visible in the report with the reason execution stopped. If the console was available and the image demonstrably failed to meet the defined boot criterion, record a boot failure and mark its dependent cases blocked.

Store results under a durable build ID. Associate that ID with the source revision, configuration, and digests or immutable references for the tested kernel, device tree, and root filesystem. Record relevant bootloader or firmware identity when it can affect the run, including firmware already present on the unit. A source revision alone can identify several builds with different configurations or image contents. Each attempt should carry the build ID, suite profile, manifest and test revisions, actual device and fixture IDs, timestamps, and LAVA job reference. Store the per-case outcome, reason, measurements with units where applicable, and links to supporting logs. Keep those links usable for as long as the report is retained.

Use an attempt ID to distinguish retries. Importing the same LAVA job again should update or reconcile that attempt without duplicating its case rows. A rerun gets a new attempt record. If a required case fails on the first attempt and passes on the second, show both outcomes and indicate which one the summary displays. A later pass preserves evidence that the case can succeed under the recorded conditions. Keeping the first log preserves the evidence needed to investigate an intermittent fault.

From LAVA to a build reportRead LAVAresultsjob andcaseevidenceStore bybuildkeep eachattemptComparewithmanifestaccount foreveryexpectedcaseDisplaydashboardoutcomes,coverage,and logsRead LAVAresultsjob andcaseevidenceStore bybuildkeep eachattemptComparewithmanifestaccount foreveryexpectedcaseDisplaydashboardoutcomes,coverage,and logs
The report compares recorded cases with the coverage expected for the build.

A local report can use a table with one row per board profile and case, expandable to show the actual units and attempts. For each build, show how many applicable cases were expected and how many passed, failed, were blocked, or have no recorded result. Keep cases declared inapplicable visible with their reasons. In an illustrative smoke run, boot.userspace and root.expected-medium might pass while ethernet.wired-peer is blocked by a fixture outage. The report should say that two of three expected checks passed and one was blocked. Showing only the two executed checks would hide the missing Ethernet evidence.

A kernelci.org-style dashboard lets a reader start with a kernel revision and build configuration, compare results across hardware, and open the relevant test and log. provides a way to publish results in a common form. LAVA supplies job and case evidence. An exporter maps that evidence to the KCIDB schema accepted by the receiver. It links the source checkout to its build and the test records to the build that ran, and includes the test path, outcome, environment, and log information as supported by that schema. Preserve the original records locally so the dashboard can still answer questions about fixture identity, image digests, and attempts even when the shared report carries less detail.

Before you call a build green, ask what a reader could conclude from the report. Can they tell which board revision ran the test, whether the wired port was exercised, and which log supports the result? Can they tell why a case has no verdict? The next lesson, “CI and boot testing the fleet,” answers how to run boot checks across multiple boards and use the resulting evidence in CI.

Key takeaways

  • A smoke run verifies basic operation and selected short checks. A full run covers the wider set of behaviors promised by the board profile.
  • The board manifest defines expected coverage. The run record identifies the actual board, fixture, and artifacts used.
  • A LAVA job outcome and its individual test results describe different aspects of the run.
  • A dashboard needs expected coverage as well as observed results to show where evidence is missing.
Reflect
  1. Explain to a colleague, in two sentences: assign board checks to smoke and full test profiles.
  2. Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
  3. What surprised you when you ran the commands yourself?
On a real board

Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.

References and further reading

Official documentation first. Links checked when the lesson was published.

Find your next step

↑ ↓ to move · Enter to open · Esc to close