Files
podman/test/system/032-sig-proxy.bats
Paul Holzinger 6bc52c9c5e pkg/rootless: correctly handle proxy signals on reexec
There are quite a lot of places in podman were we have some signal
handlers, most notably libpod/shutdown/handler.go.

However when we rexec we do not want any of that and just send all
signals we get down to the child obviously. So before we install our
signal handler we must first reset all others with signal.Reset().

Also while at it fix a problem were the joinUserAndMountNS() code path
would not forward signals at all. This code path is used when you have
running containers but the pause process was killed.

Fixes #16091
Given that signal handlers run in different goroutines parallel it would
explain why it flakes sometimes in CI. However to my understanding this
flake can only happen when the pause process is dead before we run the
podman command. So the question still is what kills the pause process?

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-25 16:48:15 +02:00

37 lines
917 B
Bash

#!/usr/bin/env bats
load helpers
load helpers.sig-proxy
# Each of the tests below does some setup, then invokes the helper from helpers.sig-proxy.bash.
@test "podman sigproxy test: run" {
# We're forced to use $PODMAN because run_podman cannot be backgrounded
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" &
local kidpid=$!
_test_sigproxy c_run $kidpid
}
@test "podman sigproxy test: start" {
run_podman create --name c_start $IMAGE sh -c "$SLEEPLOOP"
# See above comments regarding $PODMAN and backgrounding
$PODMAN start --attach c_start &
local kidpid=$!
_test_sigproxy c_start $kidpid
}
@test "podman sigproxy test: attach" {
run_podman run -d --name c_attach $IMAGE sh -c "$SLEEPLOOP"
# See above comments regarding $PODMAN and backgrounding
$PODMAN attach c_attach &
local kidpid=$!
_test_sigproxy c_attach $kidpid
}
# vim: filetype=sh