summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-07-05 18:04:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-07 11:39:42 +0100
commitc1fea579f0fde4a52108056645e73236a83774dd (patch)
tree312a55904312b11a1385296400195451750e0772 /meta/recipes-core/util-linux
parentebaf733a7099a9fce3a3387d40085b51d9838c19 (diff)
downloadpoky-c1fea579f0fde4a52108056645e73236a83774dd.tar.gz
util-linux: backport test suite fixes
Backport a number of fixes so the test suite passes. (From OE-Core rev: 398b9dab8675829f3428a4f00bffcf84525e0a46) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc6
-rw-r--r--meta/recipes-core/util-linux/util-linux/tests-blkdiscard.patch31
-rw-r--r--meta/recipes-core/util-linux/util-linux/tests-eject.patch56
-rw-r--r--meta/recipes-core/util-linux/util-linux/tests-kill.patch88
-rw-r--r--meta/recipes-core/util-linux/util-linux/tests-lscpu.patch42
-rw-r--r--meta/recipes-core/util-linux/util-linux/tests-ul.patch35
6 files changed, 258 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 9d7d8a23aa..f10d911fb1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -36,5 +36,11 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
36 file://display_testname_for_subtest.patch \ 36 file://display_testname_for_subtest.patch \
37 file://avoid_parallel_tests.patch \ 37 file://avoid_parallel_tests.patch \
38 file://8a3a74160b96498d672e3652827aa7e6d7f3a120.patch \ 38 file://8a3a74160b96498d672e3652827aa7e6d7f3a120.patch \
39 file://tests-kill.patch \
40 file://tests-blkdiscard.patch \
41 file://tests-ul.patch \
42 file://tests-eject.patch \
43 file://tests-lscpu.patch \
39 " 44 "
45
40SRC_URI[sha256sum] = "bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5" 46SRC_URI[sha256sum] = "bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5"
diff --git a/meta/recipes-core/util-linux/util-linux/tests-blkdiscard.patch b/meta/recipes-core/util-linux/util-linux/tests-blkdiscard.patch
new file mode 100644
index 0000000000..34b07a4b2d
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/tests-blkdiscard.patch
@@ -0,0 +1,31 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 45fe65d934df2c938701f1c3cd3e0a6f3bdf25e6 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Tue, 29 Jun 2021 18:10:40 +0100
7Subject: [PATCH] tests/blkdiscard: check correct log file for errors
8
9When checking if the discard ioctl is supported, look in stderr not stdout.
10
11Signed-off-by: Ross Burton <ross.burton@arm.com>
12---
13 tests/ts/blkdiscard/offsets | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/tests/ts/blkdiscard/offsets b/tests/ts/blkdiscard/offsets
17index 9dddc35e2..5e724d51b 100755
18--- a/tests/ts/blkdiscard/offsets
19+++ b/tests/ts/blkdiscard/offsets
20@@ -48,7 +48,7 @@ ts_log "testing offsets with full block size"
21 run_tscmd $TS_CMD_BLKDISCARD -v $DEVICE
22 if [ "$?" != "0" ]; then
23 # Skip the rest? For example loop backing files on NFS seem unsupported.
24- grep -q "BLKDISCARD ioctl failed: Operation not supported" "$TS_OUTPUT" \
25+ grep -q "BLKDISCARD ioctl failed: Operation not supported" "$TS_ERRLOG" \
26 && ts_skip "BLKDISCARD not supported"
27 fi
28 run_tscmd $TS_CMD_BLKDISCARD -v -o 1 $DEVICE
29--
302.25.1
31
diff --git a/meta/recipes-core/util-linux/util-linux/tests-eject.patch b/meta/recipes-core/util-linux/util-linux/tests-eject.patch
new file mode 100644
index 0000000000..51e914d566
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/tests-eject.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Submitted [https://github.com/karelzak/util-linux/pull/1375]
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From dd956268ba89fc1caf83c45c3c495f34d261e0e2 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Thu, 1 Jul 2021 20:44:31 +0100
7Subject: [PATCH] test/eject: guard asan LD_PRELOAD with use-system-commands
8 check
9
10This test tries to add asan to LD_PRELOAD because the just-built eject
11will call the host /bin/umount, and apparently asan doesn't like this.
12
13However, if ldd isn't present, this fails as the path to asan is the
14error message saying that ldd isn't present.
15
16As the asan workaround is only needed when executing the binaries that
17have just been built and not the system binaries, only use it if the
18test is on the built binaries.
19
20Closes #1373.
21
22Signed-off-by: Ross Burton <ross.burton@arm.com>
23---
24 tests/ts/eject/umount | 16 +++++++++-------
25 1 file changed, 9 insertions(+), 7 deletions(-)
26
27diff --git a/tests/ts/eject/umount b/tests/ts/eject/umount
28index a829d46c0..2be281ee3 100755
29--- a/tests/ts/eject/umount
30+++ b/tests/ts/eject/umount
31@@ -60,13 +60,15 @@ function deinit_device {
32 ts_scsi_debug_rmmod
33 }
34
35-# As the eject binary execl()s an uninstrumented /bin/umount binary, we need
36-# to explicitly $LD_PRELOAD the ASan's runtime DSO, otherwise ASan will complain.
37-# Since all three utilities used by this test (eject, fdisk, mount) are just
38-# libtool wrappers, let's check the kill binary instead, which should have
39-# the needed DSO information.
40-ASAN_RT_PATH="$(ts_get_asan_rt_path "$TS_CMD_KILL")"
41-[ -n "$ASAN_RT_PATH" ] && export LD_PRELOAD="$ASAN_RT_PATH:$LD_PRELOAD"
42+if [ "$TS_USE_SYSTEM_COMMANDS" != "yes" ]; then
43+ # As the eject binary execl()s an uninstrumented /bin/umount binary, we need
44+ # to explicitly $LD_PRELOAD the ASan's runtime DSO, otherwise ASan will complain.
45+ # Since all three utilities used by this test (eject, fdisk, mount) are just
46+ # libtool wrappers, let's check the kill binary instead, which should have
47+ # the needed DSO information.
48+ ASAN_RT_PATH="$(ts_get_asan_rt_path "$TS_CMD_KILL")"
49+ [ -n "$ASAN_RT_PATH" ] && export LD_PRELOAD="$ASAN_RT_PATH:$LD_PRELOAD"
50+fi
51
52 ts_init_subtest "by-disk"
53 init_device
54--
552.25.1
56
diff --git a/meta/recipes-core/util-linux/util-linux/tests-kill.patch b/meta/recipes-core/util-linux/util-linux/tests-kill.patch
new file mode 100644
index 0000000000..fa49fd4142
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/tests-kill.patch
@@ -0,0 +1,88 @@
1Don't hardcode the use of /bin/kill, as this could be kill.procps. Instead ask
2the shell what kill binary to use, which will be the symlink in
3/usr/lib/util-linux/ptest/bin/.
4
5Upstream-Status: Backport [https://github.com/karelzak/util-linux/pull/1367]
6Signed-off-by: Ross Burton <ross.burton@arm.com>
7
8From e3f8a88cf688dffacb5f6033a8d24e2db40f75f6 Mon Sep 17 00:00:00 2001
9From: Ross Burton <ross.burton@arm.com>
10Date: Tue, 29 Jun 2021 16:34:20 +0100
11Subject: [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
21diff --git a/tests/ts/kill/all_processes b/tests/ts/kill/all_processes
22index 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"
34diff --git a/tests/ts/kill/name_to_number b/tests/ts/kill/name_to_number
35index 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"
47diff --git a/tests/ts/kill/options b/tests/ts/kill/options
48index 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"
60diff --git a/tests/ts/kill/print_pid b/tests/ts/kill/print_pid
61index 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"
73diff --git a/tests/ts/kill/queue b/tests/ts/kill/queue
74index 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--
872.25.1
88
diff --git a/meta/recipes-core/util-linux/util-linux/tests-lscpu.patch b/meta/recipes-core/util-linux/util-linux/tests-lscpu.patch
new file mode 100644
index 0000000000..36a19bd5a5
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/tests-lscpu.patch
@@ -0,0 +1,42 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From c2ca2837a27a3f1344904037ea691bfdbb288f02 Mon Sep 17 00:00:00 2001
5From: Karel Zak <kzak@redhat.com>
6Date: Fri, 2 Jul 2021 13:12:13 +0200
7Subject: [PATCH] lscpu: don't use DMI if executed with --sysroot
8
9Signed-off-by: Karel Zak <kzak@redhat.com>
10---
11 sys-utils/lscpu-arm.c | 8 +++++---
12 1 file changed, 5 insertions(+), 3 deletions(-)
13
14diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c
15index d52765f9d..c7128094c 100644
16--- a/sys-utils/lscpu-arm.c
17+++ b/sys-utils/lscpu-arm.c
18@@ -322,7 +322,8 @@ static void arm_decode(struct lscpu_cxt *cxt, struct lscpu_cputype *ct)
19
20 arm_ids_decode(ct);
21 arm_rXpY_decode(ct);
22- if (cxt->is_cluster)
23+
24+ if (!cxt->noalive && cxt->is_cluster)
25 ct->nr_socket_on_cluster = get_number_of_physical_sockets_from_dmi();
26 }
27
28@@ -330,8 +331,9 @@ static int is_cluster_arm(struct lscpu_cxt *cxt)
29 {
30 struct stat st;
31
32- if (!(strcmp(cxt->arch->name, "aarch64")) &&
33- (stat(_PATH_ACPI_PPTT, &st) < 0) && (cxt->ncputypes == 1))
34+ if (!cxt->noalive
35+ && strcmp(cxt->arch->name, "aarch64") == 0
36+ && stat(_PATH_ACPI_PPTT, &st) < 0 && cxt->ncputypes == 1)
37 return 1;
38 else
39 return 0;
40--
412.25.1
42
diff --git a/meta/recipes-core/util-linux/util-linux/tests-ul.patch b/meta/recipes-core/util-linux/util-linux/tests-ul.patch
new file mode 100644
index 0000000000..6896393105
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/tests-ul.patch
@@ -0,0 +1,35 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From b1c71f19ea404e74d36ca5b8fbb0484043cdaef3 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Wed, 30 Jun 2021 11:25:01 +0100
7Subject: [PATCH] tests: mark ul/ul as a known failure
8
9As with ul/basic, this test produces different output when ran under
10different terminals, which isn't very useful.
11
12Set TS_KNOWN_FAIL so that these problems don't cause the test to fail.
13
14Signed-off-by: Ross Burton <ross.burton@arm.com>
15---
16 tests/ts/ul/ul | 3 +++
17 1 file changed, 3 insertions(+)
18
19diff --git a/tests/ts/ul/ul b/tests/ts/ul/ul
20index b856e33db..c707658ac 100755
21--- a/tests/ts/ul/ul
22+++ b/tests/ts/ul/ul
23@@ -20,6 +20,9 @@ ts_init "$*"
24
25 ts_check_test_command "$TS_CMD_UL"
26
27+# This test provides different result on some terminals and virtual machines
28+TS_KNOWN_FAIL="yes"
29+
30 printf "a\x08ab\x5F\x08c\\n\\ttab\\f\\b\\r" |
31 $TS_CMD_UL -t xterm >> $TS_OUTPUT 2>> $TS_ERRLOG
32
33--
342.25.1
35