summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Fomichev <dmitry.fomichev@wdc.com>2020-08-04 10:38:28 +0900
committerJens Axboe <axboe@kernel.dk>2020-08-11 10:42:43 -0600
commit0d578085cc7b97b783e1719b205dd563b406ecbc (patch)
tree1e15823f5ea2ac18b4e7616195d8826a92a7175d
parentceb35a115f30cace0faabfa51a5aeefdd69411cf (diff)
downloadfio-0d578085cc7b97b783e1719b205dd563b406ecbc.tar.gz
fio-0d578085cc7b97b783e1719b205dd563b406ecbc.tar.bz2
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 <dmitry.fomichev@wdc.com> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xt/zbd/test-zbd-support9
1 files changed, 8 insertions, 1 deletions
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++))