btrfs-progs: tests: extend scan-results.sh to scan only a given file

Scanning all results is meant for the whole testsuite, we'd like to make
it more fine grained to verify them once a test is run via the test
running wrappers.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-09-05 22:03:15 +02:00
parent e0263f2b31
commit 7a7df06f98
1 changed files with 18 additions and 4 deletions

View File

@ -1,9 +1,12 @@
#!/bin/sh
# Look for some frequent error message templates in test logs
#
# Usage: $0 [test-log.txt]
# look for some error messages in all test logs
scan_log() {
local file="$1"
for i in *.txt; do
echo "Scanning $i"
echo "Scanning $file"
last=
while read line; do
case "$line" in
@ -17,5 +20,16 @@ for i in *.txt; do
*extent\ buffer\ leak*) echo "EXTENT BUFFER LEAK: $last" ;;
*) : ;;
esac
done < "$i"
done < "$file"
}
# Scan only the given file
if [ -n "$1" ]; then
scan_log "$1"
exit
fi
# Scan all existing test logs
for file in *.txt; do
scan_log "$file"
done