]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: skip if scsi_debug model file is not accessible
authorKarel Zak <kzak@redhat.com>
Wed, 14 Jul 2021 14:13:21 +0000 (16:13 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 20 Jul 2021 09:58:48 +0000 (11:58 +0200)
* 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 <kzak@redhat.com>
tests/functions.sh

index df692c35329519f635b7df43ef4d87a691ddaa11..1699ba0476af6c9d5a81a59917fc4e5986062648 100644 (file)
@@ -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}"