summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/util-linux/tests-kill.patch
blob: fa49fd414210cd15c5d8c76c7d2483765c41496b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Don't hardcode the use of /bin/kill, as this could be kill.procps.  Instead ask
the shell what kill binary to use, which will be the symlink in
/usr/lib/util-linux/ptest/bin/.

Upstream-Status: Backport [https://github.com/karelzak/util-linux/pull/1367]
Signed-off-by: Ross Burton <ross.burton@arm.com>

From e3f8a88cf688dffacb5f6033a8d24e2db40f75f6 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Tue, 29 Jun 2021 16:34:20 +0100
Subject: [PATCH] Don't hardcode /bin

---
 tests/ts/kill/all_processes  | 2 +-
 tests/ts/kill/name_to_number | 2 +-
 tests/ts/kill/options        | 2 +-
 tests/ts/kill/print_pid      | 2 +-
 tests/ts/kill/queue          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/ts/kill/all_processes b/tests/ts/kill/all_processes
index 0b137574d..b2280777f 100755
--- a/tests/ts/kill/all_processes
+++ b/tests/ts/kill/all_processes
@@ -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"
diff --git a/tests/ts/kill/name_to_number b/tests/ts/kill/name_to_number
index 9f4881cb7..8a7f4bef0 100755
--- a/tests/ts/kill/name_to_number
+++ b/tests/ts/kill/name_to_number
@@ -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"
diff --git a/tests/ts/kill/options b/tests/ts/kill/options
index 2788c70a2..10653a543 100755
--- a/tests/ts/kill/options
+++ b/tests/ts/kill/options
@@ -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"
diff --git a/tests/ts/kill/print_pid b/tests/ts/kill/print_pid
index 6926a3714..6e2db3711 100755
--- a/tests/ts/kill/print_pid
+++ b/tests/ts/kill/print_pid
@@ -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"
diff --git a/tests/ts/kill/queue b/tests/ts/kill/queue
index 18f10e8c2..6c9e9efc9 100755
--- a/tests/ts/kill/queue
+++ b/tests/ts/kill/queue
@@ -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"
-- 
2.25.1