From: John Garry <john.g.garry@oracle.com>
To: linux-block@vger.kernel.org, shinichiro.kawasaki@wdc.com
Cc: John Garry <john.g.garry@oracle.com>
Subject: [PATCH blktests 4/7] md/003: add NVMe atomic write tests for stacked devices
Date: Fri, 12 Sep 2025 09:57:26 +0000 [thread overview]
Message-ID: <20250912095729.2281934-5-john.g.garry@oracle.com> (raw)
In-Reply-To: <20250912095729.2281934-1-john.g.garry@oracle.com>
md/002 only tests SCSI via scsi_debug.
It is also useful to test NVMe, so add a specific test for that.
The results for 002 and 003 should be the same, so link them.
_md_atomics_test requires 4x devices with atomics support, so check for
that.
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
tests/md/002 | 2 +-
tests/md/002.out | 2 +-
tests/md/003 | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
tests/md/003.out | 1 +
4 files changed, 54 insertions(+), 2 deletions(-)
create mode 100755 tests/md/003
create mode 120000 tests/md/003.out
diff --git a/tests/md/002 b/tests/md/002
index 990b64b..87b13f2 100755
--- a/tests/md/002
+++ b/tests/md/002
@@ -24,7 +24,7 @@ test() {
per_host_store=true
)
- echo "Running ${TEST_NAME}"
+ echo "Running md_atomics_test"
if ! _configure_scsi_debug "${scsi_debug_params[@]}"; then
return 1
diff --git a/tests/md/002.out b/tests/md/002.out
index cd34e38..b311a50 100644
--- a/tests/md/002.out
+++ b/tests/md/002.out
@@ -1,4 +1,4 @@
-Running md/002
+Running md_atomics_test
TEST 1 raid0 step 1 - Verify md sysfs atomic attributes matches - pass
TEST 2 raid0 step 1 - Verify sysfs atomic attributes - pass
TEST 3 raid0 step 1 - Verify md sysfs_atomic_write_max is equal to expected_atomic_write_max - pass
diff --git a/tests/md/003 b/tests/md/003
new file mode 100755
index 0000000..8128f8d
--- /dev/null
+++ b/tests/md/003
@@ -0,0 +1,51 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Oracle and/or its affiliates
+#
+# Test NMVe Atomic Writes with MD devices
+
+. tests/nvme/rc
+. common/xfs
+
+DESCRIPTION="test md atomic writes for NVMe drives"
+QUICK=1
+
+requires() {
+ _nvme_requires
+}
+
+test() {
+ local ns
+ local testdev_count=0
+ declare -A NVME_TEST_DEVS
+ declare -A NVME_TEST_DEVS_NAME
+ declare -A NVME_TEST_DEVS_SYSFS
+
+ echo "Running md_atomics_test"
+
+ for i in "${!TEST_DEV_SYSFS_DIRS[@]}"; do
+ TEST_DEV=${TEST_DEV_SYSFS_DIRS[$i]}
+ if readlink -f "$TEST_DEV" | grep -q nvme; then
+ NVME_TEST_DEVS["$testdev_count"]="$i";
+ NVME_TEST_DEVS_SYSFS["$testdev_count"]="$TEST_DEV";
+ NVME_TEST_DEVS_NAME["$testdev_count"]="$(awk '{print substr($1,6) }' <<< $i)"
+ let testdev_count=testdev_count+1;
+ fi
+ done
+
+ for ((i = 0; i < ${#NVME_TEST_DEVS[@]}; ++i)); do
+ TEST_DEV_SYSFS="${NVME_TEST_DEVS_SYSFS[$i]}"
+ TEST_DEV="${NVME_TEST_DEVS[$i]}"
+ _require_device_support_atomic_writes
+ done
+
+ if [[ $testdev_count -lt 4 ]]; then
+ SKIP_REASONS+=("requires at least 4 NVMe devices")
+ return 1
+ fi
+
+ _md_atomics_test "${NVME_TEST_DEVS_NAME[0]}" "${NVME_TEST_DEVS_NAME[1]}" \
+ "${NVME_TEST_DEVS_NAME[2]}" "${NVME_TEST_DEVS_NAME[3]}"
+
+ echo "Test complete"
+}
diff --git a/tests/md/003.out b/tests/md/003.out
new file mode 120000
index 0000000..0412a1f
--- /dev/null
+++ b/tests/md/003.out
@@ -0,0 +1 @@
+002.out
\ No newline at end of file
--
2.43.5
next prev parent reply other threads:[~2025-09-12 9:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 9:57 [PATCH blktests 0/7] Further stacked device atomic writes testing John Garry
2025-09-12 9:57 ` [PATCH blktests 1/7] common/rc: add _min() John Garry
2025-09-18 4:08 ` Shinichiro Kawasaki
2025-09-18 7:33 ` John Garry
2025-09-12 9:57 ` [PATCH blktests 2/7] md/rc: add _md_atomics_test John Garry
2025-09-18 4:17 ` Shinichiro Kawasaki
2025-09-18 7:36 ` John Garry
2025-09-12 9:57 ` [PATCH blktests 3/7] md/002: convert to use _md_atomics_test John Garry
2025-09-12 9:57 ` John Garry [this message]
2025-09-18 4:27 ` [PATCH blktests 4/7] md/003: add NVMe atomic write tests for stacked devices Shinichiro Kawasaki
2025-09-18 7:44 ` John Garry
2025-09-12 9:57 ` [PATCH blktests 5/7] md/rc: test atomic writes for dm-linear John Garry
2025-09-12 9:57 ` [PATCH blktests 6/7] md/rc: test atomic writes for dm-stripe John Garry
2025-09-12 9:57 ` [PATCH blktests 7/7] md/rc: test atomic writes for dm-mirror John Garry
2025-09-16 8:55 ` [PATCH blktests 0/7] Further stacked device atomic writes testing Shinichiro Kawasaki
2025-09-16 10:20 ` John Garry
2025-09-16 11:55 ` John Garry
2025-09-16 12:23 ` Shinichiro Kawasaki
2025-09-16 12:27 ` John Garry
2025-09-17 12:02 ` Shinichiro Kawasaki
2025-09-17 13:12 ` John Garry
2025-09-17 16:22 ` John Garry
2025-09-18 4:36 ` Shinichiro Kawasaki
2025-09-18 7:48 ` John Garry
2025-09-18 10:37 ` Shinichiro Kawasaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250912095729.2281934-5-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox