summaryrefslogtreecommitdiff
path: root/test/system/030-run.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-08-13 10:12:19 -0600
committerEd Santiago <santiago@redhat.com>2019-08-14 15:14:55 -0600
commit4fb7036ca1364781373a9f1e2e7614814d96b347 (patch)
tree95f00d51f8a0644c97198cd6709a284050758bb3 /test/system/030-run.bats
parentbf9e801f1182009dcd73443755690dafdc99eeb4 (diff)
downloadpodman-4fb7036ca1364781373a9f1e2e7614814d96b347.tar.gz
podman-4fb7036ca1364781373a9f1e2e7614814d96b347.tar.bz2
podman-4fb7036ca1364781373a9f1e2e7614814d96b347.zip
tests for exit status on podman run --rm
...and on a container killed by 'podman rm -f'. See #3795 Disable when testing podman-remote; see #3808 Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r--test/system/030-run.bats13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index cefff0e2c..9e609b434 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -43,4 +43,17 @@ echo $rand | 0 | $rand
is "$output" "" "unwanted /sys/kernel in 'mount' output (with --net=host)"
}
+# 'run --rm' goes through different code paths and may lose exit status.
+# See https://github.com/containers/libpod/issues/3795
+@test "podman run --rm" {
+ skip_if_remote "podman-remote does not handle exit codes"
+
+ run_podman 0 run --rm $IMAGE /bin/true
+ run_podman 1 run --rm $IMAGE /bin/false
+
+ # Believe it or not, 'sh -c' resulted in different behavior
+ run_podman 0 run --rm $IMAGE sh -c /bin/true
+ run_podman 1 run --rm $IMAGE sh -c /bin/false
+}
+
# vim: filetype=sh