mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
tests: review every instance of $?
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13259
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user