From 49c5688a30ac29b258196d0be73cc7f09a9705cb Mon Sep 17 00:00:00 2001
From: Valentin Rothberg <rothberg@redhat.com>
Date: Tue, 21 Sep 2021 16:40:36 +0200
Subject: podman save: add `--uncompressed`

Add an option to `podman save` to allow uncompressed layers when
copying OCI images.  Do the neccessary plumbing for the remote client,
add tests and vendor in the latest commit from c/common to fetch
the neccessary changes in libimage.

Closes: #11613
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
---
 test/system/120-load.bats | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'test')

diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 97ea0f528..f2f9bf4d4 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -183,4 +183,16 @@ verify_iid_and_name() {
     run_podman rmi -f $img1 $img2
 }
 
+@test "podman save --oci-accept-uncompressed-layers" {
+    archive=$PODMAN_TMPDIR/myimage-$(random_string 8).tar
+    untar=$PODMAN_TMPDIR/myuntar-$(random_string 8)
+    mkdir -p $untar
+
+    # Create a tarball, unpack it and make sure the layers are uncompressed.
+    run_podman save -o $archive --format oci-archive --uncompressed $IMAGE
+    run tar -C $untar -xvf $archive
+    run file $untar/blobs/sha256/*
+    is "$output" ".*POSIX tar archive" "layers are uncompressed"
+}
+
 # vim: filetype=sh
-- 
cgit v1.2.3-54-g00ecf