Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Follow-up to #561, part of #358.
#561 deletes scripts/test_managed_agent.py and the C-backed managed-agent classes of scripts/test_nvx_tools.py, and ports their cases to nvx-rs. The remaining cases need the real direct-mode launch, which no unprivileged test can run today:
TestSystem::spawninnvx-rs/src/guest/managed_agent/seam.rsreturnsENOSYS, so the dispatch tests stop before a workload starts.- The child's
setgroups,setegid,seteuid, andchdircalls innvx-rs/src/guest/sys/spawn.rsrun afterforkand bypass theSystemseam, so a non-root test fails atsetgroupsbefore it reaches the directory check.
The C harnesses stubbed those calls at link time and ran a setpriv shim. These cases remain to port, from ManagedAgentWorkingDirectoryTests and ManagedAgentStopTests (git show 8142d4e54~1:scripts/test_nvx_tools.py):
- Working-directory refusals. A missing directory (
ENOENT), a regular file (ENOTDIR), and a directory that the workload cannot search (EACCES) each printnvx-managed-agent: cannot enter working directory DIR: STRERRORon the workload's stderr, then answerAPP_ERROR(errno, "cwd-failed"), and run nothing. This is the guest side ofFEATURE_EXEC_CWD. - Identity failure. A
setgroupsfailure answersAPP_ERROR(125, "launch-failed")and runs nothing. - Checked directory. A symbolic link retargeted, or a directory renamed, between the check and the exec still starts the workload in the directory that was checked.
- End-to-end
PWD. The default working directory is/; a requested directory sets both the physical directory andPWD; a symbolic link keeps its name inPWD, whilelink/.gives the physical path; an exact environment controlsPWD; a layered environment keeps the agent'sPWD. - Sandbox stop. In sandbox mode,
STOPanswersSTOPPED, and the agent process then exits 0.
What is needed:
- A fork-safe, test-only way to make the identity calls in
spawn.rssucceed or fail without privileges, as the C harness's link-time stubs did. - A
setprivshim throughPaths.setprivthat can change the file system between the directory check and the exec. - A scripted or real spawn path in the dispatch test harness.
- A pseudo-terminal helper in
nvx-rs/tests/guest_tools.rsthat drives a real agent through RESET and STOP, then reaps it.
Running these tests as root in CI would avoid (1) for the success paths, but unprivileged developers would then skip them.
Metadata
Metadata
Assignees
Labels
No labels
Activity
guest: delete the replaced C programs and tests
guest: delete the replaced C programs and tests
esaurez commentedon Oct 20, 2026
#619 (A1-guest) builds its neutral spawn (G1) on the seams this issue needs, and completes these direct-launch cases. Tracked under #535.
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
nvx-rs: add a neutral guest spawn API and launch managed workloads th…
esaurez commentedon Oct 23, 2026
Moved from #619's acceptance to #816, which moves NVX's binaries and tools onto the shared libraries. #619 is complete without it.
esaurez commentedon Nov 1, 2026
Closing as not planned: in the nvx-rs slimming workstream (#1076), the managed agent's direct mode moves onto nvx-init's plain-process exec core, without its
setprivhelper (#1116), and its sandbox mode goes with the old layered init (#1123). The new core's error paths are tested on VMs as root, with no fork-safe stubs and nosetprivshim.