Re: [PATCH 2/2] tests/scsi/0001: Regression test for SCSI device blacklisting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2017-08-09 at 12:50 +0200, Hannes Reinecke wrote:
> +requires() {
> +    if modinfo scsi_debug | grep -q inq_vendor ; then
> +	return 0
> +    fi
> +    return 1
> +}

How about changing the above four statements into the following, which is
shorter and more robust?

modinfo scsi_debug | grep -q '^parm:[[:blank:]]*inq_vendor:'

> +	modprobe scsi_debug inq_vendor="$vendor" inq_product="$model"
> +	host=$(lsscsi -H | sed -n 's/.\([0-9]*\).*scsi_debug/\1/p')

Not all systems have lsscsi. How about using /sys/bus/pseudo/drivers/scsi_debug/adapter0/host*
instead?

> +	rmmod scsi_debug

Please check the rmmod return value to catch unload failures due to a
user space process having opened the SCSI device created by scsi_debug.

Thanks,

Bart.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux