From: Karel Zak Date: Wed, 14 Jul 2021 14:13:21 +0000 (+0200) Subject: tests: skip if scsi_debug model file is not accessible X-Git-Tag: v2.37.1~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bea4821abf6b559fa824310a6d6823d1c9a03a5;p=thirdparty%2Futil-linux.git 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 --- diff --git a/tests/functions.sh b/tests/functions.sh index df692c3532..1699ba0476 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}"