return 0
}
-# Check that the specified modules are available as loadable modules and not
+# Check that the specified module is available as a loadable module and not
# built-in the kernel.
-_have_modules() {
- local missing=()
- local module
-
- for module in "$@"; do
- if ! _module_file_exists "${module}"; then
- missing+=("$module")
- fi
- done
- if [[ ${#missing} -gt 1 ]]; then
- SKIP_REASONS+=("the following modules are not available: ${missing[*]}")
- return 1
- elif [[ ${#missing} -eq 1 ]]; then
- SKIP_REASONS+=("${missing[0]} module is not available")
+_have_module() {
+ if ! _module_file_exists "${1}"; then
+ SKIP_REASONS+=("${1} module is not available")
return 1
fi
return 0
# scsi_debug helper functions.
_have_scsi_debug() {
- _have_modules scsi_debug
+ _have_module scsi_debug
}
_init_scsi_debug() {
QUICK=1
requires() {
- _have_modules nbd
+ _have_module nbd
}
module_load_and_unload() {
ini_timeout=1
group_requires() {
- local m name p required_modules
+ local m name p
_have_kernel_config_file || return
# Since the nvmeof-mp tests are based on the dm-mpath driver, these
fi
_have_configfs || return
- required_modules=(
- dm_multipath
- dm_queue_length
- dm_service_time
- null_blk
- rdma_cm
- ib_ipoib
- ib_umad
- nvme-rdma
- nvmet-rdma
- rdma_rxe
- scsi_dh_alua
- scsi_dh_emc
- scsi_dh_rdac
- )
- _have_modules "${required_modules[@]}" || return
+
+ _have_module dm_multipath
+ _have_module dm_queue_length
+ _have_module dm_service_time
+ _have_module null_blk
+ _have_module rdma_cm
+ _have_module ib_ipoib
+ _have_module ib_umad
+ _have_module nvme-rdma
+ _have_module nvmet-rdma
+ _have_module rdma_rxe
+ _have_module scsi_dh_alua
+ _have_module scsi_dh_emc
+ _have_module scsi_dh_rdac
for p in mkfs.ext4 mkfs.xfs multipath multipathd pidof rdma fio; do
_have_program "$p" || return
requires() {
# See also iproute commit 4336c5821a7b ("rdma: add 'link add/delete'
# commands").
- _have_modules siw && _have_kver 5 5 && _have_iproute2 190404
+ _have_module siw && _have_kver 5 5 && _have_iproute2 190404
}
test_disconnect_repeatedly() {
}
group_requires() {
- local m name p required_modules
+ local m name p
_have_configfs || return
if is_lio_configured; then
fi
_have_driver sd_mod
_have_driver sg
- required_modules=(
- dm_multipath
- dm_queue_length
- dm_service_time
- ib_ipoib
- ib_srp
- ib_srpt
- ib_umad
- ib_uverbs
- null_blk
- rdma_cm
- rdma_rxe
- scsi_debug
- scsi_dh_alua
- scsi_dh_emc
- scsi_dh_rdac
- target_core_iblock
- target_core_mod
- )
- _have_modules "${required_modules[@]}" || return
+
+ _have_module dm_multipath
+ _have_module dm_queue_length
+ _have_module dm_service_time
+ _have_module ib_ipoib
+ _have_module ib_srp
+ _have_module ib_srpt
+ _have_module ib_umad
+ _have_module ib_uverbs
+ _have_module null_blk
+ _have_module rdma_cm
+ _have_module rdma_rxe
+ _have_module scsi_debug
+ _have_module scsi_dh_alua
+ _have_module scsi_dh_emc
+ _have_module scsi_dh_rdac
+ _have_module target_core_iblock
+ _have_module target_core_mod
for p in mkfs.ext4 mkfs.xfs multipath multipathd pidof rdma \
sg_reset fio; do
requires() {
_have_fio
_have_driver f2fs
- _have_modules null_blk
+ _have_module null_blk
_have_module_param scsi_debug zone_cap_mb
_have_program mkfs.f2fs
_have_scsi_debug