From 5b0c3870239144ec042d37fe5b6b01bf5b339353 Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Fri, 26 Aug 2016 13:04:46 -0700 Subject: [PATCH] Make sure to use /bin/bash for exit_status_test --- tests/exit_status_test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/exit_status_test.py b/tests/exit_status_test.py index bb7be1d..8befbbf 100644 --- a/tests/exit_status_test.py +++ b/tests/exit_status_test.py @@ -1,3 +1,4 @@ +import distutils.spawn import signal 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 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() assert proc.returncode == 128 + signal