mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
ci(test): report whether unprivileged userns is actually available
The sysctl that lifts the AppArmor restriction is best-effort, and the test runner prints per-shard aggregates only -- 'N passed, M skipped', never individual test names. So if the sysctl stopped working, the #1830 namespace test would quietly return to skipping and the log would stay green and look identical. That is the same false assurance that let a security relaxation ship behind a test which never executed. Probe it the way the test does (unprivileged, no sudo) and print the answer, so there is one greppable line of evidence per ubuntu leg. Deliberately not a gate: a runner that cannot lift the restriction should still run everything else. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
1 parent
085017ab21
commit
ac8f5b8a81
1 file changed
+11
@@ -121,6 +121,17 @@ jobs:
|
||||
run: |
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || \
|
||||
echo "could not lift the userns restriction; namespace tests will skip"
|
||||
# Then SAY whether it worked. The runner prints per-shard aggregates
|
||||
# ("N passed, M skipped") and never individual test names, so a
|
||||
# namespace test that silently returns to skipping is invisible in a
|
||||
# green log -- the same false assurance that let #1830 ship with a
|
||||
# test that never executed. This line is the evidence. Probed exactly
|
||||
# as the test does it: unprivileged, no sudo.
|
||||
if unshare -U -r true 2>/dev/null; then
|
||||
echo "CBM_USERNS_AVAILABLE=yes"
|
||||
else
|
||||
echo "CBM_USERNS_AVAILABLE=no (namespace-dependent tests will skip)"
|
||||
fi
|
||||
|
||||
- name: Install ccache (macOS)
|
||||
if: startsWith(matrix.os, 'macos')
|
||||
|
||||
Reference in new issue
Block a user