From 4bea4821abf6b559fa824310a6d6823d1c9a03a5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 14 Jul 2021 16:13:21 +0200 Subject: [PATCH] tests: skip if scsi_debug model file is not accessible * do not print grep(1) info message * use ts_skip rather than ts_die when scsi_debug is useless Fixes: https://github.com/karelzak/util-linux/issues/1376 Signed-off-by: Karel Zak --- tests/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functions.sh b/tests/functions.sh index df692c353..1699ba047 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -966,9 +966,9 @@ function ts_scsi_debug_init { # wait for device if udevadm settle does not work for t in 0 0.02 0.05 0.1 1; do sleep $t - devname=$(grep --with-filename scsi_debug /sys/block/*/device/model) && break + devname=$(grep --no-messages --with-filename scsi_debug /sys/block/*/device/model) && break done - [ -n "${devname}" ] || ts_die "timeout waiting for scsi_debug device" + [ -n "${devname}" ] || ts_skip "timeout waiting for scsi_debug device" devname=$(echo $devname | awk -F '/' '{print $4}') TS_DEVICE="/dev/${devname}"