diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-30 07:20:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-30 07:20:09 -0700 |
commit | 2c23729c84775113a6c2cd7593f588cc6ea4e5fa (patch) | |
tree | 6997ee622c30cc82af8aa09bb4645d8d6334c947 /test | |
parent | 150ba5edede258a3a64afdd6f58b8bf6083dc7a6 (diff) | |
parent | be9dbb47d2212c453e3c417a70d4e6d26d5107e4 (diff) | |
download | podman-2c23729c84775113a6c2cd7593f588cc6ea4e5fa.tar.gz podman-2c23729c84775113a6c2cd7593f588cc6ea4e5fa.tar.bz2 podman-2c23729c84775113a6c2cd7593f588cc6ea4e5fa.zip |
Merge pull request #4001 from kunalkushwaha/podman-import-fix
podman import syntax fix
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/import_test.go | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go index 84a91a783..979440a50 100644 --- a/test/e2e/import_test.go +++ b/test/e2e/import_test.go @@ -88,7 +88,7 @@ var _ = Describe("Podman import", func() { Expect(results.LineInOuputStartsWith("importing container test message")).To(BeTrue()) }) - It("podman import with change flag", func() { + It("podman import with change flag CMD=<path>", func() { outfile := filepath.Join(podmanTest.TempDir, "container.tar") _, ec, cid := podmanTest.RunLsContainer("") Expect(ec).To(Equal(0)) @@ -108,4 +108,44 @@ var _ = Describe("Podman import", func() { Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/bash")) }) + It("podman import with change flag CMD <path>", func() { + outfile := filepath.Join(podmanTest.TempDir, "container.tar") + _, ec, cid := podmanTest.RunLsContainer("") + Expect(ec).To(Equal(0)) + + export := podmanTest.Podman([]string{"export", "-o", outfile, cid}) + export.WaitWithDefaultTimeout() + Expect(export.ExitCode()).To(Equal(0)) + + importImage := podmanTest.Podman([]string{"import", "--change", "CMD /bin/sh", outfile, "imported-image"}) + importImage.WaitWithDefaultTimeout() + Expect(importImage.ExitCode()).To(Equal(0)) + + results := podmanTest.Podman([]string{"inspect", "imported-image"}) + results.WaitWithDefaultTimeout() + Expect(results.ExitCode()).To(Equal(0)) + imageData := results.InspectImageJSON() + Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/sh")) + }) + + It("podman import with change flag CMD [\"path\",\"path'\"", func() { + outfile := filepath.Join(podmanTest.TempDir, "container.tar") + _, ec, cid := podmanTest.RunLsContainer("") + Expect(ec).To(Equal(0)) + + export := podmanTest.Podman([]string{"export", "-o", outfile, cid}) + export.WaitWithDefaultTimeout() + Expect(export.ExitCode()).To(Equal(0)) + + importImage := podmanTest.Podman([]string{"import", "--change", "CMD [/bin/bash]", outfile, "imported-image"}) + importImage.WaitWithDefaultTimeout() + Expect(importImage.ExitCode()).To(Equal(0)) + + results := podmanTest.Podman([]string{"inspect", "imported-image"}) + results.WaitWithDefaultTimeout() + Expect(results.ExitCode()).To(Equal(0)) + imageData := results.InspectImageJSON() + Expect(imageData[0].Config.Cmd[0]).To(Equal("/bin/bash")) + }) + }) |