test: add tests to ensure that the capabilities are properly set

This commit is contained in:
Ronny Chevalier
2015-10-29 17:14:18 +01:00
parent db27190d54
commit ff4ca461ed
5 changed files with 53 additions and 2 deletions
@@ -0,0 +1,6 @@
[Unit]
Description=Test for CapabilityBoundingSet
[Service]
ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | grep "cap_chown"); echo $c; exit $(test -z $c)'
CapabilityBoundingSet=~CAP_CHOWN
@@ -0,0 +1,7 @@
[Unit]
Description=Test for CapabilityBoundingSet
[Service]
ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_chown,cap_fowner,cap_kill")'
CapabilityBoundingSet=CAP_FOWNER
CapabilityBoundingSet=CAP_KILL CAP_CHOWN
@@ -0,0 +1,7 @@
[Unit]
Description=Test for CapabilityBoundingSet
[Service]
ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test -z $c)'
CapabilityBoundingSet=CAP_FOWNER CAP_KILL
CapabilityBoundingSet=
@@ -0,0 +1,6 @@
[Unit]
Description=Test for CapabilityBoundingSet
[Service]
ExecStart=/bin/sh -c 'c=$(capsh --print | grep "Bounding set " | cut -f 2 -d "="); echo $c; exit $(test $c = "cap_fowner,cap_kill")'
CapabilityBoundingSet=CAP_FOWNER CAP_KILL