This document describes the comprehensive end-to-end testing framework for PhoenixBoot.
PhoenixBoot includes a comprehensive GitHub Actions workflow that tests all major features in QEMU virtual machines. Tests run automatically on every push and pull request.
- What it tests: Basic bootability of the ESP image
- Requirements: QEMU, OVMF
- Success criteria: PhoenixGuard banner appears in serial output
- Run locally:
./pf.py test-qemu
- What it tests: SecureBoot enforcement and NuclearBoot bootloader
- Requirements: QEMU, OVMF, OpenSSL, sbsigntool, efitools
- Process:
- Generates custom SecureBoot keys (PK, KEK, db)
- Enrolls keys into OVMF firmware
- Boots with SecureBoot enabled
- Success criteria: NuclearBoot boots successfully with SecureBoot active
- Run locally:
./pf.py secure-keygen ./pf.py secure-make-auth ./pf.py secure-enroll-secureboot ./pf.py test-qemu-secure-positive
- What it tests: Strict SecureBoot verification mode
- Requirements: Same as SecureBoot test
- Success criteria: Boot succeeds with strict signature validation
- Run locally:
./pf.py test-qemu-secure-strict
- What it tests: NuclearBoot's runtime attestation and corruption detection
- Process:
- Creates a modified ESP with mismatched hash
- Boots with SecureBoot enabled
- NuclearBoot detects hash mismatch
- Success criteria: Boot fails with
PG-ATTEST=FAILmessage - Key feature: Tests the "test corruption" requirement from the issue
- Run locally:
./pf.py build-package-esp-neg-attest ./pf.py test-qemu-secure-negative-attest
- What it tests: UUEFI diagnostic application
- Requirements: QEMU, OVMF, mtools
- Process:
- Replaces BOOTX64.EFI with UUEFI.efi
- Boots and captures diagnostic output
- Success criteria: UUEFI produces serial output
- Run locally:
./pf.py test-qemu-uuefi
- What it tests: Integration with cloud-init for automated VM setup
- Requirements: QEMU, OVMF, cloud-init, genisoimage
- Process:
- Creates cloud-init configuration with username/password
- Generates cloud-init ISO
- Boots with cloud-init ISO attached
- Success criteria: PhoenixBoot boots successfully with cloud-init
- User credentials: username:
phoenixuser, password:testpass - Run locally:
./pf.py test-qemu-cloudinit
Install required dependencies on Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y \
qemu-system-x86 \
ovmf \
mtools \
dosfstools \
openssl \
sbsigntool \
efitools \
cloud-init \
cloud-image-utils \
genisoimageInstall Python dependencies:
pip install fabric lark# Basic boot test
./pf.py test-qemu
# SecureBoot tests (requires key generation first)
./pf.py secure-keygen
./pf.py secure-make-auth
./pf.py secure-enroll-secureboot
./pf.py test-qemu-secure-positive
# Corruption detection test
./pf.py build-package-esp-neg-attest
./pf.py test-qemu-secure-negative-attest
# UUEFI test
./pf.py test-qemu-uuefi
# Cloud-init test
./pf.py test-qemu-cloudinit
# Run all end-to-end tests
./pf.py test-e2e-allAll tests generate:
- Serial logs:
out/qemu/serial-*.log- Complete boot output - JUnit reports:
out/qemu/report-*.xml- Test results in JUnit format - Test artifacts: Keys, ISOs, and other test data in
out/
The workflow is defined in .github/workflows/e2e-tests.yml and includes:
- setup-and-build: Builds all artifacts once
- test-basic-boot: Tests basic boot
- test-secureboot: Tests SecureBoot enforcement
- test-secureboot-strict: Tests strict mode
- test-attestation-failure: Tests corruption detection
- test-uuefi: Tests UUEFI diagnostic tool
- test-cloud-init-integration: Tests cloud-init setup
- test-summary: Aggregates results and generates summary
- Push to
main,master, ordevelopbranches - Pull requests to these branches
- Manual trigger via workflow_dispatch
All test logs and reports are uploaded as GitHub Actions artifacts:
build-artifacts: Compiled binaries and ESP imagesbasic-boot-logs: Basic boot test logssecureboot-logs: SecureBoot test logs and keyssecureboot-strict-logs: Strict mode test logsattestation-logs: Corruption detection test logsuuefi-logs: UUEFI diagnostic logscloud-init-logs: Cloud-init integration logs
Tests look for specific markers in serial output:
PhoenixGuard: Basic boot success marker[PG-SB=OK]: SecureBoot is active[PG-ATTEST=OK]: Runtime attestation passed[PG-ATTEST=FAIL]: Runtime attestation failed (expected in negative test)[PG-BOOT=FAIL]: Boot failed due to security violationUUEFI: UUEFI diagnostic tool marker
Per the issue requirements, Xen boot tests are not included in the workflow. Xen hypervisor integration has been removed from the repository.
- "OVMF not found": Install OVMF package
- "No ESP image": Run
./pf.py build-package-espfirst - "KVM not available": Tests will run slower without KVM but should still work
- Timeout errors: Increase
PG_QEMU_TIMEOUTenvironment variable
# View serial log
cat out/qemu/serial.log
# View JUnit report
cat out/qemu/report.xml
# Check for specific markers
grep "PhoenixGuard" out/qemu/serial.log
grep "PG-ATTEST" out/qemu/serial.logTo add a new test:
- Create test script in
scripts/qemu-test-newtest.sh - Add task in
test.pf:task test-qemu-newtest describe Description of new test shell bash scripts/qemu-test-newtest.sh end - Add job in
.github/workflows/e2e-tests.yml - Update this documentation
- README.md - Main project documentation
- SECURE_BOOT.md - SecureBoot implementation details
- test.pf - Test task definitions
- .github/workflows/e2e-tests.yml - Workflow definition