Make sure to use /bin/bash for exit_status_test
This commit is contained in:
parent
e1205f33f7
commit
5b0c387023
1 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import distutils.spawn
|
||||||
import signal
|
import signal
|
||||||
from subprocess import Popen
|
from subprocess import Popen
|
||||||
|
|
||||||
|
@ -26,6 +27,11 @@ def test_exit_status_terminated_by_signal(signal):
|
||||||
"""dumb-init should exit with status 128 + signal when the child process is
|
"""dumb-init should exit with status 128 + signal when the child process is
|
||||||
terminated by a signal.
|
terminated by a signal.
|
||||||
"""
|
"""
|
||||||
proc = Popen(('dumb-init', 'sh', '-c', 'kill -{0} $$'.format(signal)))
|
# We need to make sure not to use the built-in kill (if on Bash):
|
||||||
|
# https://github.com/Yelp/dumb-init/issues/115
|
||||||
|
proc = Popen(('dumb-init', 'sh', '-c', '{0} -{1} $$'.format(
|
||||||
|
distutils.spawn.find_executable('kill'),
|
||||||
|
signal,
|
||||||
|
)))
|
||||||
proc.wait()
|
proc.wait()
|
||||||
assert proc.returncode == 128 + signal
|
assert proc.returncode == 128 + signal
|
||||||
|
|
Loading…
Reference in a new issue