summaryrefslogtreecommitdiff
path: root/test/e2e/import_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-23 13:15:47 +0100
committerGitHub <noreply@github.com>2022-03-23 13:15:47 +0100
commita8743d3327b9a97ea812632885492d95c816d79a (patch)
treea484397dcb515c20e1e6c62fe7a08510794e1581 /test/e2e/import_test.go
parent9d8972e0ee665325a2519eb168423d773856d563 (diff)
parenteedce31eb4aa8c0678c24cdf907ebd971ce02233 (diff)
downloadpodman-a8743d3327b9a97ea812632885492d95c816d79a.tar.gz
podman-a8743d3327b9a97ea812632885492d95c816d79a.tar.bz2
podman-a8743d3327b9a97ea812632885492d95c816d79a.zip
Merge pull request #13588 from flouthoc/import-os-arch
import: allow users to set `--os`, `--arch` and `--variant` of image imports
Diffstat (limited to 'test/e2e/import_test.go')
-rw-r--r--test/e2e/import_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go
index 884eae18e..f62df23d9 100644
--- a/test/e2e/import_test.go
+++ b/test/e2e/import_test.go
@@ -52,6 +52,26 @@ var _ = Describe("Podman import", func() {
Expect(results).Should(Exit(0))
})
+ It("podman import with custom os, arch and variant", 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).Should(Exit(0))
+
+ importImage := podmanTest.Podman([]string{"import", "--os", "testos", "--arch", "testarch", outfile, "foobar.com/imported-image:latest"})
+ importImage.WaitWithDefaultTimeout()
+ Expect(importImage).Should(Exit(0))
+
+ results := podmanTest.Podman([]string{"inspect", "--type", "image", "foobar.com/imported-image:latest"})
+ results.WaitWithDefaultTimeout()
+ Expect(results).Should(Exit(0))
+ Expect(results.OutputToString()).To(ContainSubstring("testos"))
+ Expect(results.OutputToString()).To(ContainSubstring("testarch"))
+ })
+
It("podman import without reference", func() {
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
_, ec, cid := podmanTest.RunLsContainer("")