diff options
author | Matthew Heon <mheon@redhat.com> | 2019-11-25 19:00:11 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-12-04 18:55:30 -0500 |
commit | 001d06d7f6780797853503a2f278c49fbc6d8c5c (patch) | |
tree | c60ea2cb4eba100e96c5b684db27a1878b4b5f4e /test/e2e/import_test.go | |
parent | 4dbab37e05d7daff858a8b1b968240dcf729d35a (diff) | |
download | podman-001d06d7f6780797853503a2f278c49fbc6d8c5c.tar.gz podman-001d06d7f6780797853503a2f278c49fbc6d8c5c.tar.bz2 podman-001d06d7f6780797853503a2f278c49fbc6d8c5c.zip |
Completely rework --change parsing
The way we were trying to parse was very broken. I originally
attempted to use Buildah's Dockerfile parser here, but dealing
with it (and convincing it to accept only a limited subset, and
only one instruction at a time) was challenging, so I rewrote a
subset of Dockerfile parsing. This should handle most common
cases well, though there are definitely unhandled edge cases for
ENV and LABEL.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e/import_test.go')
-rw-r--r-- | test/e2e/import_test.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go index 979440a50..bceb30f7c 100644 --- a/test/e2e/import_test.go +++ b/test/e2e/import_test.go @@ -105,7 +105,9 @@ var _ = Describe("Podman import", func() { results.WaitWithDefaultTimeout() Expect(results.ExitCode()).To(Equal(0)) imageData := results.InspectImageJSON() - Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/bash")) + Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/sh")) + Expect(imageData[0].Config.Cmd[1]).To(Equal("-c")) + Expect(imageData[0].Config.Cmd[2]).To(Equal("/bin/bash")) }) It("podman import with change flag CMD <path>", func() { @@ -126,6 +128,8 @@ var _ = Describe("Podman import", func() { Expect(results.ExitCode()).To(Equal(0)) imageData := results.InspectImageJSON() Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/sh")) + Expect(imageData[0].Config.Cmd[1]).To(Equal("-c")) + Expect(imageData[0].Config.Cmd[2]).To(Equal("/bin/sh")) }) It("podman import with change flag CMD [\"path\",\"path'\"", func() { @@ -137,7 +141,7 @@ var _ = Describe("Podman import", func() { export.WaitWithDefaultTimeout() Expect(export.ExitCode()).To(Equal(0)) - importImage := podmanTest.Podman([]string{"import", "--change", "CMD [/bin/bash]", outfile, "imported-image"}) + importImage := podmanTest.Podman([]string{"import", "--change", "CMD [\"/bin/bash\"]", outfile, "imported-image"}) importImage.WaitWithDefaultTimeout() Expect(importImage.ExitCode()).To(Equal(0)) |