util-linux: rewrite the ptest integration

Instead of duplicating logic, we can use the run.sh that the test suite
installs.

Unless told otherwise, the util-linux test suite assumes that it is
running in a build tree and looks for binaries to run, but we're on
target so pass --use-system-commands (drops ~180 skips to tens).

Add --show-diff so that debugging can be done from the logs alone.

Remove redundant path manipulation that is now done upstream.

If PAM is disabled, delete the chfn test: it will run the chfn from
shadow which has different output, and the test will fail.

[ YOCTO #14244 ]

(From OE-Core rev: 720660b936b5523ec48a7c04712d10c88198e12c)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2021-07-05 18:04:21 +01:00
committed by Richard Purdie
parent c1fea579f0
commit 493d1abff7
2 changed files with 7 additions and 41 deletions

View File

@@ -13,31 +13,12 @@ current_path=$(readlink -f $0)
export bindir=$(dirname $current_path)
export PATH=$bindir/bin:$PATH
cd tests || exit 1
comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
echo
echo "-------------------- util-linux regression tests --------------------"
echo
echo " For development purpose only. "
echo " Don't execute on production system! "
echo
res=0
count=0
for ts in $comps;
do
$ts | sed -u '{
./tests/run.sh --use-system-commands --parsable --show-diff | sed -u '{
s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/
s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/
s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/
}'
done
}'
if [ "x$UDEV_PID" != "x" ]; then
/etc/init.d/udev start
fi