ZTS: Fix Test Summary page generation

Fix that error: "cat /tmp/failed.txt: No such file or directory"

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #16549
This commit is contained in:
Tino Reichardt 2024-09-18 06:40:49 +02:00 committed by Brian Behlendorf
parent 01852ffbf8
commit 7a965b9bc8
2 changed files with 8 additions and 7 deletions

View File

@ -46,7 +46,11 @@ for i in $(seq 1 $VMs); do
test -s $file && mv -f $file uname.txt test -s $file && mv -f $file uname.txt
file="vm$i/tests-exitcode.txt" file="vm$i/tests-exitcode.txt"
test -s $file || echo 1 > $file if [ ! -s $file ]; then
# XXX - add some tests for kernel panic's here
# tail -n 80 vm$i/console.txt | grep XYZ
echo 1 > $file
fi
rv=$(cat vm$i/tests-exitcode.txt) rv=$(cat vm$i/tests-exitcode.txt)
test $rv != 0 && touch /tmp/have_failed_tests test $rv != 0 && touch /tmp/have_failed_tests
@ -89,7 +93,6 @@ fi
cat summary.txt \ cat summary.txt \
| awk '/\(expected PASS\)/{ if ($1!="SKIP") print $2; next; } show' \ | awk '/\(expected PASS\)/{ if ($1!="SKIP") print $2; next; } show' \
| while read t; do | while read t; do
echo "check: $t"
cat summary-failure-logs.txt \ cat summary-failure-logs.txt \
| awk '$0~/Test[: ]/{ show=0; } $0~v{ show=1; } show' v="$t" \ | awk '$0~/Test[: ]/{ show=0; } $0~v{ show=1; } show' v="$t" \
> /tmp/fail.txt > /tmp/fail.txt

View File

@ -35,15 +35,12 @@ EOF
cat /tmp/summary.txt cat /tmp/summary.txt
echo "" echo ""
if [ -e /tmp/have_failed_tests ]; then if [ -f /tmp/have_failed_tests -a -s /tmp/failed.txt ]; then
RV=1
echo "Debuginfo of failed tests:" echo "Debuginfo of failed tests:"
cat /tmp/failed.txt cat /tmp/failed.txt
echo "" echo ""
cat /tmp/summary.txt | grep -v '^/' cat /tmp/summary.txt | grep -v '^/'
echo "" echo ""
else
RV=0
fi fi
echo -e "\nFull logs for download:\n $1\n" echo -e "\nFull logs for download:\n $1\n"
@ -70,4 +67,5 @@ for i in $(seq 1 $VMs); do
test -s "$file" && showfile "$file" "$vm: failure logfile" test -s "$file" && showfile "$file" "$vm: failure logfile"
done done
exit $RV test -f /tmp/have_failed_tests && exit 1
exit 0