mirror of
https://github.com/containers/podman.git
synced 2025-05-28 05:08:18 +08:00
allow specification of entrypoint in the form of a slice
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1352 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
9e315518aa
commit
1a90b2fd36
@ -72,4 +72,41 @@ var _ = Describe("Podman create", func() {
|
||||
Expect(ok).To(BeTrue())
|
||||
Expect(value).To(Equal("WORLD"))
|
||||
})
|
||||
|
||||
It("podman create --entrypoint command", func() {
|
||||
session := podmanTest.Podman([]string{"create", "--entrypoint", "/bin/foobar", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
||||
|
||||
result := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{.Config.Entrypoint}}"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result.ExitCode()).To(Equal(0))
|
||||
Expect(result.OutputToString()).To(Equal("/bin/foobar"))
|
||||
})
|
||||
|
||||
It("podman create --entrypoint \"\"", func() {
|
||||
session := podmanTest.Podman([]string{"create", "--entrypoint", "", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
||||
|
||||
result := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{.Config.Entrypoint}}"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result.ExitCode()).To(Equal(0))
|
||||
Expect(result.OutputToString()).To(Equal(""))
|
||||
})
|
||||
|
||||
It("podman create --entrypoint json", func() {
|
||||
jsonString := `[ "/bin/foo", "-c"]`
|
||||
session := podmanTest.Podman([]string{"create", "--entrypoint", jsonString, ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
||||
|
||||
result := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{.Config.Entrypoint}}"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result.ExitCode()).To(Equal(0))
|
||||
Expect(result.OutputToString()).To(Equal("/bin/foo -c"))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user