Repository navigation
Getting started
Needs Python 3.10 or later and git. Linux, Windows and macOS are tested in CI.
git clone https://github.com/steitec/bench-automation
cd bench-automation
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"bench demo starts the simulated instruments and board on free ports, runs the
full test against them and stops them again:
bench demo # healthy board -> PASS, exit code 0
bench demo --fault smart # worn SSD -> FAIL in "Storage", exit code 1Each run writes a folder reports/<serial>_<timestamp>/ with
| File | For |
|---|---|
report.html |
the engineer: every step, the scope curves, the boot log diagnosis, the full console log |
protocol.html |
the unit's paperwork: verdict, failed checks, limits, signature boxes (see Test protocol) |
result.json |
machines: everything above as data |
measurements.csv |
spreadsheets: one measurement per row |
bench demo --help lists the faults; Fault walkthrough explains them.
To see the station the way it runs on a real bench, start the simulator on its fixed ports in one terminal …
bench simulate --fault rail_1v05 psu TCPIP0::127.0.0.1::5025::SOCKET
dmm TCPIP0::127.0.0.1::5026::SOCKET
mux TCPIP0::127.0.0.1::5027::SOCKET
console socket://127.0.0.1:5028
scope TCPIP0::127.0.0.1::5029::SOCKET
fault: rail_1v05 (1.05 V core rail missing) -- Ctrl+C to stop
… and run the test from another, as many times as you like:
bench run --operator "J. Doe"bench run reads the bundled station.yaml, whose resources point at exactly
these ports. While the simulator runs you can also talk to the instruments
yourself, for example with PyVISA:
import pyvisa
rm = pyvisa.ResourceManager("@py")
dmm = rm.open_resource("TCPIP0::127.0.0.1::5026::SOCKET",
read_termination="\n", write_termination="\n")
print(dmm.query("*IDN?"))Copy the bundled config and pass it with --config:
python -c "import bench, pathlib; print(pathlib.Path(bench.__file__).parent / 'station.yaml')"
cp <that path> my-station.yaml
bench run --config my-station.yamlFiles the config names (golden log, rule files, logo) are relative to the config file itself.
pytestThe suite runs the whole sequence against a healthy board and against every fault, and checks that exactly the expected step fails. It takes about a minute, because the board is simulated at 5× speed, not instantly.
bench-automation · MIT licensed · instrument names are trademarks of their owners; bench-automation is not affiliated with them.
bench-automation
Links
Related tools