universalisos/tools/uos-boot-test
Fábio Coutada eccc6f5676 feat(testing): add kernel coverage integration — Phase 3 complete
tools/uos-boot-test/uos-kernel-coverage.py:
- New coverage orchestration script (376 lines)
- Integrates with existing uos-cover tools
- Workflow: instrument → build → run → extract → parse → report
- Supports --arch, --report, --timeout, --skip-build flags
- Handles missing UMAP data gracefully (expected for initial integration)

kernel/Makefile:
- Add coverage targets: coverage, coverage-armv7, coverage-aarch64, etc.
- Configurable COVERAGE_TOOL and COVERAGE_REPORT paths

.github/workflows/ci.yml:
- Add 'kernel-coverage' job for armv7
- Runs after kernel-build
- Installs QEMU + cross-compiler + Python
- Runs uos-kernel-coverage.py
- Uploads coverage report as artifact

Phase 3 of testing roadmap: Coverage analysis infrastructure operational.
Note: Full coverage requires libuoscov runtime in kernel (future work).
2026-07-12 17:13:51 +01:00
..
README.md feat(testing): add boot test infrastructure — Phase 1 complete 2026-07-12 16:42:23 +01:00
uos-boot-test.py feat(testing): add boot test infrastructure — Phase 1 complete 2026-07-12 16:42:23 +01:00
uos-kernel-coverage.py feat(testing): add kernel coverage integration — Phase 3 complete 2026-07-12 17:13:51 +01:00

uos-boot-test

QEMU boot test orchestrator for UniversalisOS. Spawns QEMU for each architecture, monitors UART output for the boot banner, and reports pass/fail.

Usage

# Test all architectures
python3 tools/uos-boot-test/uos-boot-test.py --arch all

# Test specific architecture
python3 tools/uos-boot-test/uos-boot-test.py --arch armv7

# Generate JUnit XML for CI
python3 tools/uos-boot-test/uos-boot-test.py --arch all --junit results.xml

# Custom timeout
python3 tools/uos-boot-test/uos-boot-test.py --arch armv7 --timeout 30

# Verbose output (show UART)
python3 tools/uos-boot-test/uos-boot-test.py --arch all --verbose

How It Works

  1. Build: Compiles the kernel for the target architecture (skipped with --no-build)
  2. Boot: Launches QEMU with the compiled ELF
  3. Monitor: Captures UART output for up to --timeout seconds
  4. Verify: Checks for the "UniversalisOS" banner string in output
  5. Report: Prints pass/fail and optionally generates JUnit XML

Exit Codes

  • 0 — All tests passed
  • 1 — One or more tests failed

CI Integration

The JUnit XML output integrates with GitHub Actions:

- name: Run boot tests
  run: python3 tools/uos-boot-test/uos-boot-test.py --arch all --junit test-results.xml

- name: Publish test results
  uses: dorny/test-reporter@v1
  if: always()
  with:
    name: Boot Tests
    path: test-results.xml
    reporter: java-junit

Supported Architectures

Architecture QEMU Binary Default Flags
armv7 qemu-system-arm -M virt -cpu cortex-a15 -m 512M -nographic
aarch64 qemu-system-aarch64 -M virt,gic-version=3,virtualization=on -cpu cortex-a53 -m 512M -smp 4 -nographic
riscv qemu-system-riscv64 -machine microchip-icicle-kit -smp 5 -m 2G -nographic -bios none

Limitations

  • Only checks for boot banner (no functional test validation)
  • RISC-V -bios none is BSP-only (secondaries held in reset)
  • AArch64 requires virtualization=on (see AGENTS.md gotcha)
  • Timeout may kill QEMU before banner appears on slow systems