[PATCH 1/6] t/zbd/functions: Make fio_reset_count() return 0 if no resets occurred

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <bvanassche@xxxxxxx>
Cc: Damien Le Moal <damien.lemoal@xxxxxxx>
---
 t/zbd/functions | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/zbd/functions b/t/zbd/functions
index 95f9bf456b9a..173f0ca64a42 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.19.0.605.g01d371f741-goog




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux