Boot Tests

Boot tests are a useful framework for exercising code in low-level environments (e.g., early kernel or userspace boot) where mechanisms for command/control or data exfiltration are hard to come by. In this framing, a test is specified by a set of images to boot (e.g., via a product bundle), execution amounts to booting the images, and the determination of success is indicated by a magic ‘success string’ being printed to serial at some point during or after the boot process, after the relevant logic has successfully executed.

Templates that define boot tests wrap boot_test().

For reasons particular to automated testing, all boot tests are expected be aggregated under the //bundles/boot_tests/BUILD.gn. Once in your dependency graph, boot tests can be executed locally with fx run-boot-test.