Skip to content

Commit

Permalink
System Tests: Force default signal handlers
Browse files Browse the repository at this point in the history
Recommended as part of:
containers#5004

and

containers/crun#230

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich authored and snj33v committed May 31, 2020
1 parent 40744db commit d5b9524
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/system/130-kill.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ load helpers
@test "podman kill - test signal handling in containers" {
# 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)
run_podman run -d $IMAGE sh -c "for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done; echo READY; while ! test -e /stop; do sleep 0.05; done;echo DONE"
# 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 \
"for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done;
echo READY;
while ! test -e /stop; do sleep 0.05; done;
echo DONE"
cid="$output"

# Run 'logs -f' on that container, but run it in the background with
Expand Down

0 comments on commit d5b9524

Please sign in to comment.