aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-08 10:21:14 -0800
committerGitHub <noreply@github.com>2019-01-08 10:21:14 -0800
commitc9d63fe89d0a79b069b56249aaa4c168b47649c0 (patch)
treee76db2f0730eb41a0ed7785cc590dfc14bfe6929 /test
parent757906189eabbc56a3b7e9723e9f72c3ccc654b0 (diff)
parent867669374c3fdd39f2629e53cbe7430f1bc3e085 (diff)
downloadpodman-c9d63fe89d0a79b069b56249aaa4c168b47649c0.tar.gz
podman-c9d63fe89d0a79b069b56249aaa4c168b47649c0.tar.bz2
podman-c9d63fe89d0a79b069b56249aaa4c168b47649c0.zip
Merge pull request #2097 from debarshiray/wip/debarshiray/podman-exec-workdir
Add a --workdir option to 'podman exec'
Diffstat (limited to 'test')
-rw-r--r--test/e2e/exec_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index fec80717f..a181501a5 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -127,4 +127,36 @@ var _ = Describe("Podman exec", func() {
Expect(session2.ExitCode()).To(Equal(0))
Expect(session2.OutputToString()).To(Equal(testUser))
})
+
+ It("podman exec simple working directory test", func() {
+ setup := podmanTest.RunTopContainer("test1")
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", "-l", "--workdir", "/tmp", "pwd"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString("/tmp")
+ Expect(match).Should(BeTrue())
+
+ session = podmanTest.Podman([]string{"exec", "-l", "-w", "/tmp", "pwd"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ = session.GrepString("/tmp")
+ Expect(match).Should(BeTrue())
+ })
+
+ It("podman exec missing working directory test", func() {
+ setup := podmanTest.RunTopContainer("test1")
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", "-l", "--workdir", "/missing", "pwd"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(1))
+
+ session = podmanTest.Podman([]string{"exec", "-l", "-w", "/missing", "pwd"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(1))
+ })
})