Skip to content

Commit a2badd1

Browse files
johnpgarrykawasaki
authored andcommitted
md/003: add NVMe atomic write tests for stacked devices
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 <[email protected]> [Shin'ichiro: simplified using TEST_DEV_ARRAY] Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent af85782 commit a2badd1

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

tests/md/002

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test() {
2525
per_host_store=true
2626
)
2727

28-
echo "Running ${TEST_NAME}"
28+
echo "Running md_atomics_test"
2929

3030
if ! _configure_scsi_debug "${scsi_debug_params[@]}"; then
3131
return 1

tests/md/002.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Running md/002
1+
Running md_atomics_test
22
TEST 1 raid0 step 1 - Verify md sysfs atomic attributes matches - pass
33
TEST 2 raid0 step 1 - Verify sysfs atomic attributes - pass
44
TEST 3 raid0 step 1 - Verify md sysfs_atomic_write_max is equal to expected_atomic_write_max - pass

tests/md/003

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-3.0+
3+
# Copyright (C) 2025 Oracle and/or its affiliates
4+
#
5+
# Test NMVe Atomic Writes with MD devices
6+
7+
. tests/md/rc
8+
. common/nvme
9+
. common/xfs
10+
11+
DESCRIPTION="test md atomic writes for NVMe drives"
12+
QUICK=1
13+
14+
requires() {
15+
_nvme_requires
16+
_stacked_atomic_test_requires
17+
}
18+
19+
device_requires() {
20+
_require_test_dev_is_nvme
21+
}
22+
23+
test_device_array() {
24+
echo "Running md_atomics_test"
25+
26+
if [[ ${#TEST_DEV_ARRAY[@]} -lt 4 ]]; then
27+
SKIP_REASONS+=("requires at least 4 NVMe devices")
28+
return 1
29+
fi
30+
31+
_md_atomics_test "${TEST_DEV_ARRAY[0]##*/}" "${TEST_DEV_ARRAY[1]##*/}" \
32+
"${TEST_DEV_ARRAY[2]##*/}" "${TEST_DEV_ARRAY[3]##*/}"
33+
34+
echo "Test complete"
35+
}

tests/md/003.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
002.out

0 commit comments

Comments
 (0)