This page provides best practices, examples, and reference materials for using Fuchsia's Lacewing framework for writing host-driven tests (also known as end-to-end tests or system tests).
Vision
Lacewing is Fuchsia's unified host-driven testing framework. It's designed to serve users both in-tree and out-of-tree.
At a high level, Lacewing aims to:
Eliminate host-driven test framework fragmentation
Improve host-driven test stability and reliability
Centralize host-target interaction to versioned and officially supported APIs
Lower the barrier of entry for host-driven test development
Getting started
See Getting Started.
Example tests
The Fuchsia repository contains several example tests in
//src/testing/end_to_end/examples/ demonstrating different
Lacewing capabilities:
Hello World Test: Demonstrates basic test structure, DUT connection, and built-in health checks.
FIDL Hello World Test: Demonstrates direct FIDL protocol communication with on-device services using Fuchsia Controller.
Data Resource Access Test: Demonstrates packaging and reading custom test data files at runtime.
Test Cases Example: Demonstrates structuring reusable test logic using
FuchsiaTestCases.Soft Reboot Test: Demonstrates rebooting a Fuchsia device and verifying recovery.
Power Cycle Test: Demonstrates hard power cycling via auxiliary hardware (DMC/PDU).
Multi-Device Test: Demonstrates coordinating tests across multiple devices in a testbed.
To run example tests locally on a Fuchsia emulator:
# Include example tests in build configuration fx set core.x64 --with //src/testing/end_to_end/examples# Start emulator (if not already running) ffx emu start --headless# Run specific example test fx test //src/testing/end_to_end/examples/hello_world_test --e2e --output fx test //src/testing/end_to_end/examples/fidl_hello_world_test --e2e --output
For more detailed setup and execution instructions, see the Examples README.