Conversation
Adds an x86_64/amd64 full-system QEMU test path mirroring the existing arm64/armhf golden-image strategy, so downstream packagers (notably NixOS, which has a read-only Nix store) can reproduce the full functional suite locally with `make provision-qemu-images` + run-tests-in-qemu.sh. - run-tests-in-qemu.sh: new amd64) case using qemu-system-x86_64 on q35 with default SeaBIOS (no OVMF dependency) and virtio-*-pci devices; header/message updates; drop stale ppc64el/riscv64 install hints. - Makefile: build-debian-amd64 alias (native build already emits the amd64 .deb) and amd64 provisioning step in provision-qemu-images. - CI: FunctionalTest-amd64 job, serialized after FunctionalTest-armhf on the shared runner; runs on PRs too via !cancelled(). SeaBIOS was chosen over OVMF because it boots the Ubuntu amd64 cloud image on q35 reliably under TCG (no KVM on the runner) without an extra firmware package. Refs #434 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The pre-flight check previously only verified the QEMU binary and printed manual install hints, forcing newcomers to read the error and hand-install packages before the "single command" workflow worked. Now the pre-flight installs the missing host prerequisites automatically on Debian/Ubuntu hosts (per-arch HOST_PKGS via apt-get, using sudo only when not already root), then falls back to a clear manual message only if that fails. Hosts without apt (e.g. NixOS, where qemu + cloud-image-utils are provided through the package manager / nix-shell) already have the binaries on PATH, so nothing is attempted there. Also checks qemu-img and cloud-localds, not just the system emulator, since provisioning needs all three. Refs #434 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The single FunctionalTest-amd64 job needed [Debian, FunctionalTest-armhf] for push serialization, but on pull_request that transitively blocked it behind the entire (skipped) arm64/armhf functional chain — which itself waits on the slow cross-arch TCG builds — so amd64 feedback on a PR was delayed by unrelated jobs. GitHub Actions `needs` is static (cannot vary by event), so split into two event-guarded variants; exactly one runs per event: - FunctionalTest-amd64 (push): needs [Debian, FunctionalTest-armhf] — keeps serialization so only one full-system QEMU VM runs at a time on the shared runner. - FunctionalTest-amd64-pr (pull_request): needs [Debian] — the armhf functional job is push-only (skipped on PRs), so there is no concurrent QEMU to serialize against; runs as soon as the native Debian build is done. Steps are duplicated because GitHub Actions has no YAML anchors, matching the copy-paste job style already used throughout this workflow. Refs #434 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an amd64 (x86_64) QEMU full-system functional-test path, mirroring the existing
arm64/armhf golden-image strategy, plus auto-installation of host QEMU prerequisites
so downstream packagers can reproduce the whole functional suite locally with no CI setup.
Closes #434.
What changed
tests/can-actually-be-used/run-tests-in-qemu.shamd64)case:qemu-system-x86_64on-M q35 -cpu max -smp 2 -m 2048,default SeaBIOS (no
-bios/OVMF),virtio-blk-pci/virtio-net-pci,PROVISION_VERSION=1.HOST_PKGS) viaapt-getwhen the emulator /qemu-img/cloud-localdsis missing, with a clearmanual fallback for non-apt hosts (e.g. NixOS). Header/usage/message updates; removed
stale ppc64el/riscv64 install hints (those QEMU functional tests were dropped earlier).
Makefile—build-debian-amd64alias (native build already emits the amd64.deb)and an
amd64step inprovision-qemu-images..github/workflows/package-with-docker-on-own-server.yml— newFunctionalTest-amd64job, serialized after
FunctionalTest-armhfon the shared runner.Why this approach
run-tests-in-qemu.shpatternalready exists and is proven; amd64 slots into it as another
caseblock. The big winfor packagers (esp. NixOS, read-only Nix store) is that
dummy_hcdis built insidethe VM, so the host never needs that out-of-tree kernel module.
q35boots the Ubuntu amd64 cloud image reliably underTCG (the runner has no KVM) and needs no extra firmware package. Verified end-to-end
(see below), so the added
ovmfdependency the issue suggested was avoided.needs: [Debian, FunctionalTest-armhf]keeps only onefull-system QEMU VM on the single shared runner at a time.
if: ${{ !cancelled() }}makes it run on PRs too (on push it waits for armhf; on a PR armhf is skipped and this
still runs after
Debian).so a newcomer hit an error and had to hand-install. It now installs them (apt hosts) or
degrades gracefully (NixOS provides qemu via nix-shell) — the "single command"
reproducibility the issue asks for.
Note on the issue text vs. reality
The issue was written against an idealized state that never landed: it referenced a
4-arch QEMU base and a
build-and-test-cross-arch.ymlfile. In the actual tree onlyarm64/armhf QEMU functional tests exist (ppc64el dropped entirely, riscv64 packaging-only),
the jobs live in
package-with-docker-on-own-server.yml, and eachcasesets its ownPROVISION_VERSIONas the first line (the CI golden-image check greps-A1 '<arch>)'forit). This PR follows the real pattern.
Testing & proof of execution
Provisioned and ran on the project CI runner (Ubuntu 22.04, TCG / no KVM):
run-tests-in-qemu.sh --provision amd64, themake provision-qemu-imagespath) built
jammy-amd64-provisioned-v1.qcow2(valid qcow2, 10.2 GiB virtual / 1.39 GiBon disk). The
dummy_hcdDKMS module built and installed cleanly inside the VM.FUNCTEST_EXIT=0, all 50 checksPASSED!— every filesystem iteration (vfat / ext4 / exfat),deny_remote/XRDPdenial + logging, OTP pad load/match/expiry, and the
pamusb-agentplug/unplug trigger("Lock event found / Unlock event found").
make test— C (cmocka), Python (pytest) and shell suites pass, except 2 evdevunit tests (
test_safe_no_helper_virtual_device_detected,test_safe_no_helper_all_eacces_inconclusive) that fail identically onmasterunderthe local GCC-13 toolchain (a
--wrap/LTO harness quirk). This PR makes nosrc/changes, so it neither causes nor addresses them; the authoritative run is the CI
Gatejob on ubuntu-22.04/GCC-11, which is green.Because
FunctionalTest-amd64now runs on PRs, this PR's own CI run will produce alinkable green amd64 functional-test job (the runner's golden image already exists).
Integration test
This change is the integration test — it extends the functional/QEMU suite to amd64.
No new config options; manpages unaffected.
Security
CI/test-harness only — no security-relevant
src/code touched. The new auto-install runssudo apt-get installon the user's host only when the QEMU tooling is missing andapt-getexists, printing exactly what it installs and falling back to a manual messageotherwise (a dev/test-harness convenience, not production/PAM code).
🤖 This PR was generated with the assistance of Claude (Claude Code). A human reviewed
and takes responsibility for every line.
I have read the rules