Repository navigation
tests: gate Linux restore-view exclusion (SL2.15) - #1457
Pedro Henrique Penna (ppenna) merged 7 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The Linux-only test is absent from the scenario inventory, causing the runner to fail before executing any scenarios; registration must be platform-aware to avoid breaking Windows.
1 open issue
What changed in this PR
Adds the Linux restore-exclusion gate for SL2.15, validating caller-owned snapshot locking before production restore work in SL2.16.
Changes:
- Exercises concurrent hard-linked restores under a caller-owned file lock.
- Checks restore failure after an unlocked link change or controller death before readiness.
- Verifies that a link change after the authenticated readiness connection still permits the full adapter lifecycle.
| File | Description |
|---|---|
tests/runtime-adapter/tests/vm_clone.rs |
Adds a Linux-only real-VM test covering four restore-exclusion cases, with synchronization and process cleanup helpers. |
Review effort: Balanced
This pull request changes existing testsIt modifies or removes 4 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests. Test code
Test data
End-to-end tests
Relocated unchanged: 0; added: 36. Compared the merge base |
d4d8927 to
1148a74
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Linux validation omits ownership and permission checks for manifest, RAM, and saved-state files in both Snapshot::open() and finish_capture(), allowing shared-permission files that violate the private-snapshot contract.
2 open issues
Review effort: Balanced
970046d to
27994d4
Compare
c6de1d8 to
aa319d6
Compare
Exercise hard-linked restore views, caller-owned exclusion, the ctime refusal, and the dead-controller/restore-ready boundary with the real runtime adapter guest. Preserve existing input-gating and disk-read regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7 Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7 Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Record helper PID/start identity before controller termination and retain native diagnostics in the captured test output before fixture cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7 Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Match existing clone launch rules: omit --restore-processors for a template whose key records all processors online without restore-time VP activation. Keep all four gate assertions unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7 Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Address the Opus review findings: prepare a complete closed capability pipe before spawn, gate the existing pre-prepare --log-file FIFO open, and hold the link helper at an stdin rendezvous until its process identity is recorded. Keep the four real-VM expectations unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3e21e47-1cf3-4e12-9b9d-31e350db64a7 Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Register the Linux-only restore exclusion gate without changing its Rust implementation. Preserve strict inventory validation, reject unknown qualifiers and duplicate scenarios before platform selection, and use the selected targets for both checking and exact execution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c02296f6-2b94-4e0f-a97a-bc5f0276b7ac Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
Keep the CLI usage reference consistent with the explicit host qualifier and shared inventory/execution selection. This changes documentation only; the reviewed registration code and all Rust tests are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c02296f6-2b94-4e0f-a97a-bc5f0276b7ac Copilot-Session: 81147aa6-5acd-4d0d-ab57-e66d34ad28e5
27994d4 to
d6b7044
Compare
5b3d539
into
feature/nvx-refactor

