]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - tests/01raid6integ
mdadm: add test case for raid5 write back cache
[thirdparty/mdadm.git] / tests / 01raid6integ
index ed7cec578d09a4f4c05312023641e7225e8e0651..12f4d81b3eb4707745994c071f3da885d7f7b66b 100644 (file)
@@ -1,16 +1,21 @@
 
 # Check integrity of raid6 in degraded modes
 # Create a 5 disk raid6, dump some data to it, then
-# sh1sum it with different pairs of devices failed
+# sha1sum it with different pairs of devices failed
+
+if [ "$INTEGRITY" != "yes" ]; then
+  echo -ne 'skipping... '
+  exit 0
+fi
 
 layouts='ls rs la ra'
 lv=`uname -r`
 if expr $lv '>=' 2.6.30 > /dev/null
 then
-  layouts="$layouts parity-first dd-zero-restart ddf-N-restart ddf-N-continue \
+  layouts="$layouts parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \
        left-asymmetric-6 right-asymmetric-6 left-symmetric-6 right-symmetric-6 parity-first-6"
 fi
-echo $layouts
+
 for layout in $layouts
 do
   mdadm -CR $md0 -l6 --layout $layout -n5 $dev0 $dev1 $dev2 $dev3 $dev4
@@ -25,9 +30,9 @@ do
     mdadm $md0 -r $second
     blockdev --flushbufs $md0
     sum1=`sha1sum $md0`
-    if [ $sum != $sum1 ]
+    if [ "$sum" != "$sum1" ]
     then
-      echo $sum does not matc $sum1 with $second missing
+      echo $sum does not match $sum1 with $second missing
       exit 1
     fi
     for first in $totest
@@ -36,18 +41,17 @@ do
        mdadm $md0 -r $first
        blockdev --flushbufs $md0
        sum1=`sha1sum $md0`
-       if [ $sum != $sum1 ]
+       if [ "$sum" != "$sum1" ]
        then
-         echo $sum does not matc $sum1 with $first and $second missing
+         echo $sum does not match $sum1 with $first and $second missing
          exit 1
        fi
        mdadm $md0 -a $first
-       check wait
+       while ! (check state 'U*_U*'); do check wait; sleep 0.2; done
     done
     mdadm $md0 -a $second
-    check wait
+    while ! (check state 'U*'); do check wait; sleep 0.2; done
     totest="$totest $second"
   done
   mdadm -S $md0
 done
-