diff options
author | Trevor Gamblin <trevor.gamblin@windriver.com> | 2020-03-11 04:32:34 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-11 11:44:29 +0000 |
commit | eda41c4342063dfa0ec5b8f09b9e97c75c255cfc (patch) | |
tree | 2a9ad87e8ebcd28df43c03792195b2d5c412dbc3 /meta | |
parent | b3ee2f9fc5dce8f5cfc1a5f80075a1cd017043ba (diff) | |
download | poky-eda41c4342063dfa0ec5b8f09b9e97c75c255cfc.tar.gz |
coreutils: add ptest
coreutils has a large number of tests, including some added by the
Makefile flags RUN_EXPENSIVE_TESTS and RUN_VERY_EXPENSIVE_TESTS that
significantly increase runtime (and that have been disabled). Note
that the coreutils ptest directory is given blanket permissions at
runtime with chmod -R 777 to ensure that the user created for the
tests will be able to run the test scripts and create the necessary
files in the process.
There is still room to improve the results of this ptest without
the aforementioned additions. Of the tests marked SKIP, there are
30 tests that are currently counted as SKIP because they require
sudo permissions, and another 21 that require membership in
multiple user groups. It is important to know that coreutils has
tests for both root and non-root users. Testing showed that 42
tests are skipped when running as root versus 30 when running as a
non-root user, so the decision was made to run the suite as the
latter. Additionally, gdb, valgrind, and strace could be included
in the RDEPENDS list to increase pass rate, but their total
contribution is 13 tests, so they were omitted to reduce image size.
Finally, note that at least one ptest (misc/head-write-error.sh) is
prone to ERROR on builds of core-image-minimal if extra space is
not provided with IMAGE_ROOTFS_EXTRA_SPACE.
(From OE-Core rev: 9a703f8e05d9e7e609d0e04278be290d4051ec31)
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rwxr-xr-x | meta/recipes-core/coreutils/coreutils/run-ptest | 17 | ||||
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_8.31.bb | 40 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/coreutils/run-ptest b/meta/recipes-core/coreutils/coreutils/run-ptest new file mode 100755 index 0000000000..6d4a7b365d --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils/run-ptest | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # remove any stale lock files so that the calls to groupadd/useradd don't stop | ||
4 | # the ptest if re-using the same image | ||
5 | rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock | ||
6 | |||
7 | COREUTILSLIB=@libdir@/coreutils | ||
8 | LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log" | ||
9 | USERNAME="tester" | ||
10 | groupadd ugroup1 | ||
11 | groupadd ugroup2 | ||
12 | useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already exists" | ||
13 | |||
14 | su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG} | ||
15 | userdel $USERNAME | ||
16 | groupdel ugroup1 | ||
17 | groupdel ugroup2 | ||
diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb b/meta/recipes-core/coreutils/coreutils_8.31.bb index 57b2c1bdba..cba0bfe15c 100644 --- a/meta/recipes-core/coreutils/coreutils_8.31.bb +++ b/meta/recipes-core/coreutils/coreutils_8.31.bb | |||
@@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ | |||
18 | file://0001-uname-report-processor-and-hardware-correctly.patch \ | 18 | file://0001-uname-report-processor-and-hardware-correctly.patch \ |
19 | file://disable-ls-output-quoting.patch \ | 19 | file://disable-ls-output-quoting.patch \ |
20 | file://0001-local.mk-fix-cross-compiling-problem.patch \ | 20 | file://0001-local.mk-fix-cross-compiling-problem.patch \ |
21 | file://run-ptest \ | ||
21 | " | 22 | " |
22 | 23 | ||
23 | SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch" | 24 | SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch" |
@@ -143,3 +144,42 @@ python __anonymous() { | |||
143 | } | 144 | } |
144 | 145 | ||
145 | BBCLASSEXTEND = "native nativesdk" | 146 | BBCLASSEXTEND = "native nativesdk" |
147 | |||
148 | inherit ptest | ||
149 | |||
150 | RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl libmodule-build-perl make perl perl-module-file-stat python3-core sed shadow" | ||
151 | |||
152 | do_install_ptest () { | ||
153 | install -d ${D}${PTEST_PATH}/tests | ||
154 | cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests | ||
155 | sed -i 's/ginstall/install/g' `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq` | ||
156 | install -d ${D}${PTEST_PATH}/build-aux | ||
157 | install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ | ||
158 | cp ${B}/Makefile ${D}${PTEST_PATH}/ | ||
159 | cp ${S}/init.cfg ${D}${PTEST_PATH}/ | ||
160 | cp -r ${B}/src ${D}${PTEST_PATH}/ | ||
161 | cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src | ||
162 | sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile | ||
163 | sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile | ||
164 | sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile | ||
165 | sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
166 | sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
167 | sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile | ||
168 | sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile | ||
169 | chmod -R 777 ${D}${PTEST_PATH} | ||
170 | |||
171 | # Disable subcase stty-pairs.sh, it will cause test framework hang | ||
172 | sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile | ||
173 | |||
174 | # Disable subcase tail-2/assert.sh as it has issues on 32-bit systems | ||
175 | sed -i '/assert.sh/d' ${D}${PTEST_PATH}/Makefile | ||
176 | |||
177 | # Tweak test d_type-check to use python3 instead of python | ||
178 | sed -i "1s@.*@#!/usr/bin/python3@" ${D}${PTEST_PATH}/tests/d_type-check | ||
179 | install ${B}/src/getlimits ${D}/${bindir} | ||
180 | |||
181 | # handle multilib | ||
182 | sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest | ||
183 | } | ||
184 | |||
185 | FILES_${PN}-ptest += "${bindir}/getlimits" | ||