diff mbox series

[1/3] blktests: nvme: skip passthru tests on multipath devices

Message ID 20240822193814.106111-1-mwilck@suse.com (mailing list archive)
State New
Headers show
Series [1/3] blktests: nvme: skip passthru tests on multipath devices | expand

Commit Message

Martin Wilck Aug. 22, 2024, 7:38 p.m. UTC
NVMe multipath devices have no associated character device that
can be used for NVMe passtrhu. Skip them.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 tests/nvme/033 | 4 ++++
 tests/nvme/034 | 4 ++++
 tests/nvme/035 | 1 +
 tests/nvme/036 | 4 ++++
 tests/nvme/037 | 4 ++++
 tests/nvme/039 | 4 ++++
 tests/nvme/rc  | 8 ++++++++
 7 files changed, 29 insertions(+)

Comments

Daniel Wagner Aug. 23, 2024, 6:35 a.m. UTC | #1
On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> +_require_test_dev_is_nvme_no_mpath() {
> +	if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then
> +		SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device")
> +		return 1
> +	fi
> +	return 0
> +}

Just a nit: what about _require_test_dev_is_native_multipath?
Martin Wilck Aug. 23, 2024, 6:41 a.m. UTC | #2
On Fri, 2024-08-23 at 08:35 +0200, Daniel Wagner wrote:
> On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> > +_require_test_dev_is_nvme_no_mpath() {
> > +	if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-
> > subsystem/ ]]; then
> > +		SKIP_REASONS+=("$TEST_DEV is a NVMe multipath
> > device")
> > +		return 1
> > +	fi
> > +	return 0
> > +}
> 
> Just a nit: what about _require_test_dev_is_native_multipath?

The intention was to require a device that is _not_ a native multipath
device. Change it to "_require_test_dev_is_not_native_multipath"?

Thanks,
Martin
Daniel Wagner Aug. 23, 2024, 7:07 a.m. UTC | #3
On Fri, Aug 23, 2024 at 08:41:59AM GMT, Martin Wilck wrote:
> On Fri, 2024-08-23 at 08:35 +0200, Daniel Wagner wrote:
> > On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> > > +_require_test_dev_is_nvme_no_mpath() {
> > > +	if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-
> > > subsystem/ ]]; then
> > > +		SKIP_REASONS+=("$TEST_DEV is a NVMe multipath
> > > device")
> > > +		return 1
> > > +	fi
> > > +	return 0
> > > +}
> > 
> > Just a nit: what about _require_test_dev_is_native_multipath?
> 
> The intention was to require a device that is _not_ a native multipath
> device. Change it to "_require_test_dev_is_not_native_multipath"?

I confused mpath with dm-mpath when I read the function name. Doesn't
make any sence obviously but still got me confused. I prefer the more
explicit function name you suggested. But let's here what others say.
diff mbox series

Patch

diff --git a/tests/nvme/033 b/tests/nvme/033
index 7a69b94..dda0763 100755
--- a/tests/nvme/033
+++ b/tests/nvme/033
@@ -13,6 +13,10 @@  requires() {
 	_have_kernel_option NVME_TARGET_PASSTHRU
 }
 
+device_requires() {
+	_require_test_dev_is_nvme_no_mpath
+}
+
 set_conditions() {
 	_set_nvme_trtype "$@"
 }
diff --git a/tests/nvme/034 b/tests/nvme/034
index 239757c..41f1542 100755
--- a/tests/nvme/034
+++ b/tests/nvme/034
@@ -14,6 +14,10 @@  requires() {
 	_have_fio
 }
 
+device_requires() {
+	_require_test_dev_is_nvme_no_mpath
+}
+
 set_conditions() {
 	_set_nvme_trtype "$@"
 }
diff --git a/tests/nvme/035 b/tests/nvme/035
index 8286178..4357efa 100755
--- a/tests/nvme/035
+++ b/tests/nvme/035
@@ -17,6 +17,7 @@  requires() {
 }
 
 device_requires() {
+	_require_test_dev_is_nvme_no_mpath
 	_require_test_dev_size "${NVME_IMG_SIZE}"
 }
 
diff --git a/tests/nvme/036 b/tests/nvme/036
index ef6c29d..3a28cb7 100755
--- a/tests/nvme/036
+++ b/tests/nvme/036
@@ -13,6 +13,10 @@  requires() {
 	_have_kernel_option NVME_TARGET_PASSTHRU
 }
 
+device_requires() {
+	_require_test_dev_is_nvme_no_mpath
+}
+
 set_conditions() {
 	_set_nvme_trtype "$@"
 }
diff --git a/tests/nvme/037 b/tests/nvme/037
index ef7ac59..557d491 100755
--- a/tests/nvme/037
+++ b/tests/nvme/037
@@ -12,6 +12,10 @@  requires() {
 	_have_kernel_option NVME_TARGET_PASSTHRU
 }
 
+device_requires() {
+	_require_test_dev_is_nvme_no_mpath
+}
+
 set_conditions() {
 	_set_nvme_trtype "$@"
 }
diff --git a/tests/nvme/039 b/tests/nvme/039
index a0f135c..ff8c1eb 100755
--- a/tests/nvme/039
+++ b/tests/nvme/039
@@ -18,6 +18,10 @@  requires() {
 	    _have_kernel_option FAULT_INJECTION_DEBUG_FS
 }
 
+device_requires() {
+	_require_test_dev_is_nvme_no_mpath
+}
+
 # Get the last dmesg lines as many as specified. Exclude the lines to indicate
 # suppression by rate limit.
 last_dmesg()
diff --git a/tests/nvme/rc b/tests/nvme/rc
index dedc412..b3b1149 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -130,6 +130,14 @@  _require_test_dev_is_nvme() {
 	return 0
 }
 
+_require_test_dev_is_nvme_no_mpath() {
+	if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then
+		SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device")
+		return 1
+	fi
+	return 0
+}
+
 _require_nvme_test_img_size() {
 	local require_sz_mb
 	local nvme_img_size_mb