[PR #685] [MERGED] tests: two read-only-file cases skip under root (TEST-ROOT-READONLY) #727

Closed
opened 2026-11-26 20:18:51 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/685
Author: @hugo0024
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: test-root-readonly


📝 Commits (1)

  • 4e4c2b1 tests: two read-only-file cases skip under root (TEST-ROOT-READONLY)

📊 Changes

2 files changed (+4 additions, -0 deletions)

View changed files

📝 tests/test_awc_manifest.py (+2 -0)
📝 tests/test_navmesh_nodes.py (+2 -0)

📄 Description

Claimed in the coordination issue as: TEST-ROOT-READONLY

What and why

Two test cases make a file read-only (0o444) and expect the write to be refused:

  • tests/test_awc_manifest.py: ManifestTest.test_read_only_manifest_is_refused_without_staging_a_file
  • tests/test_navmesh_nodes.py: ArchiveTest.test_cli_refuses_an_unwritable_out_before_the_archives_are_read

Root ignores the file mode, so the write succeeds and both files are red whenever the tests run as root, the default user in most containers. The tools are right; the tests cannot set up their precondition.

Both cases now skip under POSIX root, with the check and the reason tests/test_image_query_probe.py and tests/test_mode_round_probe.py already use (root bypasses read-only file mode). Windows and a non-root POSIX user still run them.

In a full run of the standard-library loop as root, these were the only two cases that failed for this reason.

Tested

Ubuntu 24.04, Python 3.13.18, on main at 21625bc.

Command root, before root, after non-root, after
python -I tests/test_awc_manifest.py 23 tests, 1 failure OK (skipped=1) OK, none skipped
python -I tests/test_navmesh_nodes.py 17 tests, 1 failure OK (skipped=1) OK, none skipped
  • As a non-root user (runuser -u nobody), each of the two cases was also run by name with -v and passes.
  • python -m compileall -q make_game.py tools tests passes, and so does python -I scripts/check_no_game_data.py on the two files.
  • The standard-library loop of the stdlib-tests-linux job, as root, after the change: 478 files, 2 failing (tests/test_tool_stdout_encoding.py and tests/test_ttpf_assets.py). Both fail the same way with this change reverted, and neither reads the files changed here.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lts24qp68LkwdoVemtts4A


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/685 **Author:** [@hugo0024](https://github.com/hugo0024) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `test-root-readonly` --- ### 📝 Commits (1) - [`4e4c2b1`](https://github.com/ubiquitarianism/leonida/commit/4e4c2b15c904aecad004e62b036f153efd99efa7) tests: two read-only-file cases skip under root (TEST-ROOT-READONLY) ### 📊 Changes **2 files changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_awc_manifest.py` (+2 -0) 📝 `tests/test_navmesh_nodes.py` (+2 -0) </details> ### 📄 Description Claimed in the coordination issue as: TEST-ROOT-READONLY ### What and why Two test cases make a file read-only (`0o444`) and expect the write to be refused: - `tests/test_awc_manifest.py`: `ManifestTest.test_read_only_manifest_is_refused_without_staging_a_file` - `tests/test_navmesh_nodes.py`: `ArchiveTest.test_cli_refuses_an_unwritable_out_before_the_archives_are_read` Root ignores the file mode, so the write succeeds and both files are red whenever the tests run as root, the default user in most containers. The tools are right; the tests cannot set up their precondition. Both cases now skip under POSIX root, with the check and the reason `tests/test_image_query_probe.py` and `tests/test_mode_round_probe.py` already use (`root bypasses read-only file mode`). Windows and a non-root POSIX user still run them. In a full run of the standard-library loop as root, these were the only two cases that failed for this reason. ### Tested Ubuntu 24.04, Python 3.13.18, on `main` at 21625bc. | Command | root, before | root, after | non-root, after | |---|---|---|---| | `python -I tests/test_awc_manifest.py` | 23 tests, 1 failure | OK (skipped=1) | OK, none skipped | | `python -I tests/test_navmesh_nodes.py` | 17 tests, 1 failure | OK (skipped=1) | OK, none skipped | - As a non-root user (`runuser -u nobody`), each of the two cases was also run by name with `-v` and passes. - `python -m compileall -q make_game.py tools tests` passes, and so does `python -I scripts/check_no_game_data.py` on the two files. - The standard-library loop of the `stdlib-tests-linux` job, as root, after the change: 478 files, 2 failing (`tests/test_tool_stdout_encoding.py` and `tests/test_ttpf_assets.py`). Both fail the same way with this change reverted, and neither reads the files changed here. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Lts24qp68LkwdoVemtts4A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:51 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#727
No description provided.