aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/blkdev.shlib
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-03-23 01:52:39 +0100
committerBrian Behlendorf <[email protected]>2022-04-01 17:59:30 -0700
commit23914a3b9146c05ddf985b134472b6c885cefdfe (patch)
treebafac5070cfb9974aca777af660204e8085e95cf /tests/zfs-tests/include/blkdev.shlib
parent6586085673db2e2d7e66652855d449b4abaab467 (diff)
tests: review every instance of $?
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13259
Diffstat (limited to 'tests/zfs-tests/include/blkdev.shlib')
-rw-r--r--tests/zfs-tests/include/blkdev.shlib19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib
index a97d1582d..3e11d1548 100644
--- a/tests/zfs-tests/include/blkdev.shlib
+++ b/tests/zfs-tests/include/blkdev.shlib
@@ -45,9 +45,7 @@ function scan_scsi_hosts
log_must eval "echo '- - -' > $host/scan"
done
else
- log_must eval \
- "echo /sys/class/scsi_host/host$hostnum/scan" \
- > /dev/null
+ log_note "/sys/class/scsi_host/host$hostnum/scan"
log_must eval \
"echo '- - -' > /sys/class/scsi_host/host$hostnum/scan"
fi
@@ -176,13 +174,11 @@ function is_mpath_device #disk
[[ -z $disk ]] && log_fail "No argument for disk given."
if is_linux; then
- lsblk $DEV_MPATHDIR/$disk -o TYPE 2>/dev/null | \
- grep -q mpath
- if (($? == 0)); then
+ if lsblk $DEV_MPATHDIR/$disk -o TYPE 2>/dev/null | \
+ grep -q mpath; then
readlink $DEV_MPATHDIR/$disk > /dev/null 2>&1
- return $?
else
- return $?
+ false
fi
elif is_freebsd; then
is_disk_device $DEV_MPATHDIR/$disk
@@ -438,11 +434,8 @@ function load_scsi_debug # dev_size_mb add_host num_tgts max_luns blksz
esac
if is_linux; then
- modprobe -n scsi_debug
- if (($? != 0)); then
- log_unsupported "Platform does not have scsi_debug"
- "module"
- fi
+ modprobe -n scsi_debug ||
+ log_unsupported "Platform does not have scsi_debug module"
if lsmod | grep -q scsi_debug; then
log_fail "scsi_debug module already installed"
else