btrfs-progs: tests: check the result log for critical warnings

Introduce a new function, check_test_results(), for
misc/fsck/convert/mkfs test cases.

This function is currently to catch warning message for subpage support,
but can be later expanded for other usages.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2020-11-09 13:39:52 +08:00 committed by David Sterba
parent fc38ae7f48
commit 5c9a753ba0
5 changed files with 17 additions and 0 deletions

View File

@ -832,4 +832,17 @@ init_env()
echo " convert: $TEST_ARGS_CONVERT" >> "$RESULTS"
fi
}
# Catch critical warning messages in test results
check_test_results()
{
local results="$1"
local testname="$2"
# Check subpage related warning
if grep -q "crrosses 64K page boundary" "$results"; then
_fail "found subpage related warning for case $testname"
fi
}
init_env

View File

@ -70,6 +70,7 @@ run_one_test() {
fi
_fail "test failed for case $testname"
fi
check_test_results "$RESULTS" "$testname"
else
_fail "custom test script not found"
fi

View File

@ -64,6 +64,7 @@ run_one_test() {
fi
_fail "test failed for case $(basename $testname)"
fi
check_test_results "$RESULTS" "$testname"
else
# Type 1
check_all_images

View File

@ -66,6 +66,7 @@ do
fi
_fail "test failed for case $(basename $i)"
fi
check_test_results "$RESULTS" "$(basename $i)"
fi
cd "$TEST_TOP"
done

View File

@ -61,6 +61,7 @@ do
fi
_fail "test failed for case $(basename $i)"
fi
check_test_results "$RESULTS" "$(basename $i)"
fi
cd "$TEST_TOP"
done