summaryrefslogtreecommitdiff
path: root/test/system/160-volumes.bats
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-23 16:13:48 +0530
committerflouthoc <flouthoc.git@gmail.com>2021-08-26 14:14:14 +0530
commitd5507704e9de0a4c0835f66668985eaf67ab3a72 (patch)
treed0483c85300ccee5b600107580441cf26f48d350 /test/system/160-volumes.bats
parent23f9565547ae2a6b0154e6913abf7f1232f0ece0 (diff)
downloadpodman-d5507704e9de0a4c0835f66668985eaf67ab3a72.tar.gz
podman-d5507704e9de0a4c0835f66668985eaf67ab3a72.tar.bz2
podman-d5507704e9de0a4c0835f66668985eaf67ab3a72.zip
volumes: Add volume import to allow importing contents on tar into volume
Following feature makes sure that users can load contents of external tarball into the podman volumes. Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'test/system/160-volumes.bats')
-rw-r--r--test/system/160-volumes.bats16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 9a852db89..f6dc3f0af 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -186,6 +186,22 @@ EOF
}
+# Podman volume import test
+@test "podman volume import test" {
+ skip_if_remote "volumes import is not applicable on podman-remote"
+ run_podman volume create my_vol
+ run_podman run --rm -v my_vol:/data $IMAGE sh -c "echo hello >> /data/test"
+ run_podman volume create my_vol2
+ run_podman volume export my_vol --output=hello.tar
+ # we want to use `run_podman volume export my_vol` but run_podman is wrapping EOF
+ cat hello.tar | run_podman volume import my_vol2 -
+ run_podman run --rm -v my_vol2:/data $IMAGE sh -c "cat /data/test"
+ is "$output" "hello" "output from second container"
+ run_podman volume rm my_vol
+ run_podman volume rm my_vol2
+}
+
+
# Confirm that container sees the correct id
@test "podman volume with --userns=keep-id" {
is_rootless || skip "only meaningful when run rootless"