Part of #1103 (SL2.15), in #1076. Does not close the SL2.16/SL2.18 work in that issue.
Adds the Linux real-VM restore-exclusion gate and its platform-aware consolidated-suite registration. This sync replays only the seven owned commits from historical fork
2a0451d4ed1e27445bcd4615e7c0878c291edca5through original remote head970046d4d03517658808275c673eb9abadeeababonto already-published PR #1455 source1148a7487995e02f3a39c6cf384f5d6d825f40ce. The resulting head is27994d47a389f64ee51ae37d9b05cc4de30d471a, treeee150f1db1803556772e8d0ee21452a0a8368ab8.The selected producer's actual source lower is
8d6cbce4e649ae2dc6a9275f61541135171bd854. PR #1455's mutable base subsequently advanced toe976e5c307f396807854ebfe6cff0efb289ba754; that newer lower is not imported or qualified here. The PR's existing base branch, Draft state, labels and actual native-stack membership are preserved.Rebase onto
feature/nvx-refactor#1455 and #1453 merged, so the branch now holds only its seven own commits, rebased onto
cfdb452f29c898cd39c4691b9a12fabc14ca1bcaas48847d006a..d6b70447d5d0fd8843332a51a32e9b5884255e73(tree42a22938a69b48491420690142c8ff383df9138e).git range-diff 1148a74879..27994d47a3 cfdb452f29..d6b70447d5reports all seven patches identical, and the rebase resolved no conflicts. The inherited #1454 and #1455 commits are dropped because they landed in the base. Since the base holds #1455's third commit, which movesVmDirinto the privatehost::vm_directorybelow bothhost::snapshotandhost::vm, the known host-module cycle below no longer applies.check_test_changes.py --base origin/feature/nvx-refactorreports the same 4 changed existing test items and 36 added items as the accounting below.Rechecked on Windows at
d6b70447: the 16RuntimeAdapterSuiteTests, Ruff lint and format of both changed Python files, Pyright ofruntime_adapter_tests.pyfor Windows and Linux, and the runtime adapter's rustfmt and Clippy with-D warningsfor thehostfeature on Windows and onx86_64-unknown-linux-musl. CI runs the remaining gates, including the Linux real-VM gate.Exact owned-change preservation
The seven original commits (
89e324b8,32c63815,673f9252,32834506,7be6836f,794cafb7,970046d4) replay cleanly. Every individual source patch and the aggregate own-range patch are byte-identical; only commit ancestry and the current-session trailers change. All six final gate/runner/inventory/documentation blobs exactly match original970046.In particular,
tests/runtime-adapter/tests/vm_clone.rsremains Git blobc7e6ab682f5575003e79bcdb3451f2e110a721e1: all four gate oracles, both retained regressions, FIFO synchronization, helper rendezvous and assertions are unchanged. The entirenvx-rssubtree exactly matches selected producer1148; no production permission implementation, restore API, native source/pin, guest/kernel input, lock storage or fallback is added by this sync. Native remains14dc4116ec7e57567633c4b7b07892aca3a58522.Inherited privacy finding: fixed by adopting existing producer logic
Finding 4531202369 is valid on the old
970046/2a0451source: both APIs directly used the legacy capture validator, whose Linuxprivate_file_problemdeliberately returns no per-file refusal.Published producer
1148already fixes this at the snapshot boundary. Its existingcheck_openvmmfirst preserves legacy validation and then calls strictcheck_fileon eachmanifest.bin,memory.binandstate.bin. On Linux, that refuses a different effective UID or any mode bits in0077; bothSnapshot::openandfinish_capturecall this same boundary. Windows keeps its owner-only ACL/reparse checks. The legacy template validator and generic Linux private-file policy are unchanged.Existing regressions cover shared permissions for all artifacts through opening and finishing, including the finalizer's per-artifact
0640refusal followed by restored0600, links, FIFOs and sockets; Windows covers shared ACLs and reparse entries through both APIs. The root-only foreign-owner mutation regression remains explicitly ignored: source inspection establishes the common UID guard, not a falsely claimed privileged execution.Platform-aware inventory, already corrected before this sync
Finding 4530276205 was already addressed by original
794cafb7plus970046d4, not a second new unfixed bug.scenarios.txtacceptsTARGET TEST [linux|windows]; unqualified entries run on both. The restore-exclusion gate is explicitlylinux, matching its Rustcfg, and is excluded on Windows.Malformed lines, unknown qualifiers and global duplicate target/test pairs fail before filtering. The same selected list drives strict Cargo/libtest inventory, exact
--include-ignoredexecution and counts. Missing/unlisted tests and ignored tests in the library or unnamed targets remain errors. No discovery-based omission, suppressed failure or weakened Rust assertion is introduced.Existing-test accounting
RuntimeAdapterSuiteTests.test_scenarios_refuse_other_linesRuntimeAdapterSuiteTests.test_the_adapter_s_readme_lists_its_scenariostests/runtime-adapter/scenarios.txtread_scenariosinscripts/nvx_tools/runtime_adapter_tests.pyThree focused Python tests retain platform/order selection, identical check-only/execution/count selection and unexpected/ignored-test failures. No existing Rust test is rewritten or retired. Exact-parent accounting reports 4 existing-test asset changes and 36 added test items: the original 33 Rust items plus 3 Python tests.
Measured own delta remains 11 core lines and 1 counted non-test Python file, with the exact original 510 added Rust test lines. The complete own range touches 6 files; this sync adds no source changes beyond replaying it.
Current prepared-source checks
Both fresh private checkouts have real Git metadata and exact native source/Cargo files at
14dc4116ec7e57567633c4b7b07892aca3a58522.verifypreceded every Cargo command. Rust formatting for both crates and the adapter'scargo build --locked --features hostpassed on both hosts.cargo test --locked --lib --manifest-path nvx-rs/Cargo.toml -- host::snapshot::: 99 passed, 1 root-only ownership test ignoredpython3 scripts/nvx.py test-runtime-adapter --backend mshv --check-only: 157 scenarios / 11 targets, Linux gate includedcargo test --locked --lib --manifest-path nvx-rs\Cargo.toml -- host::snapshot::: 97 passed, 0 ignoredpython scripts\nvx.py test-runtime-adapter --backend whp --check-only: 156 scenarios / 11 targets, Linux gate excludedThese are actual prepared-source compilations, privacy-regression executions and Cargo/libtest-list inventory checks, not inherited parent receipts or mocked discovery. Check-only runs execute no VM scenario. Windows MSVC setup and all Cargo descendants ran in the same
cmd.exeenvironment; private targets/caches and fresh physical/commit-memory/disk admission were used on both hosts.At this exact head, the preserved Python
RuntimeAdapterSuiteTestspass (16 tests), along with affected-file Ruff 0.15.22 lint/format, Pyright 1.1.411 for Linux and Windows (0 type errors/warnings), targeted compileall, test layout, Markdown links and exact-parent test accounting.Known inherited quality failure: canonical
1148has a host-module dependency cycle (snapshot/captureimportsvm, whilevmimportssnapshot). The independently classified PR #1455 CI run 42913894943 failshost_modules::the_children_of_host_depend_on_one_another_without_cycleson both hosts (21 passed, 1 failed, exit 101) on the actual1148/8d6merge source, not merely because its mutable base moved. This sync preserves that exact producer subtree; it neither patches, suppresses nor allowlists the failure, and claims neither all-quality nor full-CI green. Producer repair is separate work.Original hardware proof stays bound to original
7beAll four cases passed on Linux/MSHV at original gate head
7be6836f5d9bf465588810a19bb488e8a91f5ee9, treebea48db54d9f4b32da44e20ec2e3c23a506c4469:7beThe native
artifact_openrecord and blocking--log-fileFIFO still provide the ordering boundary. The capability pipe is written/closed before spawn; the nonblocking FIFO reader stays owned until VMM reaping, and the link helper waits until its PID/start identity is recorded. No production hook, synthetic VMM or fallback is used.Both
openvmm_reads_none_of_the_host_s_input_until_the_repair_acknowledges_the_restoreanda_clone_reads_no_more_of_its_disks_than_its_root_needspassed in that same original invocation. Original hardware, software-matrix and scoped-review receipts remain historical evidence only, retained underD:\copilot\nvx-slim-1076\runs\sl215-20261110and the original handoffs.No VM/hardware scenario, KVM/WHP hardware gate, native/kernel/guest rebuild, broad matrix, MSRV or new manual logical review was run solely for this unchanged replay. No future lower/producer graph is qualified. Copilot review and full CI remain separate from these focused checks; a request's admission, pending state or Draft skip is not a verdict.
This pull request is ready for review on
feature/nvx-refactor; its review threads are answered and resolved.