diff options
author | Matthew Heon <mheon@redhat.com> | 2020-08-07 13:57:02 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-20 12:16:53 -0400 |
commit | 32f0c8f624e0400a6decf219d6fe889f12272729 (patch) | |
tree | aa74e8263d4f01c9372134866e70266fa791d19f /test | |
parent | d4c3365454d903077ece3c1a31367f639ee24900 (diff) | |
download | podman-32f0c8f624e0400a6decf219d6fe889f12272729.tar.gz podman-32f0c8f624e0400a6decf219d6fe889f12272729.tar.bz2 podman-32f0c8f624e0400a6decf219d6fe889f12272729.zip |
Do not use image CMD if user gave ENTRYPOINT
This matches Docker behavior, and seems to make sense - the CMD
may have been specific to the original entrypoint and probably
does not make sense if it was changed.
While we're in here, greatly simplify the logic for populating
the SpecGen's Command. We create the full command when making the
OCI spec, so the client should not be doing any more than setting
it to the Command the user passed in, and completely ignoring
ENTRYPOINT.
Fixes #7115
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index ef275b32e..681498ea1 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -1061,13 +1061,12 @@ USER mail` Expect(session.OutputToString()).To(ContainSubstring(limit)) }) - It("podman run makes entrypoint from image", func() { - dockerfile := `FROM busybox -WORKDIR /madethis` - podmanTest.BuildImage(dockerfile, "test", "false") - session := podmanTest.Podman([]string{"run", "--rm", "test", "pwd"}) + It("podman run --entrypoint does not use image command", func() { + session := podmanTest.Podman([]string{"run", "--entrypoint", "/bin/echo", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - Expect(session.OutputToString()).To(ContainSubstring("/madethis")) + // We can't guarantee the output is completely empty, some + // nonprintables seem to work their way in. + Expect(session.OutputToString()).To(Not(ContainSubstring("/bin/sh"))) }) }) |