Skip to content

test(cli): keep executable fixtures off noexec temp roots - #736

Merged
yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
skygunner:contrib/cli-noexec-fixtures
Sep 27, 2026
Merged

yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
skygunner:contrib/cli-noexec-fixtures

Conversation

@skygunner

Copy link
Copy Markdown
Contributor

Problem

Several WebCodex CLI tests create fake executable Runner fixtures in the system temporary directory.

On hardened Unix hosts where the ambient temporary filesystem is mounted noexec, those tests can fail before exercising CLI behavior. The Runner test suite already keeps executable fixtures on the repository build filesystem; the CLI tests should follow the same boundary while preserving /tmp for canonical-path policy tests.

Fix

Add a CLI-only executable_test_tempdir() helper rooted under target/test-executables and use it only for tests that execute a generated Runner fixture or validate generated systemd units against executable paths.

Canonical/path-policy tests continue to use canonical_test_tempdir() unchanged.

For systemd verification, include the fixture directory in SYSTEMD_UNIT_PATH so generated units can resolve one another after moving off the ambient temp root.

No production/runtime behavior changes.

Validation

  • cargo fmt --all -- --check: passed
  • git diff --check: passed
  • executable fixture smoke from target/test-executables: passed
  • systemd-analyze verify executable-path smoke: passed

Focused Cargo test discovery was blocked locally by an unrelated current-upstream compile failure in webcodex-environment/src/installer_unix.rs against the installed libc 0.2.186 (getpwuid_r expects *mut u8, current code passes *mut i8). The identical failure reproduces on an unmodified detached checkout of the same upstream/main, before any CLI test executes.

@yyjeqhc
yyjeqhc merged commit 149ccb6 into yyjeqhc:main Sep 27, 2026
15 checks passed

yyjeqhc commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Reviewed on special. The noexec fixture direction is correct, but the initial version also moved the special systemd test's ordinary WorkingDirectory under /root/.../target/test-executables, which triggered the real non-root Runner /root guard. Follow-up #739 keeps only executable stubs on the executable test filesystem while leaving ordinary working/config/env paths in the normal tempdir; the failing test passes with that adjustment. #739 has been merged.

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.

2 participants