tests: don't hardcode /bin/kill in the kill tests

If the 'kill' test is executed with --use-system-commands, it calls
/bin/kill to avoid the shell's own kill command being invoked.

However, this doesn't work if the kill we want to test isn't in fact in
/bin.  Instead, use $(which kill) to find a kill on the PATH and call
that directly.

Signed-off-by: Ross Burton <ross.burton@arm.com>
This commit is contained in:
Ross Burton 2021-06-29 16:34:20 +01:00 committed by Karel Zak
parent 54da548e02
commit 0be381be44
5 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ ts_skip_nonroot
# make sure we do not use shell built-in command
if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then
TS_CMD_KILL="/bin/kill"
TS_CMD_KILL="$(which kill)"
fi
ts_check_test_command "$TS_CMD_KILL"

View File

@ -20,7 +20,7 @@ ts_init "$*"
# make sure we do not use shell built-in command
if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then
TS_CMD_KILL="/bin/kill"
TS_CMD_KILL="$(which kill)"
fi
ts_check_test_command "$TS_CMD_KILL"

View File

@ -20,7 +20,7 @@ ts_init "$*"
# make sure we do not use shell built-in command
if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then
TS_CMD_KILL="/bin/kill"
TS_CMD_KILL="$(which kill)"
fi
ts_check_test_command "$TS_CMD_KILL"

View File

@ -20,7 +20,7 @@ ts_init "$*"
# make sure we do not use shell built-in command
if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then
TS_CMD_KILL="/bin/kill"
TS_CMD_KILL="$(which kill)"
fi
ts_check_test_command "$TS_CMD_KILL"

View File

@ -20,7 +20,7 @@ ts_init "$*"
# make sure we do not use shell built-in command
if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then
TS_CMD_KILL="/bin/kill"
TS_CMD_KILL="$(which kill)"
fi
ts_check_test_command "$TS_CMD_KILL"