Skip the chmod-based unreadable-sidecar tests when running as root
The Gitea runner image executes jobs as root, and chmod(0) cannot make a file unreadable for root (CAP_DAC_OVERRIDE) — the two tests failed there while passing on GitHub's non-root runner. Skipping as root keeps the scenario exercised everywhere it is constructible.
This commit is contained in:
+8
-5
@@ -9,11 +9,14 @@ worse than no alert, because one day it carries a security fix.
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- **CI's python matrix now uses uv-managed interpreters instead of
|
- **CI's python matrix is green on the self-hosted Gitea runner again.** The real
|
||||||
`actions/setup-python`**, which failed at environment setup on the self-hosted
|
failure was that the Gitea runner image executes jobs as root, and the two
|
||||||
Gitea runner (GitHub Actions was unaffected — same file, both green now). Ruff is
|
unreadable-sidecar tests build their scenario with `chmod(0)` — which cannot make
|
||||||
pinned to 0.16.1 in the same job so an upstream ruff release can't turn `main`
|
a file unreadable for root (`CAP_DAC_OVERRIDE`). Those two tests now skip as root
|
||||||
red without a code change.
|
with that reason; GitHub's non-root runner still exercises them. The matrix also
|
||||||
|
moved to uv-managed interpreters (one toolchain across both runners) and ruff is
|
||||||
|
pinned to 0.16.1 so an upstream ruff release can't turn `main` red without a code
|
||||||
|
change.
|
||||||
- **README badges point at the public GitHub mirror** (workflow status and
|
- **README badges point at the public GitHub mirror** (workflow status and
|
||||||
releases) instead of the private forge. The release badge had also been reading
|
releases) instead of the private forge. The release badge had also been reading
|
||||||
the stale Gitea v0.6.1 release instead of the current v0.7.0 on GitHub.
|
the stale Gitea v0.6.1 release instead of the current v0.7.0 on GitHub.
|
||||||
|
|||||||
@@ -1914,6 +1914,9 @@ class TestTheSnapshotRecordIsNeverLostToAnUnreadableFile:
|
|||||||
only record of a tree it had just failed to read.
|
only record of a tree it had just failed to read.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.geteuid() == 0, reason=
|
||||||
|
"chmod(0) cannot make a file unreadable for root (CAP_DAC_OVERRIDE); "
|
||||||
|
"the Gitea runner image executes jobs as root")
|
||||||
def test_an_unreadable_sidecar_raises_rather_than_reading_as_empty(self, tmp_path):
|
def test_an_unreadable_sidecar_raises_rather_than_reading_as_empty(self, tmp_path):
|
||||||
sc = tmp_path / "cloud_backup-5.snapshot"
|
sc = tmp_path / "cloud_backup-5.snapshot"
|
||||||
sc.write_text("Tap@snap\n")
|
sc.write_text("Tap@snap\n")
|
||||||
@@ -1927,6 +1930,9 @@ class TestTheSnapshotRecordIsNeverLostToAnUnreadableFile:
|
|||||||
def test_a_missing_sidecar_is_simply_empty(self, tmp_path):
|
def test_a_missing_sidecar_is_simply_empty(self, tmp_path):
|
||||||
assert tn._read_sidecar(str(tmp_path / "nope")) == []
|
assert tn._read_sidecar(str(tmp_path / "nope")) == []
|
||||||
|
|
||||||
|
@pytest.mark.skipif(os.geteuid() == 0, reason=
|
||||||
|
"chmod(0) cannot make a file unreadable for root (CAP_DAC_OVERRIDE); "
|
||||||
|
"the Gitea runner image executes jobs as root")
|
||||||
def test_cleanup_all_still_UNMOUNTS_when_a_sidecar_cannot_be_read(self, tmp_path):
|
def test_cleanup_all_still_UNMOUNTS_when_a_sidecar_cannot_be_read(self, tmp_path):
|
||||||
# cleanup_all is what recover.sh and uninstall.sh call, i.e. it runs precisely
|
# cleanup_all is what recover.sh and uninstall.sh call, i.e. it runs precisely
|
||||||
# when the box is already stuck. Its job is to get the mounts off. Aborting on
|
# when the box is already stuck. Its job is to get the mounts off. Aborting on
|
||||||
|
|||||||
Reference in New Issue
Block a user