summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-18 05:23:43 -0700
committerGitHub <noreply@github.com>2019-04-18 05:23:43 -0700
commit5260d33f95c652053c7c17b18fa843915dc22322 (patch)
tree3971a17971bd4acc842de0b776843d34a8e1e7fc /test
parent8b027dee48c6ac738bd1a2ac2b0f0a3f60e82945 (diff)
parent6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4 (diff)
downloadpodman-5260d33f95c652053c7c17b18fa843915dc22322.tar.gz
podman-5260d33f95c652053c7c17b18fa843915dc22322.tar.bz2
podman-5260d33f95c652053c7c17b18fa843915dc22322.zip
Merge pull request #2952 from rhatdan/change
Fix podman command --change CMD
Diffstat (limited to 'test')
-rw-r--r--test/e2e/commit_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go
index 93e1ea7af..3ece4887e 100644
--- a/test/e2e/commit_test.go
+++ b/test/e2e/commit_test.go
@@ -117,6 +117,31 @@ var _ = Describe("Podman commit", func() {
Expect(foundBlue).To(Equal(true))
})
+ It("podman commit container with change CMD flag", func() {
+ test := podmanTest.Podman([]string{"run", "--name", "test1", "-d", ALPINE, "ls"})
+ test.WaitWithDefaultTimeout()
+ Expect(test.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainers()).To(Equal(1))
+
+ session := podmanTest.Podman([]string{"commit", "--change", "CMD a b c", "test1", "foobar.com/test1-image:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"inspect", "--format", "{{.Config.Cmd}}", "foobar.com/test1-image:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("sh -c a b c"))
+
+ session = podmanTest.Podman([]string{"commit", "--change", "CMD=[\"a\",\"b\",\"c\"]", "test1", "foobar.com/test1-image:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"inspect", "--format", "{{.Config.Cmd}}", "foobar.com/test1-image:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Not(ContainSubstring("sh -c")))
+ })
+
It("podman commit container with pause flag", func() {
_, ec, _ := podmanTest.RunLsContainer("test1")
Expect(ec).To(Equal(0))