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 [ $MDSCOUNT -gt 1 ]; then
20 RACER_PROGS="${RACER_PROGS} dir_remote dir_migrate"
26 for P in $RACER_PROGS; do
32 local MAX_WAIT=$DURATION
36 while [[ $TOT_WAIT -le $MAX_WAIT ]]; do
38 echo sleeping $SHORT_WAIT sec ...
40 # this only checks whether processes exist
41 for P in $RACER_PROGS; do
43 [[ $? -eq 0 ]] && (( rc+=1 ))
45 if [[ $rc -eq 0 ]]; then
46 echo there should be NO racer processes:
47 ps uww -C "${RACER_PROGS// /,}"
50 echo -n "Waited $(( TOT_WAIT + SHORT_WAIT)), rc=$rc "
51 (( SHORT_WAIT+=SHORT_WAIT ))
52 (( TOT_WAIT+=SHORT_WAIT ))
54 ps uww -C "${RACER_PROGS// /,}"
60 echo "Running $0 for $DURATION seconds. CTRL-C to exit"
68 for N in `seq 1 $NUM_THREADS`; do
69 for P in $RACER_PROGS; do
70 ./$P.sh $DIR $MAX_FILES &
75 racer_cleanup || RC=$?
77 # Check our to see whether our test DIR is still available.
80 [ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."