summaryrefslogtreecommitdiff
path: root/test/e2e/exec_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-04 10:53:44 +0100
committerGitHub <noreply@github.com>2021-01-04 10:53:44 +0100
commit23f25b8261cf2c0d83f8ce5b8251951a11a7e2c4 (patch)
tree9564374473bb7b79fbd87ba318d228e905925202 /test/e2e/exec_test.go
parent142b4ac966e12559c534be380093a44d0a1d2959 (diff)
parentb3bd37b5370262a5dfd40b91e11e03dd7df543b6 (diff)
downloadpodman-23f25b8261cf2c0d83f8ce5b8251951a11a7e2c4.tar.gz
podman-23f25b8261cf2c0d83f8ce5b8251951a11a7e2c4.tar.bz2
podman-23f25b8261cf2c0d83f8ce5b8251951a11a7e2c4.zip
Merge pull request #8823 from giuseppe/exec-honor-privileged
exec: honor --privileged
Diffstat (limited to 'test/e2e/exec_test.go')
-rw-r--r--test/e2e/exec_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index f61f52589..18737105e 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -119,6 +119,21 @@ var _ = Describe("Podman exec", func() {
Expect(session.ExitCode()).To(Equal(100))
})
+ It("podman exec --privileged", func() {
+ hostCap := SystemExec("awk", []string{"/^CapEff/ { print $2 }", "/proc/self/status"})
+ Expect(hostCap.ExitCode()).To(Equal(0))
+
+ setup := podmanTest.RunTopContainer("test-privileged")
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", "--privileged", "test-privileged", "sh", "-c", "grep ^CapEff /proc/self/status | cut -f 2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ containerCapMatchesHost(session.OutputToString(), hostCap.OutputToString())
+ })
+
It("podman exec terminal doesn't hang", func() {
setup := podmanTest.Podman([]string{"run", "-dti", "--name", "test1", fedoraMinimal, "sleep", "+Inf"})
setup.WaitWithDefaultTimeout()