summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-03-30 12:46:53 +0200
committerGitHub <noreply@github.com>2020-03-30 12:46:53 +0200
commit38dd7e4bb863f0035c1fcc6d27291ecea0fe103f (patch)
treea9cad0fbe481cbeb17a56ab9c4111ea88d5483c4
parent3ace81ca071bf3322dc7fefb140389b18f70fc59 (diff)
parent8b170a9a91ffaa0611f68b1fef64f881f2dadf8d (diff)
downloadbubblewrap-38dd7e4bb863f0035c1fcc6d27291ecea0fe103f.tar.gz
Merge pull request #354 from ckastner/master
tests: Update output patterns for libcap >= 2.29
-rwxr-xr-xtests/test-run.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test-run.sh b/tests/test-run.sh
index a01f41c..702c480 100755
--- a/tests/test-run.sh
+++ b/tests/test-run.sh
@@ -215,11 +215,18 @@ else
$RUN $OPT --cap-drop ALL --unshare-pid capsh --print >caps.test
assert_file_has_content caps.test 'Current: =$'
# Check for dropping kill/fowner (we assume all uid 0 callers have this)
- $RUN $OPT --cap-drop CAP_KILL --cap-drop CAP_FOWNER --unshare-pid capsh --print >caps.test
- assert_not_file_has_content caps.test '^Current: =.*cap_kill'
- assert_not_file_has_content caps.test '^Current: =.*cap_fowner'
# But we should still have net_bind_service for example
- assert_file_has_content caps.test '^Current: =.*cap_net_bind_service'
+ $RUN $OPT --cap-drop CAP_KILL --cap-drop CAP_FOWNER --unshare-pid capsh --print >caps.test
+ # capsh's output format changed from v2.29 -> drops are now indicated with -eip
+ if grep 'Current: =.*+eip$' caps.test; then
+ assert_not_file_has_content caps.test '^Current: =.*cap_kill.*+eip$'
+ assert_not_file_has_content caps.test '^Current: =.*cap_fowner.*+eip$'
+ assert_file_has_content caps.test '^Current: =.*cap_net_bind_service.*+eip$'
+ else
+ assert_file_has_content caps.test '^Current: =eip.*cap_kill.*-eip$'
+ assert_file_has_content caps.test '^Current: =eip.*cap_fowner.*-eip$'
+ assert_not_file_has_content caps.test '^Current: =.*cap_net_bind_service.*-eip$'
+ fi
echo "ok - we have the expected caps as uid 0"
fi