4 MAX_FILES=${MAX_FILES:-20}
6 DIR=${DIR:-"/mnt/lustre/racer"}
7 DURATION=${DURATION:-$((60*5))}
8 MDSCOUNT=${MDSCOUNT:-1}
10 NUM_THREADS=${NUM_THREADS:-$2}
11 NUM_THREADS=${NUM_THREADS:-3}
15 RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
16 file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \
17 file_delxattr file_getxattr file_setxattr"
19 if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then
20 RACER_PROGS+=' dir_remote'
23 if $RACER_ENABLE_MIGRATION; then
24 RACER_PROGS+=' dir_migrate'
30 for P in $RACER_PROGS; do
36 local MAX_WAIT=$DURATION
40 while [[ $TOT_WAIT -le $MAX_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 ))
49 if [[ $rc -eq 0 ]]; then
50 echo there should be NO racer processes:
51 ps uww -C "${RACER_PROGS// /,}"
54 echo -n "Waited $(( TOT_WAIT + SHORT_WAIT)), rc=$rc "
55 (( SHORT_WAIT+=SHORT_WAIT ))
56 (( TOT_WAIT+=SHORT_WAIT ))
58 ps uww -C "${RACER_PROGS// /,}"
64 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
72 for N in `seq 1 $NUM_THREADS`; do
73 for P in $RACER_PROGS; do
74 ./$P.sh $DIR $MAX_FILES &
79 racer_cleanup || RC=$?
81 # Check our to see whether our test DIR is still available.
84 [ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."