summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2023-05-04 19:30:18 +0100
committerGitHub <noreply@github.com>2023-05-04 19:30:18 +0100
commitad76c2d6ba8091a7afa95568e46af2261b362439 (patch)
treead791f1c7a578cf39001972125dbbe41a107e6dc
parentd73a78f7ef0bdb5e0a9e1f332c862d68008dec04 (diff)
parent2ba9a9af913ffdb319f9523074e4863849ba5065 (diff)
downloadbubblewrap-ad76c2d6ba8091a7afa95568e46af2261b362439.tar.gz
Merge pull request #554 from smcv/disable-userns-tests-rootHEADmain
Fix test failure since #488 when running as uid 0
-rwxr-xr-xtests/test-run.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test-run.sh b/tests/test-run.sh
index 979480e..a90f0b1 100755
--- a/tests/test-run.sh
+++ b/tests/test-run.sh
@@ -129,9 +129,18 @@ else
! $BWRAP --assert-userns-disabled --dev-bind / / -- true
$BWRAP --unshare-user --disable-userns --dev-bind / / -- true
! $BWRAP --unshare-user --disable-userns --dev-bind / / -- $BWRAP --dev-bind / / -- true
- $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 2 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --dev-bind / / -- true"
- $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 100 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --dev-bind / / -- true"
- $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "! $BWRAP --dev-bind / / --assert-userns-disabled -- true"
+ $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 2 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --unshare-user --dev-bind / / -- true"
+ $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 100 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --unshare-user --dev-bind / / -- true"
+ $BWRAP --unshare-user --disable-userns --dev-bind / / -- sh -c "! $BWRAP --unshare-user --dev-bind / / --assert-userns-disabled -- true"
+
+ $BWRAP_RECURSE --dev-bind / / -- true
+ ! $BWRAP_RECURSE --assert-userns-disabled --dev-bind / / -- true
+ $BWRAP_RECURSE --unshare-user --disable-userns --dev-bind / / -- true
+ ! $BWRAP_RECURSE --unshare-user --disable-userns --dev-bind / / -- /proc/self/exe --dev-bind / / -- true
+ $BWRAP_RECURSE --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 2 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --unshare-user --dev-bind / / -- true"
+ $BWRAP_RECURSE --unshare-user --disable-userns --dev-bind / / -- sh -c "echo 100 > /proc/sys/user/max_user_namespaces || true; ! $BWRAP --unshare-user --dev-bind / / -- true"
+ $BWRAP_RECURSE --unshare-user --disable-userns --dev-bind / / -- sh -c "! $BWRAP --unshare-user --dev-bind / / --assert-userns-disabled -- true"
+
echo "ok - can disable nested userns"
fi