summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-28 20:18:13 +0100
committerGitHub <noreply@github.com>2020-02-28 20:18:13 +0100
commit742093c2f27d79a76dbc45335e6f9458decff567 (patch)
tree5f630daa82eae63f999b692a79cda8affdf18d7e /test
parent05550ed848d2cbb6417af286dcee6667c0d1adee (diff)
parentb41c864d569357a102ee2335a4947e59e5e2b08a (diff)
downloadpodman-742093c2f27d79a76dbc45335e6f9458decff567.tar.gz
podman-742093c2f27d79a76dbc45335e6f9458decff567.tar.bz2
podman-742093c2f27d79a76dbc45335e6f9458decff567.zip
Merge pull request #5349 from mheon/ensure_exec_suppgroups
Ensure that exec sessions inherit supplemental groups
Diffstat (limited to 'test')
-rw-r--r--test/e2e/exec_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index ed4eb3335..ab806f683 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -1,6 +1,7 @@
package integration
import (
+ "fmt"
"os"
"strings"
@@ -244,4 +245,27 @@ var _ = Describe("Podman exec", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman exec preserves --group-add groups", func() {
+ groupName := "group1"
+ gid := "4444"
+ ctrName1 := "ctr1"
+ ctr1 := podmanTest.Podman([]string{"run", "-ti", "--name", ctrName1, fedoraMinimal, "groupadd", "-g", gid, groupName})
+ ctr1.WaitWithDefaultTimeout()
+ Expect(ctr1.ExitCode()).To(Equal(0))
+
+ imgName := "img1"
+ commit := podmanTest.Podman([]string{"commit", ctrName1, imgName})
+ commit.WaitWithDefaultTimeout()
+ Expect(commit.ExitCode()).To(Equal(0))
+
+ ctrName2 := "ctr2"
+ ctr2 := podmanTest.Podman([]string{"run", "-d", "--name", ctrName2, "--group-add", groupName, imgName, "sleep", "300"})
+ ctr2.WaitWithDefaultTimeout()
+ Expect(ctr2.ExitCode()).To(Equal(0))
+
+ exec := podmanTest.Podman([]string{"exec", "-ti", ctrName2, "id"})
+ exec.WaitWithDefaultTimeout()
+ Expect(exec.ExitCode()).To(Equal(0))
+ Expect(strings.Contains(exec.OutputToString(), fmt.Sprintf("%s(%s)", gid, groupName))).To(BeTrue())
+ })
})