echo "]"
}
+_output_skip_reasons()
+{
+ for reason in "${SKIP_REASONS[@]}"; do
+ echo " $reason"
+ done
+}
+
_output_notrun() {
_output_status "$1" "not run"
- echo " $SKIP_REASON"
+ _output_skip_reasons
}
_output_last_test_run() {
} | column -t -s $'\t'
if [[ $status = "not run" ]]; then
- echo " $SKIP_REASON"
+ _output_skip_reasons
fi
}
# Remove leftovers from last time.
rm -f "${seqres}" "${seqres}."*
- if [[ -v SKIP_REASON ]]; then
+ if [[ -v SKIP_REASONS ]]; then
TEST_RUN["status"]="not run"
else
if [[ -w /dev/kmsg ]]; then
_cleanup
- if [[ -v SKIP_REASON ]]; then
+ if [[ -v SKIP_REASONS ]]; then
TEST_RUN["status"]="not run"
elif ! diff "tests/${TEST_NAME}.out" "${seqres}.out" >/dev/null; then
mv "${seqres}.out" "${seqres}.out.bad"
TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}"
local unset_skip_reason=0
- if [[ ! -v SKIP_REASON ]]; then
+ if [[ ! -v SKIP_REASONS ]]; then
unset_skip_reason=1
if (( !CAN_BE_ZONED )) && _test_dev_is_zoned; then
- SKIP_REASON="${TEST_DEV} is a zoned block device"
+ SKIP_REASONS+=("${TEST_DEV} is a zoned block device")
elif declare -fF device_requires >/dev/null; then
device_requires
fi
ret=1
fi
if (( unset_skip_reason )); then
- unset SKIP_REASON
+ unset SKIP_REASONS
fi
done
if declare -fF group_requires >/dev/null; then
group_requires
- if [[ -v SKIP_REASON ]]; then
+ if [[ -v SKIP_REASONS ]]; then
_output_notrun "${group}/***"
return 0
fi
# shellcheck disable=SC2034
TEST_DEV_PART_SYSFS="${TEST_DEV_PART_SYSFS_DIRS["$TEST_DEV"]}"
group_device_requires
- if [[ -v SKIP_REASON ]]; then
+ if [[ -v SKIP_REASONS ]]; then
_output_notrun "${group}/*** => $(basename "$TEST_DEV")"
unset "TEST_DEVS[$i]"
- unset SKIP_REASON
+ unset SKIP_REASONS
fi
done
# Fix the array indices.
_have_cgroup2()
{
if [[ -z $(_cgroup2_base_dir) ]]; then
- SKIP_REASON="cgroup2 is not mounted"
+ SKIP_REASONS+=("cgroup2 is not mounted")
return 1
fi
return 0
dir="$(_cgroup2_base_dir)"
if ! grep -q "$controller" "$dir/cgroup.controllers"; then
- SKIP_REASON="no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller"
+ SKIP_REASONS+=("no support for $controller cgroup controller; if it is enabled, you may need to boot with cgroup_no_v1=$controller")
return 1
fi
}
echo "+$controller" > "$dir/cgroup.subtree_control"
if [[ ! -f $dir/blktests/$file ]]; then
rmdir "$dir/blktests"
- SKIP_REASON="cgroup file $file doesn't exist"
+ SKIP_REASONS+=("cgroup file $file doesn't exist")
return 1
fi
rmdir "$dir/blktests"
done
if [[ ${#ALL_CPUS[@]} -eq 1 || ${#HOTPLUGGABLE_CPUS[@]} -eq 0 ]]; then
- SKIP_REASON="CPU hotplugging is not supported"
+ SKIP_REASONS+=("CPU hotplugging is not supported")
return 1
fi
return 0
return 1
fi
if ! fio --parse-only --terse-version=4 >/dev/null 2>&1; then
- SKIP_REASON="Fio version too old (does not support --terse-version=4)"
+ SKIP_REASONS+=("Fio version too old (does not support --terse-version=4)")
return 1
fi
return 0
_have_fio_zbd_zonemode() {
_have_fio || return $?
if ! fio --cmdhelp=zonemode 2>&1 | grep -q zbd; then
- SKIP_REASON="Fio version too old (does not support --zonemode=zbd)"
+ SKIP_REASONS+=("Fio version too old (does not support --zonemode=zbd)")
return 1
fi
return 0
return 1
fi
if ! fio --parse-only --name=test --ioengine=pvsync2 --hipri=1 1>/dev/null 2>&1; then
- SKIP_REASON="Fio does not support polling"
+ SKIP_REASONS+=("Fio does not support polling")
return 1
fi
return 0
_require_test_dev_supports_io_poll() {
local old_io_poll
if ! old_io_poll="$(cat "${TEST_DEV_SYSFS}/queue/io_poll" 2>/dev/null)"; then
- SKIP_REASON="kernel does not support polling"
+ SKIP_REASONS+=("kernel does not support polling")
return 1
fi
if ! echo "$old_io_poll" >"${TEST_DEV_SYSFS}/queue/io_poll" 2>/dev/null; then
- SKIP_REASON="$TEST_DEV does not support polling"
+ SKIP_REASONS+=("$TEST_DEV does not support polling")
return 1
fi
return 0
_require_test_dev_supports_io_poll_delay() {
local old_io_poll_delay
if ! old_io_poll_delay="$(cat "${TEST_DEV_SYSFS}/queue/io_poll_delay" 2>/dev/null)"; then
- SKIP_REASON="kernel does not support hybrid polling"
+ SKIP_REASONS+=("kernel does not support hybrid polling")
return 1
fi
if ! echo "$old_io_poll_delay" >"${TEST_DEV_SYSFS}/queue/io_poll_delay" 2>/dev/null; then
- SKIP_REASON="$TEST_DEV does not support hybrid polling"
+ SKIP_REASONS+=("$TEST_DEV does not support hybrid polling")
return 1
fi
return 0
_have_legacy_dm() {
_have_kernel_config_file || return
if ! _check_kernel_option DM_MQ_DEFAULT; then
- SKIP_REASON="legacy device mapper support is missing"
+ SKIP_REASONS+=("legacy device mapper support is missing")
return 1
fi
}
if version_le "$min_ver" "$mp_ver"; then
return 0
fi
- SKIP_REASON="Need multipathd version $min_ver; found multipathd version $mp_ver."
+ SKIP_REASONS+=("Need multipathd version $min_ver; found multipathd version $mp_ver.")
return 1
}
if (( RUN_FOR_ZONED )); then zoned="zoned=1"; fi
if ! modprobe -r null_blk || ! modprobe null_blk "$@" "${zoned}" ; then
- SKIP_REASON="requires modular null_blk"
+ SKIP_REASONS+=("requires modular null_blk")
return 1
fi
_have_root() {
if [[ $EUID -ne 0 ]]; then
- SKIP_REASON="not running as root"
+ SKIP_REASONS+=("not running as root")
return 1
fi
return 0
local modname="${1/-/_}"
if [ ! -d "/sys/module/${modname}" ] && ! modprobe -q "${modname}"; then
- SKIP_REASON="driver ${modname} is not available"
+ SKIP_REASONS+=("driver ${modname} is not available")
return 1
fi
fi
done
if [[ ${#missing} -gt 1 ]]; then
- SKIP_REASON="the following modules are not available: ${missing[*]}"
+ SKIP_REASONS+=("the following modules are not available: ${missing[*]}")
return 1
elif [[ ${#missing} -eq 1 ]]; then
- SKIP_REASON="${missing[0]} module is not available"
+ SKIP_REASONS+=("${missing[0]} module is not available")
return 1
fi
return 0
fi
if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then
- SKIP_REASON="$1 module does not have parameter $2"
+ SKIP_REASONS+=("$1 module does not have parameter $2")
return 1
fi
return 0
value=$(cat "/sys/module/$modname/parameters/$param")
if [[ "${value}" != "$expected_value" ]]; then
- SKIP_REASON="$modname module parameter $param must be set to $expected_value"
+ SKIP_REASONS+=("$modname module parameter $param must be set to $expected_value")
return 1
fi
if command -v "$1" >/dev/null 2>&1; then
return 0
fi
- SKIP_REASON="$1 is not available"
+ SKIP_REASONS+=("$1 is not available")
return 1
}
local snapshot
if ! snapshot=$(ip -V | sed 's/ip utility, iproute2-ss//'); then
- SKIP_REASON="ip utility not found"
+ SKIP_REASONS+=("ip utility not found")
return 1
fi
if [[ "$snapshot" =~ ^[0-9]+$ && "$snapshot" -lt "$1" ]]; then
- SKIP_REASON="ip utility too old"
+ SKIP_REASONS+=("ip utility too old")
return 1
fi
return 0
_have_src_program() {
if [[ ! -x "$SRCDIR/$1" ]]; then
- SKIP_REASON="$1 was not built; run \`make\`"
+ SKIP_REASONS+=("$1 was not built; run \`make\`")
return 1
fi
return 0
# CONFIG_BLK_DEV_IO_TRACE might still be disabled, but this is easier
# to check. We can fix it if someone complains.
if [[ ! -d /sys/kernel/debug/block ]]; then
- SKIP_REASON="CONFIG_DEBUG_FS is not enabled"
+ SKIP_REASONS+=("CONFIG_DEBUG_FS is not enabled")
return 1
fi
_have_program blktrace
_have_configfs() {
if ! findmnt -t configfs /sys/kernel/config >/dev/null; then
- SKIP_REASON="configfs is not mounted at /sys/kernel/config"
+ SKIP_REASONS+=("configfs is not mounted at /sys/kernel/config")
return 1
fi
return 0
# Check if the specified kernel config files are available.
_have_kernel_config_file() {
if [[ ! -f /proc/config.gz && ! -f /boot/config-$(uname -r) ]]; then
- SKIP_REASON="kernel $(uname -r) config not found"
+ SKIP_REASONS+=("kernel $(uname -r) config not found")
return 1
fi
_have_kernel_config_file || return
if ! _check_kernel_option "$opt"; then
- SKIP_REASON="kernel option $opt has not been enabled"
+ SKIP_REASONS+=("kernel option $opt has not been enabled")
return 1
fi
IFS='.' read -r a b c < <(uname -r | sed 's/-.*//')
if [ $((a * 65536 + b * 256 + c)) -lt $((d * 65536 + e * 256 + f)) ];
then
- SKIP_REASON="Kernel version too old"
+ SKIP_REASONS+=("Kernel version too old")
return 1
fi
}
_have_tracefs() {
stat /sys/kernel/debug/tracing/trace > /dev/null 2>&1
if ! findmnt -t tracefs /sys/kernel/debug/tracing >/dev/null; then
- SKIP_REASON="tracefs is not mounted at /sys/kernel/debug/tracing"
+ SKIP_REASONS+=("tracefs is not mounted at /sys/kernel/debug/tracing")
return 1
fi
return 0
local event=$1
if [[ ! -d /sys/kernel/debug/tracing/events/${event} ]]; then
- SKIP_REASON="tracepoint ${event} does not exist"
+ SKIP_REASONS+=("tracepoint ${event} does not exist")
return 1
fi
return 0
_have_fs() {
modprobe "$1" >/dev/null 2>&1
if [[ ! -d "/sys/fs/$1" ]]; then
- SKIP_REASON="kernel does not support filesystem $1"
+ SKIP_REASONS+=("kernel does not support filesystem $1")
return 1
fi
}
if [[ $(nproc) -ge $1 ]]; then
return 0
fi
- SKIP_REASON="minimum $1 cpus required"
+ SKIP_REASONS+=("minimum $1 cpus required")
return 1
}
_require_test_dev_is_rotational() {
if ! _test_dev_is_rotational; then
- SKIP_REASON="$TEST_DEV is not rotational"
+ SKIP_REASONS+=("$TEST_DEV is not rotational")
return 1
fi
return 0
_require_test_dev_can_discard() {
if ! _test_dev_can_discard; then
- SKIP_REASON="$TEST_DEV does not support discard"
+ SKIP_REASONS+=("$TEST_DEV does not support discard")
return 1
fi
return 0
fi
fi
- SKIP_REASON="$TEST_DEV is not a PCI device"
+ SKIP_REASONS+=("$TEST_DEV is not a PCI device")
return 1
fi
return 0
local slt_cap
slt_cap="$(setpci -s "${parent}" CAP_EXP+14.w)"
if [[ $((0x${slt_cap} & 0x60)) -ne $((0x60)) ]]; then
- SKIP_REASON="$TEST_DEV is not in a hot pluggable slot"
+ SKIP_REASONS+=("$TEST_DEV is not in a hot pluggable slot")
return 1
fi
return 0
_require_test_dev_is_partition() {
if ! _test_dev_is_partition; then
- SKIP_REASON="${TEST_DEV} is not a partition device"
+ SKIP_REASONS+=("${TEST_DEV} is not a partition device")
return 1
fi
return 0
_have_writeable_kmsg() {
if [[ ! -w /dev/kmsg ]]; then
- SKIP_REASON="cannot write to /dev/kmsg"
+ SKIP_REASONS+=("cannot write to /dev/kmsg")
return 1
fi
return 0
# Suppress unused global variable warnings.
_silence_sc2034() {
- echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASON ${TEST_RUN[*]} $TIMED" > /dev/null
+ echo "$CAN_BE_ZONED $CGROUP2_DIR $CHECK_DMESG $DESCRIPTION $DMESG_FILTER $FIO_PERF_FIELDS $FIO_PERF_PREFIX $QUICK $SKIP_REASONS ${TEST_RUN[*]} $TIMED" > /dev/null
}
# TODO: if this test group has any extra requirements, it should define a
# group_requires() function. If tests in this group cannot be run,
-# group_requires() should set the \$SKIP_REASON variable.
+# group_requires() should add strings to the \$SKIP_REASONS array which
+# describe why the group cannot be run.
#
# Usually, group_requires() just needs to check that any necessary programs and
# kernel features are available using the _have_foo helpers. If
-# group_requires() sets \$SKIP_REASON, all tests in this group will be skipped.
+# group_requires() adds strings to \$SKIP_REASONS, all tests in this group will
+# be skipped.
group_requires() {
_have_root
}
# TODO: if this test group has extra requirements for what devices it can be
# run on, it should define a group_device_requires() function. If tests in this
-# group cannot be run on the test device, it should set the \$SKIP_REASON
-# variable. \$TEST_DEV is the full path of the block device (e.g., /dev/nvme0n1
-# or /dev/sda1), and \$TEST_DEV_SYSFS is the sysfs path of the disk (not the
-# partition, e.g., /sys/block/nvme0n1 or /sys/block/sda). If the target device
-# is a partition device, \$TEST_DEV_PART_SYSFS is the sysfs path of the
-# partition device (e.g., /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1).
-# Otherwise, \$TEST_DEV_PART_SYSFS is an empty string.
+# group cannot be run on the test device, it should add strings to
+# \$SKIP_REASONS. \$TEST_DEV is the full path of the block device (e.g.,
+# /dev/nvme0n1 or /dev/sda1), and \$TEST_DEV_SYSFS is the sysfs path of the
+# disk (not the partition, e.g., /sys/block/nvme0n1 or /sys/block/sda). If
+# the target device is a partition device, \$TEST_DEV_PART_SYSFS is the sysfs
+# path of the partition device (e.g., /sys/block/nvme0n1/nvme0n1p1 or
+# /sys/block/sda/sda1). Otherwise, \$TEST_DEV_PART_SYSFS is an empty string.
#
# Usually, group_device_requires() just needs to check that the test device is
# the right type of hardware or supports any necessary features using the
-# _require_test_dev_foo helpers. If group_device_requires() sets \$SKIP_REASON,
-# all tests in this group will be skipped on that device.
+# _require_test_dev_foo helpers. If group_device_requires() adds strings to
+# \$SKIP_REASONS, all tests in this group will be skipped on that device.
# group_device_requires() {
# _require_test_dev_is_foo && _require_test_dev_supports_bar
# }
# CAN_BE_ZONED=1
# TODO: if this test has any extra requirements, it should define a requires()
-# function. If the test cannot be run, requires() should set the \$SKIP_REASON
-# variable. Usually, requires() just needs to check that any necessary programs
-# and kernel features are available using the _have_foo helpers. If requires()
-# sets \$SKIP_REASON, the test is skipped.
+# function. If the test cannot be run, requires() should add strings to
+# \$SKIP_REASONS. Usually, requires() just needs to check that any necessary
+# programs and kernel features are available using the _have_foo helpers.
+# If requires() adds strings to \$SKIP_REASONS, the test is skipped.
# requires() {
# _have_foo
# }
# TODO: if this test has extra requirements for what devices it can be run on,
# it should define a device_requires() function. If this test cannot be run on
-# the test device, it should set \$SKIP_REASON. \$TEST_DEV is the full path of
-# the block device (e.g., /dev/nvme0n1 or /dev/sda1), and \$TEST_DEV_SYSFS is
-# the sysfs path of the disk (not the partition, e.g., /sys/block/nvme0n1 or
-# /sys/block/sda). If the target device is a partition device,
-# \$TEST_DEV_PART_SYSFS is the sysfs path of the partition device (e.g.,
-# /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1). Otherwise,
+# the test device, it should add strings to \$SKIP_REASONS. \$TEST_DEV is the
+# full path of the block device (e.g., /dev/nvme0n1 or /dev/sda1), and
+# \$TEST_DEV_SYSFS is the sysfs path of the disk (not the partition, e.g.,
+# /sys/block/nvme0n1 or /sys/block/sda). If the target device is a partition
+# device, \$TEST_DEV_PART_SYSFS is the sysfs path of the partition device
+# (e.g., /sys/block/nvme0n1/nvme0n1p1 or /sys/block/sda/sda1). Otherwise,
# \$TEST_DEV_PART_SYSFS is an empty string.
#
# Usually, device_requires() just needs to check that the test device is the
# right type of hardware or supports any necessary features using the
-# _require_test_dev_foo helpers. If device_requires() sets \$SKIP_REASON, the
-# test will be skipped on that device.
+# _require_test_dev_foo helpers. If device_requires() adds strings to
+# \$SKIP_REASONS, the test will be skipped on that device.
# device_requires() {
# _require_test_dev_is_foo && _require_test_dev_supports_bar
# }
# failure. You should prefer letting the test fail because of broken output
# over, say, checking the exit status of every command you run.
#
-# If the test cannot be run, this function may set the \$SKIP_REASON variable
+# If the test cannot be run, this function may add strings to \$SKIP_REASONS
# and return. In that case, the return value and output are ignored, and the
# test is considered skipped. This should only be done when the requirements
# can only be detected with a non-trivial amount of setup; use
{ nproc > $sq; } >>"$FULL" 2>&1
done
else
- SKIP_REASON="Skipping test because $sq cannot be modified"
+ SKIP_REASONS+=("Skipping test because $sq cannot be modified")
fi
rmdir /sys/kernel/config/nullb/nullb0
_exit_null_blk
_have_loop_set_block_size() {
src/loblksize "$(losetup -f)" 512 &>/dev/null
if [[ $? -eq 2 ]]; then
- SKIP_REASON="kernel does not support LOOP_SET_BLOCK_SIZE"
+ SKIP_REASONS+=("kernel does not support LOOP_SET_BLOCK_SIZE")
return 1
fi
return 0
DESCRIPTION="skip in requires()"
requires() {
- SKIP_REASON="(╯°□°)╯︵ ┻━┻"
+ SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻")
}
test() {
DESCRIPTION="skip in device_requires()"
device_requires() {
- SKIP_REASON="(╯°□°)╯︵ $TEST_DEV ┻━┻"
+ SKIP_REASONS+=("(╯°□°)╯︵ $TEST_DEV ┻━┻")
}
test_device() {
DESCRIPTION="skip test_device() in requires()"
requires() {
- SKIP_REASON="(╯°□°)╯︵ ┻━┻"
+ SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻")
}
test_device() {
DESCRIPTION="skip in test()"
test() {
- SKIP_REASON="(╯°□°)╯︵ ┻━┻"
+ SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻")
}
DESCRIPTION="skip in test_device()"
test_device() {
- SKIP_REASON="(╯°□°)╯︵ ┻━┻"
+ SKIP_REASONS+=("(╯°□°)╯︵ ┻━┻")
}
group_requires() {
if [[ "${META_REQUIRES_SKIP:-}" ]]; then
- SKIP_REASON="META_REQUIRES_SKIP was set"
+ SKIP_REASONS+=("META_REQUIRES_SKIP was set")
fi
}
group_device_requires() {
if [[ "${META_DEVICE_REQUIRES_SKIP:-}" ]]; then
- SKIP_REASON="META_DEVICE_REQUIRES_SKIP was set"
+ SKIP_REASONS+=("META_DEVICE_REQUIRES_SKIP was set")
fi
}
return 1
fi
if ! nbd-client --help 2>&1 | grep -q -- -L; then
- SKIP_REASON="nbd-client does not have -nonetlink/-L option"
+ SKIP_REASONS+=("nbd-client does not have -nonetlink/-L option")
return 1
fi
return 0
return 1
fi
if ! genl-ctrl-list | grep -q nbd; then
- SKIP_REASON="nbd does not support netlink"
+ SKIP_REASONS+=("nbd does not support netlink")
return 1
fi
return 0
_have_driver rdma_rxe || _have_driver siw
;;
*)
- SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}"
+ SKIP_REASONS+=("unsupported nvme_trtype=${nvme_trtype}")
return 1
esac
# ignore for non ip transports
if [[ "${nvme_trtype}" == "tcp" ||
"${nvme_trtype}" == "rdma" ]]; then
- SKIP_REASON="unsupported nvme_adrfam=${nvme_adrfam}"
+ SKIP_REASONS+=("unsupported nvme_adrfam=${nvme_adrfam}")
return 1
fi
esac
_require_test_dev_is_nvme() {
if ! readlink -f "$TEST_DEV_SYSFS/device" | grep -q nvme; then
- SKIP_REASON="$TEST_DEV is not a NVMe device"
+ SKIP_REASONS+=("$TEST_DEV is not a NVMe device")
return 1
fi
return 0
_require_nvme_trtype_is_loop() {
if [[ "${nvme_trtype}" != "loop" ]]; then
- SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test"
+ SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
return 1
fi
return 0
_require_nvme_trtype_is_fabrics() {
if [[ "${nvme_trtype}" == "pci" ]]; then
- SKIP_REASON="nvme_trtype=${nvme_trtype} is not supported in this test"
+ SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
return 1
fi
return 0
# option with multipathing enabled in the nvme_core kernel module.
if _check_kernel_option NVME_MULTIPATH && \
_have_module_param_value nvme_core multipath Y; then
- SKIP_REASON="CONFIG_NVME_MULTIPATH has been set in .config \
-and multipathing has been enabled in the nvme_core kernel module"
+ SKIP_REASONS+=("CONFIG_NVME_MULTIPATH has been set in .config and multipathing has been enabled in the nvme_core kernel module")
return
fi
# shellcheck disable=SC2043
for name in multipathd; do
if pidof "$name" >/dev/null; then
- SKIP_REASON="$name must be stopped before the nvmeof-mp tests are run"
+ SKIP_REASONS+=("$name must be stopped before the nvmeof-mp tests are run")
return
fi
done
if [ -e /etc/multipath.conf ] &&
! diff -q /etc/multipath.conf tests/nvmeof-mp/multipath.conf >&/dev/null
then
- SKIP_REASON="/etc/multipath.conf already exists"
+ SKIP_REASONS+=("/etc/multipath.conf already exists")
return
fi
}
_require_test_dev_is_scsi() {
if [[ ! -d ${TEST_DEV_SYSFS}/device/scsi_device ]]; then
- SKIP_REASON="$TEST_DEV is not a SCSI device"
+ SKIP_REASONS+=("$TEST_DEV is not a SCSI device")
return 1
fi
return 0
_require_test_dev_is_scsi_disk() {
if [[ ! -d ${TEST_DEV_SYSFS}/device/scsi_disk ]]; then
- SKIP_REASON="$TEST_DEV is not a SCSI disk"
+ SKIP_REASONS+=("$TEST_DEV is not a SCSI disk")
return 1
fi
return 0
done
for mq in y n; do
if [ $mq = n ] && ! _have_legacy_dm; then
- unset SKIP_REASON
+ unset SKIP_REASONS
continue
fi
use_blk_mq ${mq} ${mq} || return $?
_have_configfs || return
if is_lio_configured; then
- SKIP_REASON="LIO must be unloaded before the SRP tests are run"
+ SKIP_REASONS+=("LIO must be unloaded before the SRP tests are run")
return
fi
required_modules=(
for name in srp_daemon multipathd; do
if pidof "$name" >/dev/null; then
- SKIP_REASON="$name must be stopped before the SRP tests are run"
+ SKIP_REASONS+=("$name must be stopped before the SRP tests are run")
return
fi
done
if [ -e /etc/multipath.conf ] &&
! diff -q /etc/multipath.conf tests/srp/multipath.conf >&/dev/null
then
- SKIP_REASON="/etc/multipath.conf already exists"
+ SKIP_REASONS+=("/etc/multipath.conf already exists")
return
fi
}
# Find target sequential required zones and reset write pointers
_get_blkzone_report "${TEST_DEV}" || return $?
if ! idx=$(_find_two_contiguous_seq_zones cap_eq_len); then
- SKIP_REASON="No contiguous sequential write required zones"
+ SKIP_REASONS+=("No contiguous sequential write required zones")
_put_blkzone_report
return
fi
group_device_requires() {
if ! _test_dev_is_zoned; then
- SKIP_REASON="${TEST_DEV} is not a zoned block device"
+ SKIP_REASONS+=("${TEST_DEV} is not a zoned block device")
return
fi
}
_require_test_dev_is_logical() {
if ! _test_dev_is_partition && ! _test_dev_is_dm; then
- SKIP_REASON="$TEST_DEV is not a logical device"
+ SKIP_REASONS+=("$TEST_DEV is not a logical device")
return 1
fi
return 0