Automated tests for the U-Boot fastboot and memory-protection features used when flashing raw images onto Toradex modules.
The tests are written with BATS and drive the device over USB through NXP's uuu and, for some tests, the standard fastboot tool.
The suites in tests/ cover:
fastboot.bats: fastboot buffer address protection and the fastboot commands used for flashing (getvar,download,flash,erase,boot,reboot,set_active, and theoemcommands).cp.bats: the U-Boot hardening checks that makecprefuse to read or write outside the accessible RAM range, for every access size. The RAM range is read frombdinfo, so the tests do not hard-code addresses.
The image under test can be a Toradex Easy Installer image (with a recovery/ directory) or a package built by the flashing tool from meta-toradex-flasher (with a flash/ directory).
Install the BATS repositories into bats/ (set CLEAN_INSTALL=1 to re-clone them):
./setup.sh
Run the tests as root, passing the directory of the unpacked image:
sudo ./run.sh <image-dir>
Put the device into recovery mode when prompted.
JUnit reports are written to reports/.
Environment variables accepted by run.sh:
TESTS: test files to run (default:tests/*.bats).BATS_ARGS: arguments passed tobats.BATS_VERBOSE=1: show the output of passing tests.SERCAP_CMD: command that captures the U-Boot serial console, e.g.nc localhost 2004with aser2netport attached to the device's console. Tests that check U-Boot error messages are skipped or relaxed when unset.SERCAP_DIR: directory for thesercap.logandsercap-last.logcapture files (default: current directory).
All scripts and tests are MIT licensed unless otherwise stated; see the LICENSE file.
Third-party components fetched by setup.sh (the BATS repositories) are under their own licenses.
This README document is Copyright (C) 2026 Toradex AG.