Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 1 | Don't hardcode the use of /bin/kill, as this could be kill.procps. Instead ask |
| 2 | the shell what kill binary to use, which will be the symlink in |
| 3 | /usr/lib/util-linux/ptest/bin/. |
| 4 | |
| 5 | Upstream-Status: Backport [https://github.com/karelzak/util-linux/pull/1367] |
| 6 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 7 | |
| 8 | From e3f8a88cf688dffacb5f6033a8d24e2db40f75f6 Mon Sep 17 00:00:00 2001 |
| 9 | From: Ross Burton <ross.burton@arm.com> |
| 10 | Date: Tue, 29 Jun 2021 16:34:20 +0100 |
| 11 | Subject: [PATCH] Don't hardcode /bin |
| 12 | |
| 13 | --- |
| 14 | tests/ts/kill/all_processes | 2 +- |
| 15 | tests/ts/kill/name_to_number | 2 +- |
| 16 | tests/ts/kill/options | 2 +- |
| 17 | tests/ts/kill/print_pid | 2 +- |
| 18 | tests/ts/kill/queue | 2 +- |
| 19 | 5 files changed, 5 insertions(+), 5 deletions(-) |
| 20 | |
| 21 | diff --git a/tests/ts/kill/all_processes b/tests/ts/kill/all_processes |
| 22 | index 0b137574d..b2280777f 100755 |
| 23 | --- a/tests/ts/kill/all_processes |
| 24 | +++ b/tests/ts/kill/all_processes |
| 25 | @@ -22,7 +22,7 @@ ts_skip_nonroot |
| 26 | |
| 27 | # make sure we do not use shell built-in command |
| 28 | if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then |
| 29 | - TS_CMD_KILL="/bin/kill" |
| 30 | + TS_CMD_KILL="$(which kill)" |
| 31 | fi |
| 32 | |
| 33 | ts_check_test_command "$TS_CMD_KILL" |
| 34 | diff --git a/tests/ts/kill/name_to_number b/tests/ts/kill/name_to_number |
| 35 | index 9f4881cb7..8a7f4bef0 100755 |
| 36 | --- a/tests/ts/kill/name_to_number |
| 37 | +++ b/tests/ts/kill/name_to_number |
| 38 | @@ -20,7 +20,7 @@ ts_init "$*" |
| 39 | |
| 40 | # make sure we do not use shell built-in command |
| 41 | if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then |
| 42 | - TS_CMD_KILL="/bin/kill" |
| 43 | + TS_CMD_KILL="$(which kill)" |
| 44 | fi |
| 45 | |
| 46 | ts_check_test_command "$TS_CMD_KILL" |
| 47 | diff --git a/tests/ts/kill/options b/tests/ts/kill/options |
| 48 | index 2788c70a2..10653a543 100755 |
| 49 | --- a/tests/ts/kill/options |
| 50 | +++ b/tests/ts/kill/options |
| 51 | @@ -20,7 +20,7 @@ ts_init "$*" |
| 52 | |
| 53 | # make sure we do not use shell built-in command |
| 54 | if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then |
| 55 | - TS_CMD_KILL="/bin/kill" |
| 56 | + TS_CMD_KILL="$(which kill)" |
| 57 | fi |
| 58 | |
| 59 | ts_check_test_command "$TS_CMD_KILL" |
| 60 | diff --git a/tests/ts/kill/print_pid b/tests/ts/kill/print_pid |
| 61 | index 6926a3714..6e2db3711 100755 |
| 62 | --- a/tests/ts/kill/print_pid |
| 63 | +++ b/tests/ts/kill/print_pid |
| 64 | @@ -20,7 +20,7 @@ ts_init "$*" |
| 65 | |
| 66 | # make sure we do not use shell built-in command |
| 67 | if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then |
| 68 | - TS_CMD_KILL="/bin/kill" |
| 69 | + TS_CMD_KILL="$(which kill)" |
| 70 | fi |
| 71 | |
| 72 | ts_check_test_command "$TS_CMD_KILL" |
| 73 | diff --git a/tests/ts/kill/queue b/tests/ts/kill/queue |
| 74 | index 18f10e8c2..6c9e9efc9 100755 |
| 75 | --- a/tests/ts/kill/queue |
| 76 | +++ b/tests/ts/kill/queue |
| 77 | @@ -20,7 +20,7 @@ ts_init "$*" |
| 78 | |
| 79 | # make sure we do not use shell built-in command |
| 80 | if [ "$TS_USE_SYSTEM_COMMANDS" == "yes" ]; then |
| 81 | - TS_CMD_KILL="/bin/kill" |
| 82 | + TS_CMD_KILL="$(which kill)" |
| 83 | fi |
| 84 | |
| 85 | ts_check_test_command "$TS_CMD_KILL" |
| 86 | -- |
| 87 | 2.25.1 |
| 88 | |