1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00
Files
Khem Raj a1b3e8758e libc-test: Run as non-root user
Some of tests impose rlimit on it before running which wont be imposed
when running as root user.

Fixes
src/regression/pthread_atfork-errno-clobber.c:23: (pid = fork()) == -1 failed: fork succeeded despite rlimit
src/regression/pthread_atfork-errno-clobber.c:23: (pid = fork()) == -1 failed: fork succeeded despite rlimit
FAIL src/regression/pthread_atfork-errno-clobber-static.exe [status 1]

(From OE-Core rev: 585bf4b780a8ad60ba2b33cede4f0092ff61ddfc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-11 16:04:35 +01:00

29 lines
809 B
Bash

#!/bin/sh
set -e
cd /opt/libc-test
make cleanall
make run || true
echo ""
echo "--- ptest result ---"
# libc-test runs tests by module(e.g. src/api) and generates sub-module test
# report(e.g. src/api/REPORT) first. After all tests finish, it generates the
# consolidated report file src/REPORT.
report="/opt/libc-test/src/REPORT"
if ! [ -f "${report}" ]; then
echo "${report} not found!"
echo "FAIL: libc-test"
exit 1
# libc-test prints error on failure and prints nothing on success.
elif grep -q '^FAIL src.*\.exe.*' "${report}"; then
# Print test failure in ptest format.
# e.g. "FAIL src/api/main.exe [status 1]" -> "FAIL: api_main"
grep '^FAIL src.*\.exe.*' "${report}" \
| sed 's|^FAIL src/|FAIL: |;s|/|_|;s|\.exe.*\]||'
exit 1
else
echo "PASS: libc-test"
fi