summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2024-10-11 09:24:16 -0500
committerKhem Raj <raj.khem@gmail.com>2024-11-19 13:13:28 -0800
commit9865b9daf27075a3df6ee56a8cd50e0b6e84b691 (patch)
tree9e33fe6d9d0558fecaa542db10d97604f4291a71
parent5a5f7d30b8884382adb5eb2fb8c10a191cf136d3 (diff)
downloadmeta-openembedded-9865b9daf27075a3df6ee56a8cd50e0b6e84b691.tar.gz
kernel-selftest: Update to allow for turning on all tests
In testing adding in more kernel-selftests there were a number of issues that arose that require changes that are more appropriate for the main recipe and not a bbappend. 1) Stop looping over TEST_LIST ourselves and use the TARGETS="" provided by the kernel-sefltest Makefiles. This correctly sets up various variables that the selftest Makefiles all need. Also, do_install becomes cleaner because the main Makefile already installs the list of tests and the top level script. 2) Add DEBUG_PREFIX_MAP to the CC setting to avoid some "buildpaths" QA errors. 3) Add two INSANE_SKIPS for "already-stripped" and "ldflags". Some of the selftest Makefiles are adding flags to their compiles that basically break the above checks. Since these compiles are not really meant as user level tools and instead testing, it should be ok to just always set INSANE_SKIP for these two. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit dc6d6e06aa3394d1f4db38d63f06d5bec43426b8) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb26
1 files changed, 10 insertions, 16 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
index 889fe3e22d..f83b07dd9b 100644
--- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
@@ -56,7 +56,7 @@ TEST_LIST = "\
56EXTRA_OEMAKE = '\ 56EXTRA_OEMAKE = '\
57 CROSS_COMPILE=${TARGET_PREFIX} \ 57 CROSS_COMPILE=${TARGET_PREFIX} \
58 ARCH=${ARCH} \ 58 ARCH=${ARCH} \
59 CC="${CC}" \ 59 CC="${CC} ${DEBUG_PREFIX_MAP}" \
60 AR="${AR}" \ 60 AR="${AR}" \
61 LD="${LD}" \ 61 LD="${LD}" \
62 CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ 62 CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \
@@ -97,25 +97,13 @@ either install it and add it to HOSTTOOLS, or add clang-native from meta-clang t
97 sed -i -e '/mrecord-mcount/d' ${S}/Makefile 97 sed -i -e '/mrecord-mcount/d' ${S}/Makefile
98 sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile 98 sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile
99 sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.* 99 sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.*
100 for i in ${TEST_LIST} 100 oe_runmake -C ${S}/tools/testing/selftests TARGETS="${TEST_LIST}"
101 do
102 oe_runmake -C ${S}/tools/testing/selftests/${i}
103 done
104} 101}
105 102
106do_install() { 103do_install() {
107 for i in ${TEST_LIST} 104 oe_runmake -C ${S}/tools/testing/selftests INSTALL_PATH=${D}/usr/kernel-selftest TARGETS="${TEST_LIST}" install
108 do
109 oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install
110 # Install kselftest-list.txt that required by kselftest runner.
111 oe_runmake -s --no-print-directory COLLECTION=${i} -C ${S}/tools/testing/selftests/${i} emit_tests \
112 >> ${D}/usr/kernel-selftest/kselftest-list.txt
113 done
114 # Install kselftest runner.
115 install -m 0755 ${S}/tools/testing/selftests/run_kselftest.sh ${D}/usr/kernel-selftest/
116 cp -R --no-dereference --preserve=mode,links -v ${S}/tools/testing/selftests/kselftest ${D}/usr/kernel-selftest/
117 if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then 105 if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then
118 sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py 106 sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py
119 fi 107 fi
120 chown root:root -R ${D}/usr/kernel-selftest 108 chown root:root -R ${D}/usr/kernel-selftest
121} 109}
@@ -161,6 +149,12 @@ RDEPENDS:${PN} += "python3 perl perl-module-io-handle"
161 149
162INSANE_SKIP:${PN} += "libdir" 150INSANE_SKIP:${PN} += "libdir"
163 151
152# A few of the selftests set compile flags that trip up the "ldflags" and
153# "already-stripped" QA checks. As this is mainly a testing package and
154# not really meant for user level execution, disable these two checks.
155INSANE_SKIP:${PN} += "ldflags"
156INSANE_SKIP:${PN} += "already-stripped"
157
164SECURITY_CFLAGS = "" 158SECURITY_CFLAGS = ""
165COMPATIBLE_HOST:libc-musl = 'null' 159COMPATIBLE_HOST:libc-musl = 'null'
166 160