summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-07-10 06:44:58 +0200
committerNeilBrown <neilb@suse.de>2015-07-10 06:44:58 +0200
commit5bc29745a059e5ef407e35f55eb5d9e0b28d8ada (patch)
treea5fd7ead308a450bf8956cc7d41886a3f38254e7 /test
parenttests: do not try to 'flushbufs' after stopping a array (diff)
downloadmdadm-5bc29745a059e5ef407e35f55eb5d9e0b28d8ada.tar.xz
mdadm-5bc29745a059e5ef407e35f55eb5d9e0b28d8ada.zip
tests: save failure logs to logdir
If --save-logs is given we already save all logs to --logdir If not, we should still save erroneous logs to --logdir. Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest12
1 files changed, 4 insertions, 8 deletions
diff --git a/test b/test
index d268433e..342177af 100755
--- a/test
+++ b/test
@@ -308,9 +308,9 @@ do_test() {
dmesg | tail -n 200 >> $targetdir/log
if [ $exitonerror == 0 ]; then
log=log-`basename $_script`
- mv $targetdir/log $targetdir/$log
+ mv $targetdir/log $logdir/$log
fi
- echo "FAILED - see $targetdir/$log for details"
+ echo "FAILED - see $logdir/$log for details"
_fail=1
fi
if [ "$savelogs" == "1" ]; then
@@ -362,12 +362,6 @@ parse_args() {
;;
--save-logs)
savelogs=1
- if [ ! -d $logdir ] ; then
- mkdir $logdir
- if [ $? -ne 0 ] ; then
- exit 1;
- fi
- fi
;;
--keep-going | --no-error)
exitonerror=0
@@ -403,9 +397,11 @@ parse_args() {
done
}
+logdir=$targetdir
parse_args $@
do_setup
+mkdir -p $logdir
if [ "$savelogs" == "1" ]; then
echo "Saving logs to $logdir"