From 0a2cbbd1874d6c20e809ae9aa66930c732a23f22 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 30 Oct 2018 13:04:52 -0700 Subject: [PATCH] srp and nvmeof-mp: Check whether legacy dm is supported Kernel commit 6a23e05c2fe3 ("dm: remove legacy request-based IO path") retained dm-mq but removed the legacy dm code. Skip those tests that require the legacy dm code. Signed-off-by: Bart Van Assche --- common/multipath-over-rdma | 9 +++++++++ tests/nvmeof-mp/004 | 4 ++++ tests/srp/003 | 4 ++++ tests/srp/004 | 4 ++++ tests/srp/012 | 1 + 5 files changed, 22 insertions(+) diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index b9cd06b..2bb53ab 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -4,6 +4,8 @@ # # Functions and global variables used by both the srp and nvmeof-mp tests. +. common/shellcheck + debug= filesystem_type=ext4 fio_aux_path=/tmp/fio-state-files @@ -14,6 +16,13 @@ if [ $ramdisk_size -gt $max_ramdisk_size ]; then ramdisk_size=$max_ramdisk_size fi +_have_legacy_dm() { + if ! _have_kernel_option DM_MQ_DEFAULT; then + SKIP_REASON="legacy device mapper support is missing" + return 1 + fi +} + get_ipv4_addr() { ip -4 -o addr show dev "$1" | sed -n 's/.*[[:blank:]]inet[[:blank:]]*\([^[:blank:]/]*\).*/\1/p' diff --git a/tests/nvmeof-mp/004 b/tests/nvmeof-mp/004 index 9088cc7..990fcfc 100755 --- a/tests/nvmeof-mp/004 +++ b/tests/nvmeof-mp/004 @@ -7,6 +7,10 @@ DESCRIPTION="File I/O on top of multipath concurrently with logout and login (sq-on-mq)" TIMED=1 +requires() { + _have_legacy_dm +} + test_disconnect_repeatedly() { local dev fio_status m diff --git a/tests/srp/003 b/tests/srp/003 index 6149b2e..51e9ee0 100755 --- a/tests/srp/003 +++ b/tests/srp/003 @@ -7,6 +7,10 @@ DESCRIPTION="File I/O on top of multipath concurrently with logout and login (sq)" TIMED=1 +requires() { + _have_legacy_dm +} + test_disconnect_repeatedly() { local dev fio_status m diff --git a/tests/srp/004 b/tests/srp/004 index 49d7b1f..b500d64 100755 --- a/tests/srp/004 +++ b/tests/srp/004 @@ -7,6 +7,10 @@ DESCRIPTION="File I/O on top of multipath concurrently with logout and login (sq-on-mq)" TIMED=1 +requires() { + _have_legacy_dm +} + test_disconnect_repeatedly() { local dev fio_status m diff --git a/tests/srp/012 b/tests/srp/012 index f50026f..20c6daf 100755 --- a/tests/srp/012 +++ b/tests/srp/012 @@ -15,6 +15,7 @@ test_io_schedulers() { modprobe "$(basename "$m")" >&/dev/null done for mq in y n; do + [ $mq = n ] && ! _have_legacy_dm && continue use_blk_mq ${mq} ${mq} || return $? dev=$(get_bdev 0) || return $? for sched in noop deadline bfq cfq; do -- 2.51.0