mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
baseline tests: apparmor with --privileged
https://github.com/containers/libpod/issues/3112 has revealed a regression in apparmor when running privileged containers where the profile must not be set or loaded. Add a simple test to avoid potential future regressions. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -504,6 +504,16 @@ EOF
|
|||||||
echo "failed"
|
echo "failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Expected to pass (as root with --privileged).
|
||||||
|
#Note that the profile should not be loaded letting the mount succeed.
|
||||||
|
podman run --privileged docker.io/library/alpine:latest sh -c "mkdir tmp2; mount --bind tmp tmp2"
|
||||||
|
rc=$?
|
||||||
|
echo -n "root with specified AppArmor profile but --privileged: "
|
||||||
|
if [ $rc == 0 ]; then
|
||||||
|
echo "passed"
|
||||||
|
else
|
||||||
|
echo "failed"
|
||||||
|
fi
|
||||||
#Expected to fail (as rootless)
|
#Expected to fail (as rootless)
|
||||||
sudo -u "#1000" podman run --security-opt apparmor=$aaProfile docker.io/library/alpine:latest echo hello
|
sudo -u "#1000" podman run --security-opt apparmor=$aaProfile docker.io/library/alpine:latest echo hello
|
||||||
rc=$?
|
rc=$?
|
||||||
|
Reference in New Issue
Block a user