]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
test: keep separate log file for each failed test.
authorNeilBrown <neilb@suse.de>
Mon, 22 Oct 2012 22:21:32 +0000 (09:21 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 22 Oct 2012 22:21:32 +0000 (09:21 +1100)
If a test failed when --keep-going is selected, give the
log file a name based on the test name, so that all the logs
can be examined afterwards.

Signed-off-by: NeilBrown <neilb@suse.de>
test

diff --git a/test b/test
index e31338503356cb1c9e4c6b6315b7490bc53015a9..3f8515fe17e14fdc51cf1d22fb73621d34f8a535 100755 (executable)
--- a/test
+++ b/test
@@ -232,7 +232,12 @@ do_test() {
       echo "succeeded"
       _fail=0
     else
-      echo "FAILED - see $targetdir/log for details"
+      log=log
+      if [ $exitonerror == 0 ]; then
+         log=log-`basename $_script`
+         mv $targetdir/log $targetdir/$log
+      fi
+      echo "FAILED - see $targetdir/$log for details"
       _fail=1
     fi
     if [ "$savelogs" == "1" ]; then