This tutorial assumes you have completed the Getting Started guide: the CLI is installed, your box is added, and your instruments are configured with nets.
Part 1: CLI Walkthrough
Let’s step through a typical test flow using individual CLI commands. This is useful for ad-hoc testing, debugging, and getting familiar with your setup.Step 1: Verify your box is online
Step 2: Check connected instruments
Step 3: View your configured nets
Step 4: Set defaults to reduce typing
--box and net names from subsequent commands.
Step 5: Flash firmware
Step 6: Power on your device
Step 7: Take a measurement
Step 8: Power down
Part 2: Your First Test Script
Now let’s convert the manual CLI steps into a repeatable test. The key advantage of a script is that it always cleans up after itself (disabling power) even if an error occurs. You can write it in Python (runs on the box vialager python) or in Rust (an ordinary cargo test in your firmware repo, using the lager-net crate). Both versions below do the same thing: flash, power on, measure, assert, clean up.
Cleanup matters: the Python version uses
try/finally to guarantee the power supply is disabled even if an error occurs, and the Rust version disables power before its assertion (any earlier ? error also ends the test with the supply’s state visible in the failure). This is important for protecting your hardware.Part 3: Running It
Execute the Python script on your Lager Box:lager = { package = "lager-net", version = "0.2" } in [dev-dependencies]):
--add-file:
What’s Next
You’ve completed your first test with Lager. Here are some directions to explore:- CLI Reference — Full documentation for every CLI command
- Python API — Complete Python SDK reference
- Rust API — Write your HIL suite as
cargo testintegration tests - Troubleshooting — Solutions when things go wrong
- Glossary — Definitions for technical terms used in the docs

