Skip to content

Add QEMU-driven integration test harness#52

Merged
bketelsen merged 1 commit intomainfrom
emdash/qemu-tests-4uq
Feb 25, 2026
Merged

Add QEMU-driven integration test harness#52
bketelsen merged 1 commit intomainfrom
emdash/qemu-tests-4uq

Conversation

@bketelsen
Copy link
Contributor

@bketelsen bketelsen commented Feb 25, 2026

Summary

  • Add a shell-based QEMU integration test harness modeled after snosi's test/ infrastructure
  • Validates full install-to-boot, /etc overlay persistence, A/B partition layout, and A/B update flows
  • No changes to nbc source code — testing enablement only
  • Bump Go version from 1.24 to 1.26 in go.mod and CI workflows

New files

File Purpose
tests/lib/vm.sh QEMU lifecycle: OVMF discovery, VM start/stop/cleanup
tests/lib/ssh.sh SSH: keypair gen, vm_ssh, vm_scp, wait_for_ssh
tests/nbc-qemu-test.sh Orchestrator: build → install → inject SSH → boot → run tests
tests/tests/01-boot.sh Guest: boot health, mounts, kernel cmdline
tests/tests/02-etc-overlay.sh Guest: /etc overlay mount, write persistence
tests/tests/03-ab-layout.sh Guest: 4 partitions, filesystem types, config.json, slot A active
tests/tests/04-update.sh Guest: nbc update, inactive root populated, config persists
.github/workflows/test-qemu.yml CI workflow (manual dispatch)

Usage

make test-qemu IMAGE=ghcr.io/frostyard/snow:latest

Requires root, KVM, and OVMF firmware.

Test plan

  • Run make test-qemu IMAGE=ghcr.io/frostyard/snow:latest locally with KVM
  • Trigger workflow_dispatch on GitHub Actions to verify CI workflow
  • Verify all 4 test tiers pass (boot, /etc overlay, A/B layout, update)

🤖 Generated with Claude Code

Shell-based test orchestrator that builds nbc, installs an image to a
virtual disk via `nbc install --via-loopback`, boots a QEMU VM, and
runs tiered guest test scripts over SSH:

- Tier 1: Boot health (systemd, mounts, kernel cmdline)
- Tier 2: /etc overlay persistence
- Tier 3: A/B partition layout validation
- Tier 4: A/B update via `nbc update`

Also includes:
- Bump Go from 1.24 to 1.26 (go.mod, CI, Dockerfile)
- Fix golangci-lint staticcheck issues
- CI workflow for manual QEMU test dispatch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bketelsen bketelsen force-pushed the emdash/qemu-tests-4uq branch from 73abfee to 9348277 Compare February 25, 2026 03:13
@bketelsen bketelsen merged commit 60a3de0 into main Feb 25, 2026
8 checks passed
@bketelsen bketelsen deleted the emdash/qemu-tests-4uq branch February 25, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant