summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp
diff options
context:
space:
mode:
authorPetr Vorel <petr.vorel@gmail.com>2020-02-29 17:51:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-02 16:16:27 +0000
commita37dba3063256ef4852522a1b1035a10bcd9860d (patch)
tree77eb57ce9e5b27825b040c791774f542531545ba /meta/recipes-extended/ltp
parentfecd65625ec6fb9a7879cfa18eab95d2b1dda2ff (diff)
downloadpoky-a37dba3063256ef4852522a1b1035a10bcd9860d.tar.gz
ltp: Update to 20200120
Removed ffsb copying file and associated runtest file fs_ext4 (both removed in this release). Added LIBS=-lfts for MUSL. Removed patches (accepted upstream) * 0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch * 0001-testcases-fix-an-absent-format-string-issue.patch * 0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch Merged patches * 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch (into 0001-build-Add-option-to-select-libc-implementation.patch as they touch the same files) Refreshed patches (some tests have been fixed for musl) * 0001-Add-more-musl-exclusions.patch * 0001-build-Add-option-to-select-libc-implementation.patch * 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch IMHO this one shouldn't be needed not, but CI still fails without it Updated status * 0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch * 0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch (From OE-Core rev: 62e2063698477a13c55ae370451e52a2f1e18e45) Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ltp')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch36
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch102
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch35
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch43
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch40
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch24
-rw-r--r--meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch47
-rw-r--r--meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch35
-rw-r--r--meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch27
-rw-r--r--meta/recipes-extended/ltp/ltp_20200120.bb (renamed from meta/recipes-extended/ltp/ltp_20190930.bb)9
10 files changed, 78 insertions, 320 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch b/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch
index d3af31f34a..02c2fef55b 100644
--- a/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch
@@ -5,12 +5,12 @@ Subject: [PATCH] Add more musl exclusions
5 5
6Upstream-Status: Pending 6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8[ pvorel: rebase for 20200120: enable fanotify13, fanotify15, setxattr03 ]
9Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
8--- 10---
9 testcases/kernel/syscalls/accept4/Makefile | 4 ++++ 11 testcases/kernel/syscalls/accept4/Makefile | 4 ++++
10 testcases/kernel/syscalls/fanotify/Makefile | 6 ++++++
11 testcases/kernel/syscalls/setxattr/Makefile | 4 ++++
12 testcases/kernel/syscalls/timer_create/Makefile | 4 ++++ 12 testcases/kernel/syscalls/timer_create/Makefile | 4 ++++
13 4 files changed, 18 insertions(+) 13 2 files changed, 8 insertions(+)
14 14
15diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile 15diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile
16index 504042e11..94db06266 100644 16index 504042e11..94db06266 100644
@@ -25,34 +25,6 @@ index 504042e11..94db06266 100644
25+endif 25+endif
26+ 26+
27 include $(top_srcdir)/include/mk/generic_leaf_target.mk 27 include $(top_srcdir)/include/mk/generic_leaf_target.mk
28diff --git a/testcases/kernel/syscalls/fanotify/Makefile b/testcases/kernel/syscalls/fanotify/Makefile
29index 5d01b4825..0263a6e20 100644
30--- a/testcases/kernel/syscalls/fanotify/Makefile
31+++ b/testcases/kernel/syscalls/fanotify/Makefile
32@@ -20,4 +20,10 @@ top_srcdir ?= ../../../..
33 fanotify11: CFLAGS+=-pthread
34 include $(top_srcdir)/include/mk/testcases.mk
35
36+ifeq ($(LIBC),musl)
37+FILTER_OUT_MAKE_TARGETS := fanotify13 fanotify15
38+endif
39+
40 include $(top_srcdir)/include/mk/generic_leaf_target.mk
41+
42+
43diff --git a/testcases/kernel/syscalls/setxattr/Makefile b/testcases/kernel/syscalls/setxattr/Makefile
44index 72544c13e..7f20b2780 100644
45--- a/testcases/kernel/syscalls/setxattr/Makefile
46+++ b/testcases/kernel/syscalls/setxattr/Makefile
47@@ -20,4 +20,8 @@ top_srcdir ?= ../../../..
48
49 include $(top_srcdir)/include/mk/testcases.mk
50
51+ifeq ($(LIBC),musl)
52+FILTER_OUT_MAKE_TARGETS := setxattr03
53+endif
54+
55 include $(top_srcdir)/include/mk/generic_leaf_target.mk
56diff --git a/testcases/kernel/syscalls/timer_create/Makefile b/testcases/kernel/syscalls/timer_create/Makefile 28diff --git a/testcases/kernel/syscalls/timer_create/Makefile b/testcases/kernel/syscalls/timer_create/Makefile
57index 8de247075..eb240f432 100644 29index 8de247075..eb240f432 100644
58--- a/testcases/kernel/syscalls/timer_create/Makefile 30--- a/testcases/kernel/syscalls/timer_create/Makefile
@@ -68,3 +40,5 @@ index 8de247075..eb240f432 100644
68 CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include 40 CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include
69 41
70 LDLIBS += -lpthread -lrt 42 LDLIBS += -lpthread -lrt
43--
442.25.1
diff --git a/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch
index 1705abcf19..b1a99959d3 100644
--- a/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch
@@ -1,7 +1,7 @@
1From 62c3481c73a2414d7a5f0a70808bfc9a06195bd9 Mon Sep 17 00:00:00 2001 1From be453d1be826b862d47e08663fd69eea9dd62730 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:19:03 +0000 3Date: Thu, 7 Jan 2016 18:19:03 +0000
4Subject: [PATCH] build: Add option to select libc implementation 4Subject: [PATCH 1/6] build: Add option to select libc implementation
5 5
6There are more than glibc for C library implementation available on 6There are more than glibc for C library implementation available on
7linux now a days, uclibc cloaked like glibc but musl e.g. is very 7linux now a days, uclibc cloaked like glibc but musl e.g. is very
@@ -11,18 +11,26 @@ Disable tests specifically not building _yet_ on musl based systems
11 11
12Upstream-Status: Pending 12Upstream-Status: Pending
13 13
14Signed-off-by: Khem Raj <raj.khem@gmail.com> 14rt_tgsigqueueinfo fails with:
15rt_tgsigqueueinfo01.c: In function 'sigusr1_handler':
16rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'?
17 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
18 | ^~~~~~~~~
19 | __si_fields
15 20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22[ pvorel: rebase for 20200120: enable mallopt, profil, rpc016,
23rt_sigsuspend, sbrk_mutex, setdomainname, sethostname, sigsuspend,
24testpi-3, testpi-5, testpi-6, ustat; move rt_tgsigqueueinfo
25from 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch ]
26Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
27Signed-off-by: Petr Vorel <pvorel@suse.cz>
16--- 28---
17 Makefile | 5 +++++ 29 Makefile | 5 +++++
18 testcases/kernel/Makefile | 5 ++++- 30 testcases/kernel/Makefile | 5 ++++-
19 testcases/kernel/sched/Makefile | 4 +++- 31 testcases/kernel/sched/Makefile | 4 +++-
20 testcases/kernel/syscalls/Makefile | 5 +++++ 32 testcases/kernel/syscalls/Makefile | 4 ++++
21 testcases/network/nfsv4/acl/Makefile | 4 ++++ 33 4 files changed, 16 insertions(+), 2 deletions(-)
22 testcases/network/rpc/basic_tests/Makefile | 5 +++++
23 testcases/realtime/func/pi-tests/Makefile | 4 ++++
24 testcases/realtime/stress/pi-tests/Makefile | 5 +++++
25 8 files changed, 35 insertions(+), 2 deletions(-)
26 34
27diff --git a/Makefile b/Makefile 35diff --git a/Makefile b/Makefile
28index 768ca4606..e9d679a71 100644 36index 768ca4606..e9d679a71 100644
@@ -76,73 +84,19 @@ index 6a57d79ee..74bb93370 100644
76+endif 84+endif
77 include $(top_srcdir)/include/mk/generic_trunk_target.mk 85 include $(top_srcdir)/include/mk/generic_trunk_target.mk
78diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile 86diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
79index 45a00cf7d..d1becd054 100644 87index 45a00cf7d..af5a591a0 100644
80--- a/testcases/kernel/syscalls/Makefile 88--- a/testcases/kernel/syscalls/Makefile
81+++ b/testcases/kernel/syscalls/Makefile 89+++ b/testcases/kernel/syscalls/Makefile
82@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) 90@@ -29,6 +29,10 @@ FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
83 FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
84 mincore mprotect nftw profil remap_file_pages sbrk 91 mincore mprotect nftw profil remap_file_pages sbrk
85 endif 92 endif
86+ifeq ($(LIBC),musl)
87+FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
88+ rt_sigsuspend setdomainname sethostname sigsuspend \
89+ ustat
90+endif
91
92 ifeq ($(UCLIBC),1)
93 FILTER_OUT_DIRS += profil
94diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
95index 8c55a6bbd..f7cda621d 100644
96--- a/testcases/network/nfsv4/acl/Makefile
97+++ b/testcases/network/nfsv4/acl/Makefile
98@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
99
100 LDLIBS += $(ACL_LIBS)
101 93
102+ifeq ($(LIBC),musl) 94+ifeq ($(LIBC),musl)
103+FILTER_OUT_MAKE_TARGETS := acl1 95+FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl rt_tgsigqueueinfo
104+endif 96+endif
105+ 97+
106 include $(top_srcdir)/include/mk/generic_leaf_target.mk 98 ifeq ($(UCLIBC),1)
107diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile 99 FILTER_OUT_DIRS += profil
108index 66e9d5675..ea8eb8a98 100644 100 endif
109--- a/testcases/network/rpc/basic_tests/Makefile 101--
110+++ b/testcases/network/rpc/basic_tests/Makefile 1022.25.1
111@@ -23,4 +23,9 @@
112 top_srcdir ?= ../../../..
113
114 include $(top_srcdir)/include/mk/env_pre.mk
115+
116+ifeq ($(LIBC),musl)
117+FILTER_OUT_DIRS += rpc01
118+endif
119+
120 include $(top_srcdir)/include/mk/generic_trunk_target.mk
121diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
122index 68616a711..748754bb4 100644
123--- a/testcases/realtime/func/pi-tests/Makefile
124+++ b/testcases/realtime/func/pi-tests/Makefile
125@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
126 include $(abs_srcdir)/../../config.mk
127
128 MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex
129+ifeq ($(LIBC),musl)
130+FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex
131+endif
132+
133
134 include $(top_srcdir)/include/mk/generic_leaf_target.mk
135diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
136index 1881f7565..266e0b815 100644
137--- a/testcases/realtime/stress/pi-tests/Makefile
138+++ b/testcases/realtime/stress/pi-tests/Makefile
139@@ -24,4 +24,9 @@ top_srcdir ?= ../../../..
140
141 include $(top_srcdir)/include/mk/env_pre.mk
142 include $(abs_srcdir)/../../config.mk
143+
144+ifeq ($(LIBC),musl)
145+FILTER_OUT_MAKE_TARGETS := testpi-3
146+endif
147+
148 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch b/meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch
deleted file mode 100644
index 1b433d3ad3..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From fae8852a63d9fa6e56fb8b24eaf10560bd13757f Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Tue, 12 Nov 2019 11:33:50 +0800
4Subject: [PATCH] mkswap01.sh: Add "udevadm trigger" before swap verification
5
6Fix: https://github.com/linux-test-project/ltp/issues/458
7
8Sometimes the swap device cannot show up in /dev/disk/by-uuid/
9or /dev/disk/by-lable/ due to the issue #458. When this issue
10happens, "blkid -c /dev/null" and "ls /dev/disk/by-uuid/" show
11different UUID of the device.
12
13Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1193414]
14
15Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
16---
17 testcases/commands/mkswap/mkswap01.sh | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
21index 3a348c6e6..9437c4a4e 100755
22--- a/testcases/commands/mkswap/mkswap01.sh
23+++ b/testcases/commands/mkswap/mkswap01.sh
24@@ -129,6 +129,8 @@ mkswap_test()
25 return
26 fi
27
28+ udevadm trigger --name-match=$TST_DEVICE
29+
30 if [ -n "$device" ]; then
31 mkswap_verify "$mkswap_op" "$op_arg" "$device" "$size" "$dev_file"
32 if [ $? -ne 0 ]; then
33--
342.14.4
35
diff --git a/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch b/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch
deleted file mode 100644
index fe5e7314e0..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 59cb0dd9f8e65b2d398fcaf4d163cbc8e1d0ae45 Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Tue, 31 Dec 2019 15:02:48 +0800
4Subject: [PATCH] nm01: Remove prefix zeros of the addresses output by nm
5 before comparing
6
7The latest nm v2.33.1 outputs symbols addresses without prefix zeros
8for "nm -f posix", which causes the following error.
9nm01 5 TFAIL: Got wrong format with -f bsd
10
11Let's remove the prefix zeros before comparing.
12
13Upstream-Status: Backport [59cb0dd9f8e65b2d398fcaf4d163cbc8e1d0ae45]
14
15Signed-off-by: He Zhe <zhe.he@windriver.com>
16Reviewed-by: Li Wang <liwang@redhat.com>
17Reviewed-by: Petr Vorel <pvorel@suse.cz>
18Tested-by: Petr Vorel <pvorel@suse.cz>
19---
20 testcases/commands/nm/nm01.sh | 7 +++++--
21 1 file changed, 5 insertions(+), 2 deletions(-)
22
23diff --git a/testcases/commands/nm/nm01.sh b/testcases/commands/nm/nm01.sh
24index 30c41bd..fd9d3d9 100755
25--- a/testcases/commands/nm/nm01.sh
26+++ b/testcases/commands/nm/nm01.sh
27@@ -84,8 +84,11 @@ test5()
28 EXPECT_PASS $NM -f bsd $TST_DATAROOT/f1 \> nm_bsd.out
29 EXPECT_PASS $NM -f posix $TST_DATAROOT/f1 \> nm_posix.out
30
31- ROD awk '{print $3 $2 $1}' nm_bsd.out \> nm1.out
32- ROD awk '{print $1 $2 $3}' nm_posix.out \> nm2.out
33+ ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_bsd.out \> trimmed_nm_bsd.out
34+ ROD awk '{print gensub(/\y(0+)([0-9a-fA-F]+)\y/, "\\2", "g")}' nm_posix.out \> trimmed_nm_posix.out
35+
36+ ROD awk '{print $3 $2 $1}' trimmed_nm_bsd.out \> nm1.out
37+ ROD awk '{print $1 $2 $3}' trimmed_nm_posix.out \> nm2.out
38
39 if diff nm1.out nm2.out > /dev/null; then
40 tst_res TPASS "Got BSD format with -f bsd"
41--
422.7.4
43
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
index c431669716..ac8f08ef5a 100644
--- a/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
+++ b/meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch
@@ -1,28 +1,40 @@
1From b66905b094e08a84c30bc135003c3611f65d53ec Mon Sep 17 00:00:00 2001 1From 89c5841bd148a7ae70c65f4a1ca5996b7f0cddfa Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Feb 2020 22:22:17 -0800 3Date: Wed, 19 Feb 2020 22:52:04 -0800
4Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them 4Subject: [PATCH] syscalls: Check for time64 unsafe syscalls before using them
5 5
6musl is using 64bit time_t now on 32bit architectures and these syscalls 6musl is using 64bit time_t now on 32bit architectures and these syscalls
7no longer exist, therefore its better to check for them being available 7no longer exist, therefore its better to check for them being available
8before using them 8before using them
9 9
10Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1241258/]
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
12Reviewed-by: Petr Vorel <pvorel@suse.cz>
13Signed-off-by: Petr Vorel <pvorel@suse.cz>
14Upstream-Status: accepted as 5b57ae2913e2d2d167cbd3822784b4c4ba336812
12--- 15---
13 lib/tst_clocks.c | 9 +++++---- 16 lib/tst_clocks.c | 16 ++++++----------
14 testcases/kernel/syscalls/gettimeofday/gettimeofday01.c | 6 ++---- 17 .../syscalls/gettimeofday/gettimeofday01.c | 6 ++----
15 testcases/kernel/syscalls/gettimeofday/gettimeofday02.c | 8 +++----- 18 .../syscalls/gettimeofday/gettimeofday02.c | 8 +++-----
16 3 files changed, 10 insertions(+), 13 deletions(-) 19 3 files changed, 11 insertions(+), 19 deletions(-)
17 20
21diff --git a/lib/tst_clocks.c b/lib/tst_clocks.c
22index 5195da38f..fa2f1cb84 100644
18--- a/lib/tst_clocks.c 23--- a/lib/tst_clocks.c
19+++ b/lib/tst_clocks.c 24+++ b/lib/tst_clocks.c
20@@ -22,21 +22,22 @@ 25@@ -3,28 +3,24 @@
21 #define _GNU_SOURCE 26 * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz>
22 #include <unistd.h> 27 */
28
29-/*
30- * clock_gettime() and clock_getres() functions
31- */
32-
33-#define _GNU_SOURCE
34-#include <unistd.h>
23 #include <time.h> 35 #include <time.h>
24-#include <sys/syscall.h> 36-#include <sys/syscall.h>
25- 37
26+#define TST_NO_DEFAULT_MAIN 38+#define TST_NO_DEFAULT_MAIN
27+#include "tst_test.h" 39+#include "tst_test.h"
28 #include "tst_clocks.h" 40 #include "tst_clocks.h"
@@ -45,6 +57,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
45- return syscall(SYS_clock_settime, clk_id, ts); 57- return syscall(SYS_clock_settime, clk_id, ts);
46+ return tst_syscall(__NR_clock_settime, clk_id, ts); 58+ return tst_syscall(__NR_clock_settime, clk_id, ts);
47 } 59 }
60diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
61index 583d8f7b9..08ea1673a 100644
48--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c 62--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
49+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c 63+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday01.c
50@@ -38,10 +38,8 @@ 64@@ -38,10 +38,8 @@
@@ -68,6 +82,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
68 82
69 /* gettimeofday returns an int, so we need to turn the long 83 /* gettimeofday returns an int, so we need to turn the long
70 * TEST_RETURN into an int to test with */ 84 * TEST_RETURN into an int to test with */
85diff --git a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
86index 1d60f448e..5170ad2f7 100644
71--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c 87--- a/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
72+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c 88+++ b/testcases/kernel/syscalls/gettimeofday/gettimeofday02.c
73@@ -16,14 +16,12 @@ 89@@ -16,14 +16,12 @@
@@ -102,3 +118,5 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
102 tst_res(TBROK | TERRNO, "gettimeofday() failed"); 118 tst_res(TBROK | TERRNO, "gettimeofday() failed");
103 return; 119 return;
104 } 120 }
121--
1222.25.1
diff --git a/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch b/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch
deleted file mode 100644
index 9330844509..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1From 476ce907fa18042cdde0a244ba9a46cd895ce76c Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 12 Dec 2019 17:56:02 +0100
4Subject: [PATCH] testcases: fix an absent format string issue
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
13index 27dbc6626..19d943d06 100644
14--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
15+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
16@@ -59,7 +59,7 @@ static void verify_pidfd_send_signal(void)
17
18 /* Manipulate PID for next process */
19 sprintf(pid_str, "%d", pid - 1);
20- SAFE_FILE_PRINTF(last_pid_file, pid_str);
21+ SAFE_FILE_PRINTF(last_pid_file, "%s", pid_str);
22
23 new_pid = SAFE_FORK();
24 if (new_pid == 0) {
diff --git a/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
deleted file mode 100644
index eff9ed0741..0000000000
--- a/meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 81e5bd5442337a4a648a0dbbff47eaac0d351287 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:22:38 +0000
4Subject: [PATCH] kernel/controllers: Link with libfts explicitly on musl
5
6musl does not implement fts like glibc and therefore it depends on
7external implementation for all fts APIs
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/controllers/Makefile.inc | 3 +++
14 testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
15 2 files changed, 6 insertions(+)
16
17diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
18index 4ca0b5a..1d85e4d 100644
19--- a/testcases/kernel/controllers/Makefile.inc
20+++ b/testcases/kernel/controllers/Makefile.inc
21@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB)
22 CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR)
23
24 LDFLAGS += -L$(abs_builddir)/../$(LIBDIR)
25+ifeq ($(LIBC),musl)
26+LDLIBS += -lfts
27+endif
28
29 INSTALL_TARGETS ?= *.sh
30
31diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
32index db6a843..86dd2a8 100644
33--- a/testcases/kernel/controllers/cpuset/Makefile.inc
34+++ b/testcases/kernel/controllers/cpuset/Makefile.inc
35@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET)
36 LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR)
37
38 LDLIBS += -lcpu_set -lcontrollers -lltp
39+ifeq ($(LIBC),musl)
40+LDLIBS += -lfts
41+endif
42
43 INSTALL_TARGETS ?= *.sh
44
45--
462.7.4
47
diff --git a/meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch b/meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch
deleted file mode 100644
index 804edfa1b4..0000000000
--- a/meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From 60054686e2c1a4bedf1d507af97ebbb7ff491e77 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jul 2019 15:23:15 +0800
4Subject: [PATCH] rt_tgsigqueueinfo: disable test on musl
5
6Fix build error with musl:
7rt_tgsigqueueinfo01.c: In function 'sigusr1_handler':
8rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'?
9 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
10 | ^~~~~~~~~
11 | __si_fields
12
13Upstream-Status: Pending
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 testcases/kernel/syscalls/Makefile | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
21index d1becd0..1f3ff34 100644
22--- a/testcases/kernel/syscalls/Makefile
23+++ b/testcases/kernel/syscalls/Makefile
24@@ -31,7 +31,7 @@ endif
25 ifeq ($(LIBC),musl)
26 FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
27 rt_sigsuspend setdomainname sethostname sigsuspend \
28- ustat
29+ ustat rt_tgsigqueueinfo
30 endif
31
32 ifeq ($(UCLIBC),1)
33--
342.7.4
35
diff --git a/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
index b46325eaf3..350091a70c 100644
--- a/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
+++ b/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
@@ -1,33 +1,34 @@
1From aa7a9185a037ad59012bd46713ac340458e95209 Mon Sep 17 00:00:00 2001 1From 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> 2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
3Date: Fri, 13 May 2016 11:11:28 -0500 3Date: Fri, 13 May 2016 11:11:28 -0500
4Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on 4Subject: [PATCH] acl: Security fix on string printf
5 string printf
6MIME-Version: 1.0 5MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8 6Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit 7Content-Transfer-Encoding: 8bit
9 8
10Fixes: 9Fixes build error when compiled with -Werror=format-security:
11 10
12acl1.c: In function 'test_acl_default': 11acl1.c: In function ‘test_acl_default’:
13acl1.c:317:2: error: format not a string literal and no format arguments 12acl1.c:305:2: error: format not a string literal and no format arguments [-Werror=format-security]
14[-Werror=format-security] 13 305 | printf(cmd);
15 printf(cmd);
16 14
17[YOCTO #9548] 15Patch taken from openembedded-core,
16original bug report: https://bugzilla.yoctoproject.org/9548
18 17
19Upstream-Status: Pending 18[YOCTO #9548]
20 19
21Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> 20Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
21Signed-off-by: Petr Vorel <pvorel@suse.cz>
22Upstream-Status: accepted in 4b7db094d6fc5659001ae8dc17078bb65d46b9c9
22--- 23---
23 testcases/network/nfsv4/acl/acl1.c | 2 +- 24 testcases/network/nfsv4/acl/acl1.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-) 25 1 file changed, 1 insertion(+), 1 deletion(-)
25 26
26diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c 27diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c
27index bdf0180..898b7ca 100644 28index aae9484e5..ad778cd33 100644
28--- a/testcases/network/nfsv4/acl/acl1.c 29--- a/testcases/network/nfsv4/acl/acl1.c
29+++ b/testcases/network/nfsv4/acl/acl1.c 30+++ b/testcases/network/nfsv4/acl/acl1.c
30@@ -303,7 +303,7 @@ void test_acl_default(char *dir, acl_t acl) 31@@ -302,7 +302,7 @@ void test_acl_default(char *dir, acl_t acl)
31 char *cmd = malloc(256); 32 char *cmd = malloc(256);
32 33
33 strcpy(cmd, "chmod 7777 "); 34 strcpy(cmd, "chmod 7777 ");
@@ -37,5 +38,5 @@ index bdf0180..898b7ca 100644
37 system(cmd); 38 system(cmd);
38 acl2 = acl_get_file(path, ACL_TYPE_ACCESS); 39 acl2 = acl_get_file(path, ACL_TYPE_ACCESS);
39-- 40--
402.7.4 412.25.1
41 42
diff --git a/meta/recipes-extended/ltp/ltp_20190930.bb b/meta/recipes-extended/ltp/ltp_20200120.bb
index 19bd7bc9c6..3cc10afa0c 100644
--- a/meta/recipes-extended/ltp/ltp_20190930.bb
+++ b/meta/recipes-extended/ltp/ltp_20200120.bb
@@ -12,12 +12,12 @@ LIC_FILES_CHKSUM = "\
12 file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ 12 file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \
13 file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ 13 file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
14 file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ 14 file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
15 file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
16" 15"
17 16
18DEPENDS = "attr libaio libcap acl openssl zip-native" 17DEPENDS = "attr libaio libcap acl openssl zip-native"
19DEPENDS_append_libc-musl = " fts " 18DEPENDS_append_libc-musl = " fts "
20EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " 19EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
20EXTRA_OECONF_append_libc-musl = " LIBS=-lfts "
21 21
22# since ltp contains x86-64 assembler which uses the frame-pointer register, 22# since ltp contains x86-64 assembler which uses the frame-pointer register,
23# set -fomit-frame-pointer x86-64 to handle cases where optimisation 23# set -fomit-frame-pointer x86-64 to handle cases where optimisation
@@ -27,21 +27,16 @@ CFLAGS_append_x86-64 = " -fomit-frame-pointer"
27 27
28CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" 28CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 29CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
30SRCREV = "c9707b465a08397569920b676345474f44327200" 30SRCREV = "4079aaf264d0e9ead042b59d1c5f4e643620d0d5"
31 31
32SRC_URI = "git://github.com/linux-test-project/ltp.git \ 32SRC_URI = "git://github.com/linux-test-project/ltp.git \
33 file://0001-build-Add-option-to-select-libc-implementation.patch \ 33 file://0001-build-Add-option-to-select-libc-implementation.patch \
34 file://0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
35 file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ 34 file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
36 file://0004-guard-mallocopt-with-__GLIBC__.patch \ 35 file://0004-guard-mallocopt-with-__GLIBC__.patch \
37 file://0006-rt_tgsigqueueinfo-disable-test-on-musl.patch \
38 file://0007-Fix-test_proc_kill-hanging.patch \ 36 file://0007-Fix-test_proc_kill-hanging.patch \
39 file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ 37 file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
40 file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ 38 file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
41 file://0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch \
42 file://0001-testcases-fix-an-absent-format-string-issue.patch \
43 file://0001-Add-more-musl-exclusions.patch \ 39 file://0001-Add-more-musl-exclusions.patch \
44 file://0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch \
45 file://0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch \ 40 file://0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch \
46 " 41 "
47 42