Skip to content

[WIP] vmm_tests: use incubator to run a device assignment test#3776

Open
jstarks wants to merge 9 commits into
microsoft:mainfrom
jstarks:tcg-split
Open

[WIP] vmm_tests: use incubator to run a device assignment test#3776
jstarks wants to merge 9 commits into
microsoft:mainfrom
jstarks:tcg-split

Conversation

@jstarks

@jstarks jstarks commented Jun 18, 2026

Copy link
Copy Markdown
Member

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.

@jstarks jstarks requested a review from a team as a code owner June 18, 2026 20:14
Copilot AI review requested due to automatic review settings June 18, 2026 20:14
@jstarks jstarks requested a review from a team as a code owner June 18, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 warnings CI 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.

Comment thread vmm_tests/vmm_tests/tests/tests/aarch64_exclusive.rs
Comment thread vmm_tests/vmm_tests/tests/tests/aarch64_exclusive.rs
Comment thread flowey/flowey_lib_hvlite/src/run_in_incubator.rs
all_jobs.push(vmm_tests_run_job.finish());
}

// Emit aarch64 TCG incubator test job.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the plan to have one GH job per TCG target? This seems like it could grow quickly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could combine them without too much trouble, right?

@will-j-wright will-j-wright Jun 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings June 19, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Comment thread vmm_tests/vmm_tests/tests/tests/aarch64_exclusive.rs
Comment on lines +440 to +442
// 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");
Comment on lines +115 to +118
/// 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.
Copilot AI review requested due to automatic review settings June 20, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 25 changed files in this pull request and generated 1 comment.

Comment on lines +164 to +172
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
}
};
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.

3 participants