From 0d578085cc7b97b783e1719b205dd563b406ecbc Mon Sep 17 00:00:00 2001 From: Dmitry Fomichev Date: Tue, 4 Aug 2020 10:38:28 +0900 Subject: [PATCH] t/zbd: check log file for failed assertions Currently, a ZBD test can succeed even if an fio assertion is raised during its run. Search every ZBD test log file for failed assertions and fail the test if any were found. Signed-off-by: Dmitry Fomichev Reviewed-by: Damien Le Moal Signed-off-by: Jens Axboe --- t/zbd/test-zbd-support | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support index 471a3487..139495d3 100755 --- a/t/zbd/test-zbd-support +++ b/t/zbd/test-zbd-support @@ -77,6 +77,13 @@ check_reset_count() { eval "[ '$reset_count' '$1' '$2' ]" } +# Check log for failed assertions and crashes. Without these checks, +# a test can succeed even when these events happen, but it must fail. +check_log() { + [ ! -f "${logfile}.${1}" ] && return 0 + ! grep -q -e "Assertion " -e "Aborted " "${logfile}.${1}" +} + # Whether or not $1 (/dev/...) is a SCSI device. is_scsi_device() { local d f @@ -1008,7 +1015,7 @@ trap 'intr=1' SIGINT for test_number in "${tests[@]}"; do rm -f "${logfile}.${test_number}" echo -n "Running test $(printf "%02d" $test_number) ... " - if eval "test$test_number"; then + if eval "test$test_number" && check_log $test_number; then status="PASS" cc_status="${green}${status}${end}" ((passed++)) -- 2.25.1