diff options
author | Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> | 2019-09-12 17:48:30 +0900 |
---|---|---|
committer | Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> | 2019-09-27 17:17:12 +0900 |
commit | 039b44ea11615f8942c674580924fb7462f13013 (patch) | |
tree | 86690cf32f5625a7a611e0a432403696d5ce7936 /test/e2e/import_test.go | |
parent | 21363a6442022fc9c6fd05e70a363915f24f27a5 (diff) | |
download | podman-039b44ea11615f8942c674580924fb7462f13013.tar.gz podman-039b44ea11615f8942c674580924fb7462f13013.tar.bz2 podman-039b44ea11615f8942c674580924fb7462f13013.zip |
new testcase for podman import --change added
Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
Diffstat (limited to 'test/e2e/import_test.go')
-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")) + }) + }) |