X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frun_tar.sh;h=1bc47e9974e103b66a22846ef36141de87535e0a;hb=f0657b96c66ab03c9208ee4b23a1ea5c7d44bd15;hp=5f40e688b793c69c5ce8e2b8aa33d12c186a1663;hpb=852f34ac50727d3a012b9b325f9614b2b4fa7db7;p=fs%2Flustre-release.git diff --git a/lustre/tests/run_tar.sh b/lustre/tests/run_tar.sh index 5f40e68..1bc47e9 100755 --- a/lustre/tests/run_tar.sh +++ b/lustre/tests/run_tar.sh @@ -12,37 +12,30 @@ mkdir -p ${LOG%/*} rm -f $LOG $DEBUGLOG exec 2>$DEBUGLOG -if [ -z "$MOUNT" -o -z "$END_RUN_FILE" -o -z "$LOAD_PID_FILE" ]; then - echo "The following must be set: MOUNT END_RUN_FILE LOAD_PID_FILE" - exit 1 -fi +. $(dirname $0)/functions.sh -echoerr () { echo "$@" 1>&2 ; } - -signaled() { - echoerr "$(date +'%F %H:%M:%S'): client load was signaled to terminate" - kill -TERM -$PPID - sleep 5 - kill -KILL -$PPID -} +assert_env MOUNT END_RUN_FILE LOAD_PID_FILE trap signaled TERM -# recovery-mds-scale uses this to signal the client loads to die +# recovery-*-scale scripts use this to signal the client loads to die echo $$ >$LOAD_PID_FILE TESTDIR=$MOUNT/d0.tar-$(hostname) +do_tar() { + tar cf - /etc | tar xf - 2>&1 | tee $LOG + return ${PIPESTATUS[1]} +} + CONTINUE=true while [ ! -e "$END_RUN_FILE" ] && $CONTINUE; do echoerr "$(date +'%F %H:%M:%S'): tar run starting" mkdir -p $TESTDIR cd $TESTDIR - tar cf - /etc | tar xf - 2>&1 | tee $LOG & - load_pid=$! -ps -e f -o "pid ppid pgrp comm" >$TMP/client-load.ps-list - wait $load_pid - RC=${PIPESTATUS[0]} + do_tar & + wait $! + RC=$? PREV_ERRORS=$(grep "exit delayed from previous errors" $LOG) || true if [ $RC -ne 0 -a "$ERRORS_OK" -a "$PREV_ERRORS" ]; then echoerr "$(date +'%F %H:%M:%S'): tar errors earlier, ignoring"