A professional automated verification framework for embedded systems. It features a multi-threaded device emulator supporting UART, CAN, and UDP protocols, coupled with a robust Robot Framework test suite.
- Asynchronous Target Emulator: Python-based multi-threaded engine simulating real-time hardware behavior.
- Protocol Abstraction Layer: High-level library (
ProtocolLib) for seamless interaction with UART, CAN, and UDP interfaces. - Robust Testing Logic: Advanced Robot Framework keywords implemented with retry mechanisms to handle asynchronous bus latencies and race conditions.
- Industrial-Grade CI/CD: Fully automated pipeline using GitHub Actions for code quality (Ruff) and syntax validation.
src/target_emulator.py: The Device Under Test (DUT) logic, managing concurrent bus interfaces.libs/ProtocolLib.py: Specialized driver for low-level protocol communication.tests/connectivity.robot: System-level integration test suite.scripts/setup_env.sh: Infrastructure automation for virtual networking (vcan, socat).
Ensure you are running a Linux environment (for vcan and socat support) and install the dependencies:
pip install -r requirements.txtInitialize virtual CAN and UART bridge interfaces:
chmod +x scripts/setup_env.sh
./scripts/setup_env.shIn separate terminals, follow this sequence:
-
Run the Emulator:
python src/target_emulator.py
-
Launch the Test Suite:
robot tests/connectivity.robot
To stop the background processes (UART bridges) and remove virtual network interfaces, run:
chmod +x scripts/cleanup.sh
./scripts/cleanup.shThis repository uses GitHub Actions to enforce high engineering standards on every push:
- Linting & Formatting: Powered by
Ruffto ensure PEP8 compliance and clean code. - Syntax Validation: Automatic verification of Robot Framework libraries and test suites to prevent broken builds.
A core challenge in asynchronous embedded testing is bus latency. This framework avoids flaky tests by implementing a smart retry mechanism using Robot Framework's Wait Until Keyword Succeeds.
Instead of using fixed Sleep commands—which make tests slow and unreliable—the suite polls the system state with a defined timeout. This ensures the tests are as fast as the hardware allows while remaining deterministic.
Developed by Angelgx298