]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: let lsmod fail silently
authorRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 7 Nov 2016 08:35:17 +0000 (09:35 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Nov 2016 09:51:43 +0000 (10:51 +0100)
This is mostly for non-Linux systems where lsmod is not
even available.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/functions.sh

index fe3ff5751eadf0300c44562e8064a2d0957ab857..9239ab4f6d1be91ed1c0a8b74b879c370482f03a 100644 (file)
@@ -654,7 +654,7 @@ function ts_scsi_debug_init {
                || ts_skip "cannot load scsi_debug module (modprobe)"
 
        # it might be still not loaded, modprobe.conf or whatever
-       lsmod | grep -q "^scsi_debug " \
+       lsmod 2>/dev/null | grep -q "^scsi_debug " \
                || ts_skip "scsi_debug module not loaded (lsmod)"
 
        udevadm settle
@@ -683,7 +683,7 @@ function ts_scsi_debug_rmmod {
        # not exist at all.
        [ $UID -eq 0 ] || return 0
        [ -n "$TS_DEVICE" ] || return 0
-       lsmod | grep -q "^scsi_debug " || return 0
+       lsmod 2>/dev/null | grep -q "^scsi_debug " || return 0
 
        udevadm settle