Whamcloud - gitweb
LU-4198 clio: turn on lockless for some kind of IO
[fs/lustre-release.git] / lustre / tests / racer / racer.sh
index 5fad750..036b569 100755 (executable)
@@ -1,9 +1,8 @@
 #!/bin/bash
 #set -x
 
+DIR="$1"
 MAX_FILES=${MAX_FILES:-20}
-DIR=${DIR:-$1}
-DIR=${DIR:-"/mnt/lustre/racer"}
 DURATION=${DURATION:-$((60*5))}
 MDSCOUNT=${MDSCOUNT:-1}
 
@@ -13,17 +12,22 @@ 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_exec"
+file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \
+file_delxattr file_getxattr file_setxattr"
 
-if [ $MDSCOUNT -gt 1 ]; then
-       RACER_PROGS="${RACER_PROGS} dir_remote"
+if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then
+       RACER_PROGS+=' dir_remote'
+fi
+
+if $RACER_ENABLE_MIGRATION; then
+       RACER_PROGS+=' dir_migrate'
 fi
 
 racer_cleanup()
 {
        echo "racer cleanup"
        for P in $RACER_PROGS; do
-               killall $P.sh
+               killall -q $P.sh
        done
        trap 0
 
@@ -41,16 +45,24 @@ racer_cleanup()
                        killall -0 $P.sh
                        [[ $? -eq 0 ]] && (( rc+=1 ))
                done
+
+               # Kill dd processes to speedup cleanup
+               local pids=$(ps uax | grep "$DIR" | grep dd | grep -v grep |
+                               awk '{print $2}')
+               for pid in $pids; do
+                       kill $pid
+               done
+
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
-                       ps aux | grep -E "${RACER_PROGS// /|}"
+                       ps uww -C "${RACER_PROGS// /.sh,}.sh"
                        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// /.sh,}.sh"
        return 1
 }
 
@@ -76,7 +88,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