ci/docker_utils/README.qemu.md
This directory contains Docker-based QEMU ESP32 emulation tools for FastLED testing.
The Docker QEMU solution provides:
DockerManager.py - Docker container management utilitiesqemu_esp32_docker.py - Main Docker QEMU runner scriptqemu_test_integration.py - Integration with existing test frameworkThe QEMU runner uses the official espressif/idf:latest Docker image from Docker Hub, which includes:
No custom Dockerfiles needed - everything runs using the official Espressif image.
Run QEMU tests via test.py (recommended):
uv run test.py --qemu esp32c3 BlinkParallel
Run a firmware test with Docker directly:
uv run ci/docker_utils/qemu_esp32_docker.py path/to/firmware.bin
Run with specific timeout and interrupt pattern:
uv run ci/docker_utils/qemu_esp32_docker.py firmware.bin \
--timeout 60 \
--interrupt-regex "Test passed"
The Docker QEMU runner integrates with the existing test framework:
# Check available runners
uv run ci/docker_utils/qemu_test_integration.py check
# Run test with automatic runner selection
uv run ci/docker_utils/qemu_test_integration.py test --firmware path/to/firmware.bin
# Force Docker runner
uv run ci/docker_utils/qemu_test_integration.py test --firmware firmware.bin --docker
The QEMU runner automatically pulls and uses:
espressif/idf:latest (~11.6GB) - Official Espressif ESP-IDF Docker image
The integration module automatically selects the best available runner:
Works on:
Supports:
firmware.bin filesFIRMWARE_DIR - Directory containing firmware filesFIRMWARE_FILE - Specific firmware file to runMACHINE - ESP32 variant (esp32, esp32c3, esp32s2, esp32s3)FLASH_SIZE - Flash size in MB (default: 4)TIMEOUT - Execution timeout in seconds (default: 30)Install Docker:
sudo apt-get install docker.io or equivalentAdd user to docker group:
sudo usermod -aG docker $USER
# Log out and back in
Check internet connection and Docker Hub access. The runner will automatically try alternative images if the primary fails.
Increase timeout value:
uv run ci/docker_utils/qemu_esp32_docker.py firmware.bin --timeout 120
- name: Run QEMU Test in Docker
run: |
uv run ci/docker_utils/qemu_esp32_docker.py \
.pio/build/esp32dev/firmware.bin \
--timeout 60 \
--interrupt-regex "Setup complete"
# Install dependencies
uv pip install -r requirements.txt
# Run tests
uv run ci/docker_utils/qemu_test_integration.py test \
--firmware .pio/build/esp32dev/firmware.bin
qemu_esp32_docker.py (lines 319-331)Run interactively with extended timeout:
uv run ci/docker_utils/qemu_esp32_docker.py firmware.bin --interactive --timeout 300
Check QEMU output logs:
# Output is saved to qemu_output.log by default
cat qemu_output.log