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}
12 RACER_MAX_CLEANUP_WAIT=${RACER_MAX_CLEANUP_WAIT:-$DURATION}
16 RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
17 file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \
18 file_delxattr file_getxattr file_setxattr"
20 if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then
21 RACER_PROGS+=' dir_remote'
24 if $RACER_ENABLE_MIGRATION; then
25 RACER_PROGS+=' dir_migrate'
31 for P in $RACER_PROGS; do
40 while [[ $TOT_WAIT -le $RACER_MAX_CLEANUP_WAIT ]]; do
42 echo sleeping $SHORT_WAIT sec ...
44 # this only checks whether processes exist
45 for P in $RACER_PROGS; do
47 [[ $? -eq 0 ]] && (( rc+=1 ))
50 # Kill dd processes to speedup cleanup
51 local pids=$(ps uax | grep "$DIR" | grep dd | grep -v grep |
57 if [[ $rc -eq 0 ]]; then
58 echo there should be NO racer processes:
59 ps uww -C "${RACER_PROGS// /.sh,}.sh"
62 (( TOT_WAIT+=SHORT_WAIT ))
63 echo -n "Waited $TOT_WAIT, rc=$rc "
64 (( SHORT_WAIT+=SHORT_WAIT ))
66 ps uww -C "${RACER_PROGS// /.sh,}.sh"
72 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
80 for N in `seq 1 $NUM_THREADS`; do
81 for P in $RACER_PROGS; do
82 ./$P.sh $DIR $MAX_FILES &
87 racer_cleanup || RC=$?
89 # Check our to see whether our test DIR is still available.
92 [ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."