diff options
author | Romain Geissler <romain.geissler@amadeus.com> | 2022-07-30 12:50:57 +0000 |
---|---|---|
committer | Romain Geissler <romain.geissler@amadeus.com> | 2022-07-30 15:10:41 +0000 |
commit | 24a599fe1d8f7f9da23cf3056c4eda8bcc89e563 (patch) | |
tree | c91259ed7763a34093cbb19ff03cce5ed15d8479 /test/e2e | |
parent | fed326d8a6f8d4f7dc490099b29d51fc1754789f (diff) | |
download | podman-24a599fe1d8f7f9da23cf3056c4eda8bcc89e563.tar.gz podman-24a599fe1d8f7f9da23cf3056c4eda8bcc89e563.tar.bz2 podman-24a599fe1d8f7f9da23cf3056c4eda8bcc89e563.zip |
Add flag "--compression-format" to "podman manifest push" both in local/remote mode.
Also Fix usage of flag "--compression-format" for remote "podman image push". Fix usage of flags "--format", "--remove-signatures" in remote "podman manifest push".
Closes #15109.
Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/manifest_test.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index a7fcd1559..893210a1f 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -1,12 +1,14 @@ package integration import ( + "io/ioutil" "os" "path/filepath" "strings" podmanRegistry "github.com/containers/podman/v4/hack/podman-registry-go" . "github.com/containers/podman/v4/test/utils" + "github.com/containers/storage/pkg/archive" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gexec" @@ -292,6 +294,46 @@ var _ = Describe("Podman manifest", func() { )) }) + It("push with compression-format", func() { + SkipIfRemote("manifest push to dir not supported in remote mode") + session := podmanTest.Podman([]string{"manifest", "create", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + session = podmanTest.Podman([]string{"manifest", "add", "--all", "foo", imageList}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + dest := filepath.Join(podmanTest.TempDir, "pushed") + err := os.MkdirAll(dest, os.ModePerm) + Expect(err).To(BeNil()) + defer func() { + os.RemoveAll(dest) + }() + session = podmanTest.Podman([]string{"push", "--compression-format=zstd", "foo", "oci:" + dest}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + foundZstdFile := false + + blobsDir := filepath.Join(dest, "blobs", "sha256") + + blobs, err := ioutil.ReadDir(blobsDir) + Expect(err).To(BeNil()) + + for _, f := range blobs { + blobPath := filepath.Join(blobsDir, f.Name()) + + sourceFile, err := ioutil.ReadFile(blobPath) + Expect(err).To(BeNil()) + + compressionType := archive.DetectCompression(sourceFile) + if compressionType == archive.Zstd { + foundZstdFile = true + break + } + } + Expect(foundZstdFile).To(BeTrue()) + }) + It("authenticated push", func() { registryOptions := &podmanRegistry.Options{ Image: "docker-archive:" + imageTarPath(REGISTRY_IMAGE), |