summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-07-08 15:17:43 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-07-11 13:06:40 +0200
commit62cdc387de982feb796af71252a3fe3d504d570c (patch)
treeddedeb03b891c61ac375adf7d9c2fac9d65b092e /test/system
parentb41e42f42b59ea3b3b91a97bf89d7898d32e0861 (diff)
downloadpodman-62cdc387de982feb796af71252a3fe3d504d570c.tar.gz
podman-62cdc387de982feb796af71252a3fe3d504d570c.tar.bz2
podman-62cdc387de982feb796af71252a3fe3d504d570c.zip
podman wait: return 0 if container never ran
Make sure to return/exit with 0 when waiting for a container that never ran. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/130-kill.bats11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/system/130-kill.bats b/test/system/130-kill.bats
index 3d800936a..7522c475d 100644
--- a/test/system/130-kill.bats
+++ b/test/system/130-kill.bats
@@ -140,4 +140,15 @@ load helpers
run_podman rm -f $random_name
}
+@test "podman wait - exit codes" {
+ random_name=$(random_string 10)
+ run_podman create --name=$random_name $IMAGE /no/such/command
+ # Container never ran -> exit code == 0
+ run_podman wait $random_name
+ # Container did not start successfully -> exit code != 0
+ run_podman 125 start $random_name
+ # FIXME(#14873): while older Podmans return 0 on wait, Docker does not.
+ run_podman wait $random_name
+}
+
# vim: filetype=sh