5 MAX_FILES=${MAX_FILES:-20}
6 DURATION=${DURATION:-$((60*5))}
7 MDSCOUNT=${MDSCOUNT:-1}
9 NUM_THREADS=${NUM_THREADS:-$2}
10 NUM_THREADS=${NUM_THREADS:-3}
14 RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
15 file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \
16 file_delxattr file_getxattr file_setxattr"
18 if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then
19 RACER_PROGS+=' dir_remote'
22 if $RACER_ENABLE_MIGRATION; then
23 RACER_PROGS+=' dir_migrate'
29 for P in $RACER_PROGS; do
35 local MAX_WAIT=$DURATION
39 while [[ $TOT_WAIT -le $MAX_WAIT ]]; do
41 echo sleeping $SHORT_WAIT sec ...
43 # this only checks whether processes exist
44 for P in $RACER_PROGS; do
46 [[ $? -eq 0 ]] && (( rc+=1 ))
49 # Kill dd processes to speedup cleanup
50 local pids=$(ps uax | grep "$DIR" | grep dd | grep -v grep |
56 if [[ $rc -eq 0 ]]; then
57 echo there should be NO racer processes:
58 ps uww -C "${RACER_PROGS// /,}"
61 echo -n "Waited $(( TOT_WAIT + SHORT_WAIT)), rc=$rc "
62 (( SHORT_WAIT+=SHORT_WAIT ))
63 (( TOT_WAIT+=SHORT_WAIT ))
65 ps uww -C "${RACER_PROGS// /,}"
71 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
79 for N in `seq 1 $NUM_THREADS`; do
80 for P in $RACER_PROGS; do
81 ./$P.sh $DIR $MAX_FILES &
86 racer_cleanup || RC=$?
88 # Check our to see whether our test DIR is still available.
91 [ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."