diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-01 21:01:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 21:01:15 +0100 |
commit | 5d91edc78d5a3a96293cbb22dae85ab8c055fcc6 (patch) | |
tree | 003258ab953a4e52551f89cb16a306453d28439a /test | |
parent | ecc663097a5791fea01e730308528d67d534e44a (diff) | |
parent | 6673ff78d3c5bba1078d9862fccadf0b7fe556fa (diff) | |
download | podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.tar.gz podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.tar.bz2 podman-5d91edc78d5a3a96293cbb22dae85ab8c055fcc6.zip |
Merge pull request #12450 from giuseppe/compression-format
podman, push: expose --compression-format
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/push_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 7038a09e8..a3b5e31bb 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -2,12 +2,14 @@ package integration import ( "fmt" + "io/ioutil" "os" "path/filepath" "strings" "github.com/containers/podman/v3/pkg/rootless" . "github.com/containers/podman/v3/test/utils" + "github.com/containers/storage/pkg/archive" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gexec" @@ -63,6 +65,36 @@ var _ = Describe("Podman push", func() { Expect(session).Should(Exit(0)) }) + It("podman push to oci with compression-format", func() { + SkipIfRemote("Remote push does not support dir transport") + bbdir := filepath.Join(podmanTest.TempDir, "busybox-oci") + session := podmanTest.Podman([]string{"push", "--compression-format=zstd", "--remove-signatures", ALPINE, + fmt.Sprintf("oci:%s", bbdir)}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + foundZstdFile := false + + blobsDir := filepath.Join(bbdir, "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("podman push to local registry", func() { SkipIfRemote("Remote does not support --digestfile or --remove-signatures") if podmanTest.Host.Arch == "ppc64le" { |