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 v2 6/9] md/003: add NVMe atomic write tests for stacked devices
Date: Mon, 22 Sep 2025 10:24:30 +0000 [thread overview]
Message-ID: <20250922102433.1586402-7-john.g.garry@oracle.com> (raw)
In-Reply-To: <20250922102433.1586402-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 | 44 ++++++++++++++++++++++++++++++++++++++++++++
tests/md/003.out | 1 +
4 files changed, 47 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 3e9c1fa..65a5fa5 100755
--- a/tests/md/002
+++ b/tests/md/002
@@ -25,7 +25,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..5a68480
--- /dev/null
+++ b/tests/md/003
@@ -0,0 +1,44 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Oracle and/or its affiliates
+#
+# Test NMVe Atomic Writes with MD devices
+
+. tests/md/rc
+. common/nvme
+. common/xfs
+
+DESCRIPTION="test md atomic writes for NVMe drives"
+QUICK=1
+
+requires() {
+ _nvme_requires
+ _stacked_atomic_test_requires
+}
+
+device_requires() {
+ _require_test_dev_is_nvme
+}
+
+test_device_array() {
+ local test_dev
+ local testdev_count=0
+ declare -A NVME_TEST_DEVS_NAME
+
+ echo "Running md_atomics_test"
+
+ for test_dev in "${!TEST_DEV_ARRAY_SYSFS_DIRS[@]}"; do
+ NVME_TEST_DEVS_NAME["$testdev_count"]="${test_dev##*/}"
+ let testdev_count=testdev_count+1;
+ 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-22 10:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 10:24 [PATCH blktests v2 0/9] Further stacked device atomic writes testing John Garry
2025-09-22 10:24 ` [PATCH blktests v2 1/9] common/rc: add _min() John Garry
2025-09-22 10:24 ` [PATCH blktests v2 2/9] nvme: relocate _nvme_requires and _require_nvme_test_img_size John Garry
2025-09-22 10:24 ` [PATCH blktests v2 3/9] nvme: relocate _require_test_dev_is_nvme John Garry
2025-09-22 10:24 ` [PATCH blktests v2 4/9] md/rc: add _md_atomics_test John Garry
2025-09-22 10:24 ` [PATCH blktests v2 5/9] md/002: convert to use _md_atomics_test John Garry
2025-09-22 10:24 ` John Garry [this message]
2025-09-25 8:39 ` [PATCH blktests v2 6/9] md/003: add NVMe atomic write tests for stacked devices Shinichiro Kawasaki
2025-09-25 8:46 ` John Garry
2025-09-25 14:12 ` Shinichiro Kawasaki
2025-09-25 14:14 ` John Garry
2025-09-25 15:02 ` John Garry
2025-09-25 23:53 ` Shinichiro Kawasaki
2025-09-22 10:24 ` [PATCH blktests v2 7/9] md/rc: test atomic writes for dm-linear John Garry
2025-09-22 10:24 ` [PATCH blktests v2 8/9] md/rc: test atomic writes for dm-stripe John Garry
2025-09-22 10:24 ` [PATCH blktests v2 9/9] md/rc: test atomic writes for dm-mirror John Garry
2025-09-25 14:09 ` [PATCH blktests v2 0/9] Further stacked device atomic writes testing Shinichiro Kawasaki
2025-09-25 14:13 ` John Garry
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=20250922102433.1586402-7-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