diff options
author | NeilBrown <neilb@suse.de> | 2015-07-10 06:44:58 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-07-10 06:44:58 +0200 |
commit | 5bc29745a059e5ef407e35f55eb5d9e0b28d8ada (patch) | |
tree | a5fd7ead308a450bf8956cc7d41886a3f38254e7 /test | |
parent | tests: do not try to 'flushbufs' after stopping a array (diff) | |
download | mdadm-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-x | test | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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" |