Whamcloud - gitweb
LU-4018 tests: improve racer file_create workload
[fs/lustre-release.git] / lustre / tests / racer / racer.sh
index efd3bcd..1da6465 100755 (executable)
@@ -5,6 +5,7 @@ MAX_FILES=${MAX_FILES:-20}
 DIR=${DIR:-$1}
 DIR=${DIR:-"/mnt/lustre/racer"}
 DURATION=${DURATION:-$((60*5))}
+MDSCOUNT=${MDSCOUNT:-1}
 
 NUM_THREADS=${NUM_THREADS:-$2}
 NUM_THREADS=${NUM_THREADS:-3}
@@ -12,13 +13,17 @@ NUM_THREADS=${NUM_THREADS:-3}
 mkdir -p $DIR
 
 RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
-file_list file_concat"
+file_list file_concat file_exec"
+
+if [ $MDSCOUNT -gt 1 ]; then
+       RACER_PROGS="${RACER_PROGS} dir_remote dir_migrate"
+fi
 
 racer_cleanup()
 {
        echo "racer cleanup"
        for P in $RACER_PROGS; do
-               killall $P.sh
+               killall -q $P.sh
        done
        trap 0
 
@@ -38,14 +43,14 @@ racer_cleanup()
                done
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
-                       ps aux | grep -E "${RACER_PROGS// /|}"
+                       ps uww -C "${RACER_PROGS// /,}"
                        return 0
                fi
                echo -n "Waited $(( TOT_WAIT + SHORT_WAIT)), rc=$rc "
                (( SHORT_WAIT+=SHORT_WAIT ))
                (( TOT_WAIT+=SHORT_WAIT ))
        done
-       ps aux | grep -E "${RACER_PROGS// /|}"
+       ps uww -C "${RACER_PROGS// /,}"
        return 1
 }
 
@@ -71,7 +76,5 @@ racer_cleanup || RC=$?
 # Check our to see whether our test DIR is still available.
 df $DIR
 (( RC+=$? ))
-if [ $RC -eq 0 ]; then
-    echo "We survived $0 for $DURATION seconds."
-fi
+[ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."
 exit $RC