X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frun_tar.sh;h=1bc47e9974e103b66a22846ef36141de87535e0a;hb=65ec69f84b6452fd626bc3da980d31a4ef05a00e;hp=7502c24153d5e617485d41aba6f1537e60814afe;hpb=f6796fea971503083308076ce78acfc385271ae4;p=fs%2Flustre-release.git diff --git a/lustre/tests/run_tar.sh b/lustre/tests/run_tar.sh index 7502c241..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/tar-$(hostname) +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"