Skip to content

Commit

Permalink
test,push: --force-compression revert gzip with zstd
Browse files Browse the repository at this point in the history
Rawhide now defaults to `zstd:chunked` so revert test to look for gzip
after --force-compression

Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed Nov 7, 2023
1 parent 886f932 commit d11f967
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/e2e/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var _ = Describe("Podman push", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", "imageone", "localhost:5000/image"})
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--compression-format", "zstd", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())

Expand All @@ -115,31 +115,31 @@ var _ = Describe("Podman push", func() {
skopeo.WaitWithDefaultTimeout()
Expect(skopeo).Should(ExitCleanly())
output := skopeo.OutputToString()
// Default compression is gzip and push with `--force-compression=false` no traces of `zstd` should be there.
Expect(output).ToNot(ContainSubstring("zstd"))
// Original compression is zstd and push with `--force-compression=false` no traces of `gzip` should be there.
Expect(output).To(ContainSubstring("zstd"))

push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--force-compression=false", "--compression-format", "zstd", "--remove-signatures", "imageone", "localhost:5000/image"})
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--force-compression=false", "--compression-format", "gzip", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())

skopeo = SystemExec("skopeo", skopeoInspect)
skopeo.WaitWithDefaultTimeout()
Expect(skopeo).Should(ExitCleanly())
output = skopeo.OutputToString()
// Although `--compression-format` is `zstd` but still no traces of `zstd` should be in image
// since blobs must be reused from last `gzip` image.
Expect(output).ToNot(ContainSubstring("zstd"))
// Although `--compression-format` is `gzip` but still no traces of `gzip` should be in image
// since blobs must be reused from last `zstd` image.
Expect(output).To(ContainSubstring("zstd"))

push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--compression-format", "zstd", "--force-compression", "--remove-signatures", "imageone", "localhost:5000/image"})
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--compression-format", "gzip", "--force-compression", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())

skopeo = SystemExec("skopeo", skopeoInspect)
skopeo.WaitWithDefaultTimeout()
Expect(skopeo).Should(ExitCleanly())
output = skopeo.OutputToString()
// Should contain `zstd` layer, substring `zstd` is enough to confirm in skopeo inspect output that `zstd` layer is present.
Expect(output).To(ContainSubstring("zstd"))
// Should contain `gzip` layer, substring `` is enough to confirm in skopeo inspect output that `zstd` layer is present.
Expect(output).ToNot(ContainSubstring("zstd"))
})

It("podman push to local registry", func() {
Expand Down

0 comments on commit d11f967

Please sign in to comment.