18 lines
470 B
Text
18 lines
470 B
Text
|
#!/bin/bash -eux
|
||
|
# Spawn a zombie process, and ensure it gets reaped.
|
||
|
# This test is only useful when run on an empty container with
|
||
|
# dumb-init as PID1.
|
||
|
#
|
||
|
# We run it as the last step of the integration tests inside our Docker
|
||
|
# containers.
|
||
|
|
||
|
bash -euxc "bash -euxc 'echo i am a zombie' &" &
|
||
|
|
||
|
sleep 1
|
||
|
num_zombies=$(ps -A -o state | grep 'Z' | wc -l)
|
||
|
|
||
|
if [ "$num_zombies" -ne 0 ]; then
|
||
|
echo "Expected no zombies, but instead there were ${num_zombies}."
|
||
|
exit 1
|
||
|
fi
|