MPIRUN=$(which mpirun 2>/dev/null) || true
MPI_USER=${MPI_USER:-mpiuser}
+SHARED_DIR_LOGS=${SHARED_DIR_LOGS:-""}
+
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-TESTSUITELOG=${TESTSUITELOG:-$TMP/recovery-mds-scale}
+TESTSUITELOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh)}
DEBUGLOG=$TESTSUITELOG.debug
+
+cleanup_logs
+
exec 2>$DEBUGLOG
echo "--- env ---" >&2
env >&2
[ -n "$CLIENTS" ] || { skip "$0 Need two or more remote clients" && exit 0; }
[ $CLIENTCOUNT -ge 3 ] || \
- { skip "$0 Need two or more clients, have $CLIENTCOUNT" && exit 0; }
+ { skip "$0 Need two or more remote clients, have $CLIENTCOUNT" && exit 0; }
END_RUN_FILE=${END_RUN_FILE:-$SHARED_DIRECTORY/end_run_file}
LOAD_PID_FILE=${LOAD_PID_FILE:-$TMP/client-load.pid}
sleep 5
kill -9 $CLIENT_LOAD_PIDS || true
fi
+ if [ $rc -ne 0 ]; then
+ # we are interested in only on failed clients and servers
+ local failedclients=$(cat $END_RUN_FILE | grep -v $0)
+ # FIXME: need ostfailover-s nodes also for FLAVOR=OST
+ local product=$(gather_logs $(comma_list $(osts_nodes) \
+ $(mdts_nodes) $mdsfailover_HOST $failedclients))
+ echo logs files $product
+ fi
+
[ $rc -eq 0 ] && zconf_mount $(hostname) $MOUNT
exit $rc
done
return $OSCFULL
}
+
+gather_logs () {
+ local list=$1
+
+ local ts=$(date +%s)
+
+ # bug 20237, comment 11
+ # It would also be useful to provide the option
+ # of writing the file to an NFS directory so it doesn't need to be copied.
+ local tmp=$TMP
+ local docp=true
+ [ -d "$SHARED_DIR_LOGS" ] && tmp=$SHARED_DIR_LOGS && docp=false
+
+ # dump lustre logs, dmesg
+ do_nodes $list "log=$tmp/\\\$(hostname)-debug-$ts.log ;
+lctl dk \\\$log >/dev/null;
+log=$tmp/\\\$(hostname)-dmesg-$ts.log;
+dmesg > \\\$log; "
+
+ # FIXME: does it make sense to collect the logs for $ts only, but all
+ # TESTSUITE logs?
+ # rsync $TMP/*${TESTSUITE}* to gather the logs dumped by error fn
+ local logs=$TMP/'*'${TESTSUITE}'*'
+ if $docp; then
+ logs=$logs' '$tmp/'*'$ts'*'
+ fi
+ for node in ${list//,/ }; do
+ rsync -az $node:"$logs" $TMP
+ done
+
+ local archive=$TMP/${TESTSUITE}-$ts.tar.bz2
+ tar -jcf $archive $tmp/*$ts* $TMP/*${TESTSUITE}*
+
+ echo $archive
+}
+
+cleanup_logs () {
+ local list=${1:-$(comma_list $(nodes_list))}
+
+ [ -n ${TESTSUITE} ] && do_nodes $list "rm -f $TMP/*${TESTSUITE}*" || true
+}
+