Skip to content

test: make the failed container write test hold when the suite runs as root - #369

Merged
ChelseaKR merged 1 commit into
mainfrom
fix/368-offload-test-as-root
Oct 17, 2026
Merged

ChelseaKR merged 1 commit into
mainfrom
fix/368-offload-test-as-root

Conversation

@ChelseaKR

Copy link
Copy Markdown
Owner

Closes #368

What and why

test_a_failed_container_write_leaves_the_sealed_original_alone made the destination read-only with chmod 0o500 and expected an OSError. Root ignores directory permission bits, so no error was raised and the test failed in root-user environments (containers, some sandboxes) although CI passes.

Instead of skipping under os.geteuid() == 0, the container's target path is now a dangling symlink into a directory that does not exist. Opening it for writing fails for every user, root included, so the same failure path is reached everywhere and the assertions that matter (original still sealed in the vault, not marked offloaded, bytes unchanged) still run for non-root. The chmod/try-finally restore is removed.

Test-only change: no behaviour, packet format, threat model, or dependency change.

Checklist

  • make lint type cov i18n doc-links markers green, run as root (per-module 95% floors met)
  • Tests updated; nothing here touches evidence, so no new tamper-detection test applies
  • No real tenant data
  • Respects the README hard rules
  • Verifier untouched
  • Conventional Commit title; commit signed off
  • No threat model, packet format, or verification protocol change (no CHANGELOG entry needed for a test-only fix)
  • Observability: N/A, test-only
  • Rollback/migration: N/A, test-only
  • ISO 25010: maintainability (testability) and portability
  • No new dependency

Generated by Claude Code

…s root

The test relied on a chmod 0o500 drive denying writes, which root ignores.
Make the container path a dangling symlink instead, so opening it for writing
fails for every user and the same ordering guarantee is asserted.

Closes #368

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqtiAsmkmDmpynCN35XTzg
Signed-off-by: Claude <noreply@anthropic.com>
@ChelseaKR
ChelseaKR merged commit 04e2ed4 into main Oct 17, 2026
12 checks passed
@ChelseaKR
ChelseaKR deleted the fix/368-offload-test-as-root branch October 17, 2026 14:51
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.

test_a_failed_container_write_leaves_the_sealed_original_alone fails when run as root

2 participants