summaryrefslogtreecommitdiff
path: root/test/kpod_run.bats
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2017-11-03 14:46:51 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-03 20:55:10 +0000
commit098389dc3e7bbba7c266ad24c909f3a5422e2908 (patch)
tree6b060ab5edc032bf63acb37489241b788c0f9381 /test/kpod_run.bats
parent79a26cbd6dc5bff97726c4280db45362ddc83881 (diff)
downloadpodman-098389dc3e7bbba7c266ad24c909f3a5422e2908.tar.gz
podman-098389dc3e7bbba7c266ad24c909f3a5422e2908.tar.bz2
podman-098389dc3e7bbba7c266ad24c909f3a5422e2908.zip
Parse SecurityOpts
This should turn on handling of SELinux, NoNewPrivs, seccomp and Apparmor Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #15 Approved by: rhatdan
Diffstat (limited to 'test/kpod_run.bats')
-rw-r--r--test/kpod_run.bats18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/kpod_run.bats b/test/kpod_run.bats
index 4945691a7..d0cac96de 100644
--- a/test/kpod_run.bats
+++ b/test/kpod_run.bats
@@ -18,3 +18,21 @@ ALPINE="docker.io/library/alpine:latest"
echo "$output"
[ "$status" -eq 0 ]
}
+
+@test "run selinux test" {
+
+ if [ ! -e /usr/sbin/selinuxenabled ] || /usr/sbin/selinuxenabled; then
+ skip "SELinux not enabled"
+ fi
+
+ firstLabel=$(${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current)
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current
+ echo "$output"
+ [ "$status" -eq 0 ]
+ [ "$output" != "${firstLabel}" ]
+
+ run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --security-opt label:level=s0:c1,c2 ${ALPINE} cat /proc/self/attr/current | grep s0:c1,c2"
+ echo "$output"
+ [ "$status" -eq 0 ]
+
+}