[PATCH 1/4] test/00readonly: Add unit case for testing readonly/readwrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a test case for testing --readonly and
--readwrite feature, it covers common metadata
versions and raid levels.

Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx>
---
 tests/00readonly | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 tests/00readonly

diff --git a/tests/00readonly b/tests/00readonly
new file mode 100644
index 0000000..8467da7
--- /dev/null
+++ b/tests/00readonly
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+for metadata in 0.9 1.0 1.1 1.2
+do
+	for level in linear raid0 raid1 raid4 raid5 raid6 raid10
+	do
+		mdadm -CR $md0 -l $level -n 4 --metadata=$metadata \
+			$dev1 $dev2 $dev3 $dev4 --assume-clean
+		check nosync
+		check $level
+		mdadm -ro $md0
+		check readonly &&
+			[ "$(cat /sys/block/md0/md/array_state)" == "readonly" ]
+		mdadm -w $md0
+		check $level
+		mdadm -S $md0
+	done
+done
+
+exit 0
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux