From 1b412cb45ceb198b881e6c724f11daf28e831977 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 28 Sep 2018 14:51:28 -0700 Subject: [PATCH] t/zbd/functions: Make fio_reset_count() return 0 if no resets occurred This patch avoids that certain bash versions report the following complaint: t/zbd/test-zbd-support: line 69: [: : integer expression expected Signed-off-by: Bart Van Assche Cc: Damien Le Moal Signed-off-by: Jens Axboe --- t/zbd/functions | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/zbd/functions b/t/zbd/functions index 95f9bf45..173f0ca6 100644 --- a/t/zbd/functions +++ b/t/zbd/functions @@ -102,5 +102,8 @@ fio_written() { } fio_reset_count() { - sed -n 's/^.*write:[^;]*; \([0-9]*\) zone resets$/\1/p' + local count + + count=$(sed -n 's/^.*write:[^;]*; \([0-9]*\) zone resets$/\1/p') + echo "${count:-0}" } -- 2.25.1