summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAditya R <arajan@redhat.com>2022-03-22 17:16:52 +0530
committerAditya R <arajan@redhat.com>2022-03-23 11:22:55 +0530
commiteedce31eb4aa8c0678c24cdf907ebd971ce02233 (patch)
tree0b254749304a008a3e2cc2425f0bbc7978964e2e /test
parentd0e9f28f87d4fc9e7ed8f465709db89a03b9376b (diff)
downloadpodman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.tar.gz
podman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.tar.bz2
podman-eedce31eb4aa8c0678c24cdf907ebd971ce02233.zip
import: allow users to set os, arch and variant of imports
Allows users to set `--os` , `--arch` and `--variant` of the image created from the custom import. Following is useful when user is already aware of the values which are correct for their generated rootfs Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test')
-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("")