summaryrefslogtreecommitdiff
path: root/test/system/120-load.bats
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-03-18 12:17:11 -0700
committerJhon Honce <jhonce@redhat.com>2021-03-19 09:25:12 -0700
commit417f36281129434cfa57fcaffb7f10b28b36e2e6 (patch)
tree90be7fc3ea5a614dcc889ade4477ec6483b91a89 /test/system/120-load.bats
parent5325957d536be3515fb7a782e4755afca38fca4c (diff)
downloadpodman-417f36281129434cfa57fcaffb7f10b28b36e2e6.tar.gz
podman-417f36281129434cfa57fcaffb7f10b28b36e2e6.tar.bz2
podman-417f36281129434cfa57fcaffb7f10b28b36e2e6.zip
Cleanup /libpod/images/load handler
* Remove orphaned code * Add meaningful error from LoadImageFromSingleImageArchive() when heuristic fails to determine payload format * Correct swagger to output correct types and headers Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/system/120-load.bats')
-rw-r--r--test/system/120-load.bats9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 95113c4a6..d29be462d 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -32,7 +32,7 @@ verify_iid_and_name() {
echo "I am an invalid file and should cause a podman-load error" > $invalid
run_podman 125 load -i $invalid
# podman and podman-remote emit different messages; this is a common string
- is "$output" ".*error pulling image: unable to pull .*" \
+ is "$output" ".*payload does not match any of the supported image formats .*" \
"load -i INVALID fails with expected diagnostic"
}
@@ -137,6 +137,13 @@ verify_iid_and_name() {
"Diagnostic from 'podman load' without redirection or -i"
}
+@test "podman load - redirect corrupt payload" {
+ run_podman 125 load <<< "Danger, Will Robinson!! This is a corrupt tarball!"
+ is "$output" \
+ ".*payload does not match any of the supported image formats .*" \
+ "Diagnostic from 'podman load' unknown/corrupt payload"
+}
+
@test "podman load - multi-image archive" {
img1="quay.io/libpod/testimage:00000000"
img2="quay.io/libpod/testimage:20200902"