[PATCH 1/1] Add one sanity check for missing device

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

 



Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 tests/00raid1 | 4 ++++
 tests/func.sh | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/tests/00raid1 b/tests/00raid1
index c93465d..f6b8be1 100644
--- a/tests/00raid1
+++ b/tests/00raid1
@@ -3,6 +3,10 @@
 # test version0, version1, and no super
 # test resync and recovery.
 
+# It's just a sanity check. This command shouldn't run successfully
+mdadm -CR $md0 -l 1 -n2 missing missing
+check opposite_result
+
 mdadm -CR $md0 -l 1 -n2 $dev0 $dev1
 check resync
 check raid1
diff --git a/tests/func.sh b/tests/func.sh
index 40c6026..af08b60 100644
--- a/tests/func.sh
+++ b/tests/func.sh
@@ -219,6 +219,10 @@ do_setup() {
 # check various things
 check() {
 	case $1 in
+	opposite_result )
+		if [ $? -eq 0 ]; then
+			die "This command shouldn't run successfully"
+		fi
 	spares )
 		spares=$(tr '] ' '\012\012' < /proc/mdstat | grep -c '(S)' || exit 0)
 		[ $spares -ne $2 ] &&
-- 
2.7.4

--
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