[WIP] vmm_tests: use incubator to run a device assignment test#3776
[WIP] vmm_tests: use incubator to run a device assignment test#3776jstarks wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
⚠️ Not ready to approve
It contains at least one confirmed CI-breaking issue (unused import under -D warnings) plus additional correctness/robustness issues in newly added incubator and test code that should be addressed before merging.
Pull request overview
This PR adds an “incubator” execution mode to the Flowey + Petri VMM test pipeline so that selected VMM tests can run inside an emulated (QEMU TCG) environment, and introduces an ARM64/KVM device-assignment test that exercises VFIO passthrough within that incubator.
Changes:
- Add an incubator-driven nextest execution path (including resolving/building the incubator, resolving QEMU, and wiring new CI jobs/artifacts).
- Introduce capability-based test gating (
requires_capability(...)→PETRI_CAPABILITIES) so tests can self-skip when required resources aren’t provisioned. - Add an aarch64 TCG-grouped VFIO assignment test and extend test-grouping in nextest config.
File summaries
| File | Description |
|---|---|
| vmm_tests/vmm_tests/tests/tests/aarch64_exclusive.rs | Adds an aarch64 linux-direct test that assigns a VFIO disk inside the incubator environment. |
| vmm_tests/vmm_tests/Cargo.toml | Adds VFIO assigned-device resource dependency needed by the new test. |
| vmm_tests/vmm_test_macros/src/lib.rs | Extends test macros to accept requires_capability("...") and emit a Petri requirement. |
| support/mesh/mesh_remote/src/point_to_point.rs | Adds additional point-to-point mesh tests around RPC error paths and pipe transfer semantics. |
| petri/src/requirements.rs | Adds TestRequirement::Capability and env-based evaluation via PETRI_CAPABILITIES. |
| petri/incubator/src/qemu.rs | Exports PETRI_CAPABILITIES from provisioned VFIO devices and documents env behavior. |
| petri/incubator/src/profile.rs | Adds provides capability field for virtio-blk devices in incubator profiles. |
| petri/incubator/profiles/aarch64-pcie.toml | Marks the VFIO test disk as providing capability test-disk-vfio. |
| flowey/flowey_lib_hvlite/src/run_in_incubator.rs | New Flowey node to run a nextest archive inside incubator/QEMU. |
| flowey/flowey_lib_hvlite/src/resolve_openvmm_qemu.rs | New Flowey node to fetch/extract a static QEMU binary from openvmm-deps (or use local). |
| flowey/flowey_lib_hvlite/src/lib.rs | Exposes new incubator/QEMU resolver nodes in the library module list. |
| flowey/flowey_lib_hvlite/src/build_incubator.rs | Adds a Flowey node to build/publish the incubator binary (with bundled profiles). |
| flowey/flowey_lib_hvlite/src/_jobs/local_build_and_run_nextest_vmm_tests.rs | Adds --incubator support to run local VMM tests inside incubator. |
| flowey/flowey_lib_hvlite/src/_jobs/consume_and_test_nextest_vmm_tests_archive.rs | Adds CI runner path to execute the nextest archive via incubator, including share-dir preparation. |
| flowey/flowey_lib_hvlite/src/_jobs/cfg_versions.rs | Wires resolve_openvmm_qemu config to the shared versions config. |
| flowey/flowey_hvlite/src/pipelines/vmm_tests_run.rs | Adds CLI flag/target plumbing for incubator runs and a linux-aarch64-musl target option. |
| flowey/flowey_hvlite/src/pipelines/checkin_gates.rs | Adds CI artifacts + a new aarch64-linux-tcg VMM test job using incubator on x86_64 hosts. |
| ci-flowey/openvmm-pr.yaml | Regenerated Flowey CI pipeline to include new artifacts/jobs for incubator + aarch64 archive. |
| Cargo.lock | Locks the new vmm_tests dependency addition. |
| .github/workflows/openvmm-pr.yaml | Regenerated GitHub Actions workflow incorporating new incubator/aarch64-tcg job. |
| .github/workflows/openvmm-pr-release.yaml | Regenerated release workflow incorporating the incubator/aarch64-tcg job. |
| .config/nextest.toml | Adds the aarch64-tcg test group and assigns matching tests to it. |
Copilot's findings
Comments suppressed due to low confidence (1)
support/mesh/mesh_remote/src/point_to_point.rs:296
use test_with_tracing::test;is unused in this test module and will fail the workspace’s-D warningsCI setting.
use pal_async::async_test;
use pal_async::socket::PolledSocket;
use test_with_tracing::test;
use unix_socket::UnixStream;
- Files reviewed: 22/23 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
| all_jobs.push(vmm_tests_run_job.finish()); | ||
| } | ||
|
|
||
| // Emit aarch64 TCG incubator test job. |
There was a problem hiding this comment.
is the plan to have one GH job per TCG target? This seems like it could grow quickly.
There was a problem hiding this comment.
I think we could combine them without too much trouble, right?
There was a problem hiding this comment.
Yeah, but I suppose there is a tradeoff between clutter on GitHub/this file and the fact that TCG is SLOW--Realm VM inside QEMU with OpenVMM takes around 3 minutes to direct boot. We will definitely want to run them in parallel if the tests start piling up.
I'll think about it.
| // The host-side pipe endpoints should now be broken | ||
| let write_result = stdin_write.write_all(b"hello").await; | ||
| assert!(write_result.is_err(), "stdin write should fail after drop"); |
| /// The profile is a TOML file describing the emulated platform | ||
| /// (e.g., AArch64 with SMMUv3). When set, the build target is | ||
| /// automatically overridden to match the profile's architecture, | ||
| /// artifacts are cross-compiled, and tests run inside the incubator. |
| let all_tests_passed = status.success(); | ||
| let junit_xml = { | ||
| let junit_path = share_dir.join("target/nextest/ci/junit.xml"); | ||
| if junit_path.exists() { | ||
| Some(junit_path) | ||
| } else { | ||
| None | ||
| } | ||
| }; |
This adds support to flowey and petri to run tests inside an incubator instance, and it adds one test to verify device assignment inside an ARM64 KVM environment.