CI: Drop custom handling of tools/tests

... and use them from their installed location.

The full reclusive copy of tools/tests brings in all build and intermediate
artefacts.  e.g. for test-tsx alone:

  ./tests/tsx
  ./tests/tsx/.test-tsx.o.d
  ./tests/tsx/test-tsx.o
  ./tests/tsx/.gitignore
  ./tests/tsx/test-tsx
  ./tests/tsx/Makefile
  ./tests/tsx/test-tsx.c

duplicating the test binary which is also in ./usr/lib/xen/tests

Rewrite run-tools-tests to run tests from their installed
location (/usr/lib/xen/tests in alpine), which effectively removes the outer
loop over $dir.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Denis Mukhin <dmukhin@ford.com>
This commit is contained in:
Andrew Cooper committed 2025-05-28 12:29:33 +01:00
1 parent 2d497e97e2
commit 0e7f6c6098
3 files changed
+22 -29

No files matched your search

-1
View File
@@ -109,6 +109,5 @@ else
# even though dist/ contains everything, while some containers don't even
# build Xen
(cd dist/install; find | cpio -o -H newc | gzip) > binaries/xen-tools.cpio.gz
cp -r tools/tests binaries/
collect_xen_artefacts
fi
+3 -4
View File
@@ -136,7 +136,7 @@ done
passed="test passed"
domU_check=""
dom0_check="
/tests/run-tools-tests /tests /tmp/tests-junit.xml && echo \"${passed}\"
/root/run-tools-tests /usr/lib/xen/tests /tmp/tests-junit.xml && echo \"${passed}\"
nc -l -p 8080 < /tmp/tests-junit.xml >/dev/null &
"
if [ "${test_variant}" = "tools-tests-pvh" ]; then
@@ -195,9 +195,8 @@ cat binaries/xen-tools.cpio.gz >> binaries/dom0-rootfs.cpio.gz
# test-local configuration
mkdir -p rootfs
cd rootfs
mkdir -p boot etc/local.d
cp -ar ../binaries/tests .
cp -a ../automation/scripts/run-tools-tests tests/
mkdir -p boot etc/local.d root
cp -a ../automation/scripts/run-tools-tests root/
echo "#!/bin/bash
+19 -24
View File
@@ -12,30 +12,25 @@ printf '<?xml version="1.0" encoding="UTF-8"?>\n' > "$xml_out"
printf '<testsuites name="tools.tests">\n' >> "$xml_out"
printf ' <testsuite name="tools.tests">\n' >> "$xml_out"
failed=
for dir in "$1"/*; do
[ -d "$dir" ] || continue
echo "Running test in $dir"
printf ' <testcase name="%s">\n' "$dir" >> "$xml_out"
ret=
for f in "$dir"/*; do
[ -f "$f" ] || continue
[ -x "$f" ] || continue
"$f" 2>&1 | tee /tmp/out
ret=$?
if [ "$ret" -ne 0 ]; then
echo "FAILED: $ret"
failed+=" $dir"
printf ' <failure type="failure" message="binary %s exited with code %d">\n' "$f" "$ret" >> "$xml_out"
# TODO: could use xml escaping... but current tests seems to
# produce sane output
cat /tmp/out >> "$xml_out"
printf ' </failure>\n' >> "$xml_out"
else
echo "PASSED"
fi
done
if [ -z "$ret" ]; then
printf ' <skipped type="skipped" message="no executable test found in %s"/>\n' "$dir" >> "$xml_out"
for f in "$1"/*; do
if [ ! -x "$f" ]; then
echo "SKIP: $f not executable"
continue
fi
echo "Running $f"
printf ' <testcase name="%s">\n' "$f" >> "$xml_out"
"$f" 2>&1 | tee /tmp/out
ret=$?
if [ "$ret" -ne 0 ]; then
echo "FAILED: $f"
failed+=" $f"
printf ' <failure type="failure" message="binary %s exited with code %d">\n' "$f" "$ret" >> "$xml_out"
# TODO: could use xml escaping... but current tests seems to
# produce sane output
cat /tmp/out >> "$xml_out"
printf ' </failure>\n' >> "$xml_out"
else
echo "PASSED"
fi
printf ' </testcase>\n' >> "$xml_out"
done
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.