dumb-init/tests/test-exit-status

13 lines
311 B
Text
Raw Normal View History

2015-08-12 00:31:08 +03:00
#!/bin/bash -eux
dumb_init="$1"
# dumb-init should exit with the same exit status as the process it launches.
for i in $(seq 0 255); do
2015-08-10 19:32:56 +03:00
status=$($dumb_init sh -c "exit $i"; echo $?)
2015-08-10 19:32:56 +03:00
if [ "$status" -ne "$i" ]; then
echo "Error: Expected exit status $i, got $status."
exit 1
fi
done