]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - test
Fix and test --update=uuid
[thirdparty/mdadm.git] / test
diff --git a/test b/test
index 75c53d87b794a7b60489e3e9dd42d74d1dd56ebc..f0a4388f592e5bdc0155abffd630d7c824b4c54b 100644 (file)
--- a/test
+++ b/test
@@ -66,9 +66,10 @@ fi
 # mdadm always adds --quiet, and we want to see any unexpected messages
 mdadm() {
     case $* in
-       *-C* ) $mdadm --quiet "$@" --auto=yes;;
-        * )   $mdadm --quiet "$@"
+       *-C* ) $mdadm 2> $targetdir/stderr --quiet "$@" --auto=yes;;
+        * )   $mdadm 2> $targetdir/stderr --quiet "$@"
     esac
+    cat >&2 $targetdir/stderr
 }
 
 # check various things
@@ -126,6 +127,11 @@ check() {
    esac
 }
 
+no_errors() {
+  if [ -s $targetdir/stderr ]
+  then echo Bad errors from mdadm: ; cat $targetdir/stderr; exit 2;
+  fi
+}
 # basic device test
 
 testdev() {
@@ -159,7 +165,7 @@ do
    # namespace, but cannot change it.
    if ( set -ex ; . $script )  2> $targetdir/log
    then echo "$script succeeded" 
-   else cat $targetdir/log
+   else cat $targetdir/log ; cat $targetdir/stderr
         echo "$script failed"
        exit 1
    fi