summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-27 11:21:35 +0100
committerGitHub <noreply@github.com>2020-02-27 11:21:35 +0100
commit2f5d0d899c835c9eb15359a623583944b31832ff (patch)
tree7a35d18f75e6e98f084a22d925a8bf23630ea2a1
parent19016f3cd88794990fb4290ea72bbfb08118235c (diff)
parent40470b45d325df0228640201107584e565ea9752 (diff)
downloadpodman-2f5d0d899c835c9eb15359a623583944b31832ff.tar.gz
podman-2f5d0d899c835c9eb15359a623583944b31832ff.tar.bz2
podman-2f5d0d899c835c9eb15359a623583944b31832ff.zip
Merge pull request #5334 from edsantiago/bats
kill test: clean up warnings; document better
-rw-r--r--test/system/130-kill.bats23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/system/130-kill.bats b/test/system/130-kill.bats
index 8085b171e..7c2b9bed8 100644
--- a/test/system/130-kill.bats
+++ b/test/system/130-kill.bats
@@ -6,12 +6,23 @@
load helpers
@test "podman kill - test signal handling in containers" {
+ # podman-remote and crun interact poorly in f31: crun seems to gobble up
+ # some signals.
+ # Workaround: run 'env --default-signal sh' instead of just 'sh' in
+ # the container. Since env on our regular alpine image doesn't support
+ # that flag, we need to pull fedora-minimal. See:
+ # https://github.com/containers/libpod/issues/5004
+ # FIXME: remove this kludge once we get rid of podman-remote
+ local _image=$IMAGE
+ local _sh_cmd="sh"
+ if is_remote; then
+ _image=quay.io/libpod/fedora-minimal:latest
+ _sh_cmd="env --default-signal sh"
+ fi
+
# Start a container that will handle all signals by emitting 'got: N'
local -a signals=(1 2 3 4 5 6 8 10 12 13 14 15 16 20 21 22 23 24 25 26 64)
- # The --default-signal option not available in busybox implementation of 'env' in $IMAGE
- # needed here to ensure handling of SIGINT inside container uses the default handler
- _IMAGE=quay.io/libpod/fedora-minimal:latest
- run_podman run -d $_IMAGE env --default-signal sh -c \
+ run_podman run -d $_image $_sh_cmd -c \
"for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done;
echo READY;
while ! test -e /stop; do sleep 0.05; done;
@@ -70,6 +81,10 @@ load helpers
run_podman wait $cid
run_podman rm $cid
wait $podman_log_pid
+
+ if [[ $_image != $IMAGE ]]; then
+ run_podman rmi $_image
+ fi
}
@test "podman kill - rejects invalid args" {