X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fracer.sh;h=edcf900a81b68f4ea4e4cc81cb78d31bb938ddde;hp=f862012e357a8036cf8e272a339126b8c1e24f26;hb=4ac9f1ad9ca68de0df7ce0d6451c29a5ff3be1b9;hpb=e4cf956f93a4384d19ea73e601a6651710703492 diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index f862012..edcf900 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -1,3 +1,65 @@ #!/bin/bash +#set -vx +set -e -bash $(dirname $0)/runracer $@ +ONLY=${ONLY:-"$*"} +LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +. $LUSTRE/tests/test-framework.sh +init_test_env $@ +. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} +init_logging + +racer=$LUSTRE/tests/racer/racer.sh +echo racer: $racer + +DURATION=${DURATION:-900} +[ "$SLOW" = "no" ] && DURATION=300 +MOUNT_2=${MOUNT_2:-"yes"} + +build_test_filter +check_and_setup_lustre + +CLIENTS=${CLIENTS:-$HOSTNAME} +RACERDIRS=${RACERDIRS:-"$DIR $DIR2"} +echo RACERDIRS=$RACERDIRS +for d in ${RACERDIRS}; do + is_mounted $d || continue + + RDIRS="$RDIRS $d/racer" + mkdir -p $d/racer +# lfs setstripe $d/racer -c -1 +done + +# run racer +test_1() { + local rrc=0 + local rc=0 + local clients=${CLIENTS:-$(hostname)} + + check_progs_installed $clients $racer || \ + { skip_env "$racer not found" && return 0; } + + local rpids="" + for rdir in $RDIRS; do + do_nodes $clients "DURATION=$DURATION $racer $rdir $NUM_RACER_THREADS" & + pid=$! + rpids="$rpids $pid" + done + + echo racers pids: $rpids + for pid in $rpids; do + wait $pid + rc=$? + echo "pid=$pid rc=$rc" + if [ $rc != 0 ]; then + rrc=$((rrc + 1)) + fi + done + + return $rrc +} +run_test 1 "racer on clients: ${CLIENTS:-$(hostname)} DURATION=$DURATION" + +complete $(basename $0) $SECONDS +check_and_cleanup_lustre +exit_status