summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-11-10 15:39:29 +0100
committerValentin Rothberg <rothberg@redhat.com>2021-11-10 15:43:16 +0100
commit1ef66d6d7f215c51e582bdf21b04802b705881a4 (patch)
treeb8c18c0fa378987d70c3308d344219410f3c56aa /test/system
parent5437568fcda04c2999b5fa9aad4dd07f2d3cfd67 (diff)
downloadpodman-1ef66d6d7f215c51e582bdf21b04802b705881a4.tar.gz
podman-1ef66d6d7f215c51e582bdf21b04802b705881a4.tar.bz2
podman-1ef66d6d7f215c51e582bdf21b04802b705881a4.zip
podman load: support downloading files
Support downloading files, for instance via `podman load -i server.com/image.tar`. The specified URL is downloaded in the frontend and stored as a temp file that gets passed down to the backend. Also vendor in c/common@main to use the new `pkg/download`. Fixes: #11970 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/120-load.bats20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index e9959271f..a5508b2f4 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -126,6 +126,26 @@ verify_iid_and_name() {
verify_iid_and_name $img_name
}
+@test "podman load - from URL" {
+ get_iid_and_name
+ run_podman save $img_name -o $archive
+ run_podman rmi $iid
+
+ HOST_PORT=$(random_free_port)
+ SERVER=http://127.0.0.1:$HOST_PORT
+
+ # Bind-mount the archive to a container running httpd
+ run_podman run -d --name myweb -p "$HOST_PORT:80" \
+ -v $archive:/var/www/image.tar:Z \
+ -w /var/www \
+ $IMAGE /bin/busybox-extras httpd -f -p 80
+
+ run_podman load -i $SERVER/image.tar
+ verify_iid_and_name $img_name
+
+ run_podman rm -f -t0 myweb
+}
+
@test "podman load - redirect corrupt payload" {
run_podman 125 load <<< "Danger, Will Robinson!! This is a corrupt tarball!"
is "$output" \