summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-11-02 14:26:30 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-11-02 14:36:39 +0100
commitbce8f851c1e891aa6159e61c56ccd712b60c31b7 (patch)
tree09931f52e6af1aceea6c1221b10949df8be45dc6 /test
parentc1ffdfbd7883d45f864c74a4a07cf9ff80b4018f (diff)
downloadpodman-bce8f851c1e891aa6159e61c56ccd712b60c31b7.tar.gz
podman-bce8f851c1e891aa6159e61c56ccd712b60c31b7.tar.bz2
podman-bce8f851c1e891aa6159e61c56ccd712b60c31b7.zip
specgen: add support for ambient capabilities
if the kernel supports ambient capabilities (Linux 4.3+), also set them when running with euid != 0. This is different that what Moby does, as ambient capabilities are never set. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index e6bba9f67..010d7aaae 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -315,6 +315,21 @@ var _ = Describe("Podman run", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("00000000a80425fb"))
+
+ session = podmanTest.Podman([]string{"run", "--user=1000:1000", "--cap-add=DAC_OVERRIDE", "--rm", ALPINE, "grep", "CapAmb", "/proc/self/status"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("0000000000000002"))
+
+ session = podmanTest.Podman([]string{"run", "--user=1000:1000", "--rm", ALPINE, "grep", "CapAmb", "/proc/self/status"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("0000000000000000"))
+
+ session = podmanTest.Podman([]string{"run", "--user=0", "--cap-add=DAC_OVERRIDE", "--rm", ALPINE, "grep", "CapAmb", "/proc/self/status"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("0000000000000000"))
})
It("podman run user capabilities test with image", func() {