]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - tests/utils
mdadm/tests: add one test case for failfast of raid1
[thirdparty/mdadm.git] / tests / utils
index 1d45fa83ccbc10017803232219cbddd7fa5c142d..3acebd77ac14b236d9e22d1ab77f567fdf6c1258 100644 (file)
@@ -15,7 +15,7 @@ devices="/dev/loop[0-9] /dev/loop10 /dev/loop11 /dev/loop12"
 # uses testdsc and platform global variables
 err(){
        echo >&2 "ERROR: $*"
-       cat /etc/mdadm.conf >&2 || true
+       cat $config >&2 || true
        cat /proc/mdstat >&2
        [ -z "$testdsc" ] || { echo >&2 $platform: $testdsc "- failed"; }
        ps -e | grep mdadm >&2 || true
@@ -45,7 +45,7 @@ tidyup(){
        mdadm -Ss
        mdadm --zero-superblock $devices || true
        udevadm settle
-       rm -f /etc/mdadm.conf
+       rm -f $config
 }
 
 trap tidyup 0 1 2 3 15
@@ -167,7 +167,6 @@ chksparemoved(){
 
 # for domains defined through policy
 createconfig(){
-conf=/etc/mdadm.conf
 if [ "$1" != "a" ]; then
 {
        domain=$1
@@ -181,12 +180,12 @@ if [ "$1" != "a" ]; then
                echo "$echo"
                shift
        done
-} >> $conf
+} >> $config
 else
 {
        echo "DEVICES $devlist /dev/md1*"
        mdadm -Ebs
-} >  $conf
+} >  $config
 fi
-#[ "$verbose" != "yes" ] || cat /etc/mdadm.conf | grep policy || true
+#[ "$verbose" != "yes" ] || cat $config | grep policy || true
 }