btrfs-progs: tests: scan test results

Some errors may be reported in the logs only, scan the file each time
there are fresh results. The scanning script will return error that is
supposed to be caught by the testsuite environment.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-09-05 22:19:45 +02:00
parent 7a7df06f98
commit 2726a83952
7 changed files with 25 additions and 9 deletions

View file

@ -77,3 +77,5 @@ do
fi
cd "$TEST_TOP"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -95,3 +95,5 @@ for i in $(find "$TEST_TOP/convert-tests" -maxdepth 1 -mindepth 1 -type d \
do
run_one_test "$i"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -112,3 +112,5 @@ for i in $(find "$TEST_TOP/fsck-tests" -maxdepth 1 -mindepth 1 -type d \
do
run_one_test "$i"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -76,3 +76,5 @@ do
fi
cd "$TEST_TOP"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -84,3 +84,5 @@ do
fi
cd "$TEST_TOP"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -79,3 +79,5 @@ do
fi
cd "$TEST_TOP"
done
"$TEST_TOP/scan-results.sh" "$RESULTS"

View file

@ -3,6 +3,8 @@
#
# Usage: $0 [test-log.txt]
ret=0
scan_log() {
local file="$1"
@ -10,14 +12,14 @@ scan_log() {
last=
while read line; do
case "$line" in
===\ START\ TEST*) last="$line" ;;
*Assertion*failed*) echo "ASSERTION FAILED: $last" ;;
*runtime\ error*) echo "RUNTIME ERROR (sanitizer): $last" ;;
*AddressSanitizer*heap-use-after-free*) echo "RUNTIME ERROR (use after free): $last" ;;
*LeakSanitizer:*leak*) echo "SANITIZER REPORT: memory leak: $last" ;;
*Warning:\ assertion*failed*) echo "ASSERTION WARNING: $last" ;;
*command\ not\ found*) echo "COMMAND NOT FOUND: $last" ;;
*extent\ buffer\ leak*) echo "EXTENT BUFFER LEAK: $last" ;;
===\ START\ TEST*) last="$line" ;;
*Assertion*failed*) ret=1; echo "ASSERTION FAILED: $last" ;;
*runtime\ error*) ret=1; echo "RUNTIME ERROR (sanitizer): $last" ;;
*AddressSanitizer*heap-use-after-free*) ret=1; echo "RUNTIME ERROR (use after free): $last" ;;
*LeakSanitizer:*leak*) ret=1; echo "SANITIZER REPORT: memory leak: $last" ;;
*Warning:\ assertion*failed*) ret=1; echo "ASSERTION WARNING: $last" ;;
*command\ not\ found*) ret=1; echo "COMMAND NOT FOUND: $last" ;;
*extent\ buffer\ leak*) ret=1; echo "EXTENT BUFFER LEAK: $last" ;;
*) : ;;
esac
done < "$file"
@ -26,10 +28,12 @@ scan_log() {
# Scan only the given file
if [ -n "$1" ]; then
scan_log "$1"
exit
exit "$ret"
fi
# Scan all existing test logs
for file in *.txt; do
scan_log "$file"
done
exit "$ret"