summaryrefslogtreecommitdiff
path: root/test/system/120-load.bats
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-03-09 11:53:50 +0100
committerValentin Rothberg <rothberg@redhat.com>2021-03-09 11:53:50 +0100
commit930bec4d3a7cfe83784ded58e5f8f88d062dd3e2 (patch)
treee7d610faea82090a3049001a39045d7fb486efa4 /test/system/120-load.bats
parent36ec835298d0e33a2f783ceaf4ed19a3b62075f7 (diff)
downloadpodman-930bec4d3a7cfe83784ded58e5f8f88d062dd3e2.tar.gz
podman-930bec4d3a7cfe83784ded58e5f8f88d062dd3e2.tar.bz2
podman-930bec4d3a7cfe83784ded58e5f8f88d062dd3e2.zip
podman load: fix error handling
Make sure to properly return loading errors and to set the exit code accordingly. Fixes: #9672 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/system/120-load.bats')
-rw-r--r--test/system/120-load.bats7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 902cd9f5e..936449bdb 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -26,6 +26,13 @@ verify_iid_and_name() {
is "$new_img_name" "$1" "Name & tag of restored image"
}
+@test "podman load invalid file" {
+ # Regression test for #9672 to make sure invalid input yields errors.
+ invalid=$PODMAN_TMPDIR/invalid
+ echo "I am an invalid file and should cause a podman-load error" > $invalid
+ run_podman 125 load -i $invalid
+}
+
@test "podman save to pipe and load" {
# Generate a random name and tag (must be lower-case)
local random_name=x0$(random_string 12 | tr A-Z a-z)