diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-20 18:44:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-20 18:44:50 +0200 |
commit | a3c46fcaf4a6276f6648c830d550809924e679e7 (patch) | |
tree | 39b9e8f00108d4353a27a020110cf079885ae526 /test/e2e/exec_test.go | |
parent | 230faa864f8922f16a0d70c4a3454d51768e9a15 (diff) | |
parent | cc3d8da9683414bda2b650cb46a0b54ce0e6a263 (diff) | |
download | podman-a3c46fcaf4a6276f6648c830d550809924e679e7.tar.gz podman-a3c46fcaf4a6276f6648c830d550809924e679e7.tar.bz2 podman-a3c46fcaf4a6276f6648c830d550809924e679e7.zip |
Merge pull request #3858 from haircommander/exec-user
exec: run with user specified on container start
Diffstat (limited to 'test/e2e/exec_test.go')
-rw-r--r-- | test/e2e/exec_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index ac727f9bc..f3190978c 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -146,6 +146,25 @@ var _ = Describe("Podman exec", func() { Expect(session2.OutputToString()).To(Equal(testUser)) }) + It("podman exec with user from run", func() { + testUser := "guest" + setup := podmanTest.Podman([]string{"run", "--user", testUser, "-d", ALPINE, "top"}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + ctrID := setup.OutputToString() + + session := podmanTest.Podman([]string{"exec", ctrID, "whoami"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(testUser)) + + overrideUser := "root" + session = podmanTest.Podman([]string{"exec", "--user", overrideUser, ctrID, "whoami"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring(overrideUser)) + }) + It("podman exec simple working directory test", func() { setup := podmanTest.RunTopContainer("test1") setup.WaitWithDefaultTimeout() |