2 # script which _must_ complete successfully (at minimum) before checkins to
3 # the CVS HEAD are allowed.
6 PATH=`dirname $0`/../utils:$PATH
8 [ "$CONFIGS" ] || CONFIGS="local lov"
9 [ "$MAX_THREADS" ] || MAX_THREADS=10
10 if [ -z "$THREADS" ]; then
11 KB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo`
12 THREADS=`expr $KB / 16384`
13 [ $THREADS -gt $MAX_THREADS ] && THREADS=$MAX_THREADS
15 [ "$SIZE" ] || SIZE=40960
16 [ "$RSIZE" ] || RSIZE=512
17 [ "$UID" ] || UID=1000
18 [ "$MOUNT" ] || MOUNT=/mnt/lustre
19 [ "$MOUNT2" ] || MOUNT2=${MOUNT}2
20 [ "$TMP" ] || TMP=/tmp
21 [ "$COUNT" ] || COUNT=1000
22 #[ "$DEBUG_LVL" ] || DEBUG_LVL=0x370200
23 [ "$DEBUG_LVL" ] || DEBUG_LVL=0
24 [ "$DEBUG_OFF" ] || DEBUG_OFF="sysctl -w lnet.debug=$DEBUG_LVL"
25 [ "$DEBUG_ON" ] || DEBUG_ON="sysctl -w lnet.debug=0x33f0480"
27 LIBLUSTRE=${LIBLUSTRE:-../liblustre}
28 LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
30 for NAME in $CONFIGS; do
31 export NAME MOUNT START CLEAN
32 [ -e $NAME.sh ] && sh $NAME.sh
33 [ ! -e $NAME.xml ] && [ -z "$LDAPURL" ] && \
34 echo "no config '$NAME.xml'" 1>&2 && exit 1
36 if [ "$RUNTESTS" != "no" ]; then
40 if [ "$SANITY" != "no" ]; then
41 SANITYLOG=/tmp/sanity.log sh sanity.sh
44 if [ "$DBENCH" != "no" ]; then
45 mount | grep $MOUNT || sh llmount.sh
46 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
47 DB_THREADS=`expr $SPACE / 50000`
48 [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
55 if [ $DB_THREADS -gt 1 ]; then
57 sh rundbench $DB_THREADS
62 rm -f /mnt/lustre/`hostname`/client.txt
65 chown $UID $MOUNT && chmod 700 $MOUNT
66 if [ "$BONNIE" != "no" ]; then
67 mount | grep $MOUNT || sh llmount.sh
69 bonnie++ -f -r 0 -s $(($SIZE / 1024)) -n 10 -u $UID -d $MOUNT
75 IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE"
76 IOZFILE="-f $MOUNT/iozone"
77 if [ "$IOZONE" != "no" ]; then
78 mount | grep $MOUNT || sh llmount.sh
80 iozone $IOZONE_OPTS $IOZFILE
85 if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
87 iozone -I $IOZONE_OPTS $IOZFILE.odir
93 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
94 IOZ_THREADS=`expr $SPACE / \( $SIZE + $SIZE / 512 \)`
95 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
96 IOZVER=`iozone -v|awk '/Revision:/ {print $3}'|tr -d .`
97 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
101 while [ $THREAD -le $IOZ_THREADS ]; do
102 IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD"
103 THREAD=`expr $THREAD + 1`
105 iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE
109 elif [ $IOZVER -lt 3145 ]; then
110 VER=`iozone -v | awk '/Revision:/ { print $3 }'`
111 echo "iozone $VER too old for multi-thread test"
115 if [ "$FSX" != "no" ]; then
116 mount | grep $MOUNT || sh llmount.sh
118 ./fsx -c 50 -p 1000 -P $TMP -l $SIZE \
119 -N $(($COUNT * 100)) $MOUNT/fsxfile
132 *) # we could extract this from $NAME.xml somehow
136 if [ "$SANITYN" != "no" ]; then
137 mount | grep $MOUNT || sh llmount.sh
140 if [ "$MDSNODE" -a "$MDSNAME" -a "$CLIENT" ]; then
141 llmount $MDSNODE:/$MDSNAME/$CLIENT $MOUNT2
142 SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
145 echo "don't know \$MDSNODE, \$MDSNAME, \$CLIENT"
146 echo "can't mount2 for '$NAME', skipping sanityN.sh"
154 if [ "$LIBLUSTRE" != "no" ]; then
155 mount | grep $MOUNT || sh llmount.sh
156 export LIBLUSTRE_MOUNT_POINT=$MOUNT2
157 export LIBLUSTRE_MOUNT_TARGET=$MDSNODE:/$MDSNAME/$CLIENT
158 export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
159 #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug`
160 if [ -x $LIBLUSTRETESTS/sanity ]; then
161 $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
167 mount | grep $MOUNT && sh llmountcleanup.sh
170 if [ "$REPLAY_SINGLE" != "no" ]; then
174 if [ "$CONF_SANITY" != "no" ]; then
178 if [ "$RECOVERY_SMALL" != "no" ]; then
182 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
183 sh replay-ost-single.sh
186 if [ "$REPLAY_DUAL" != "no" ]; then
190 if [ "$INSANITY" != "no" ]; then
195 echo "completed with rc $RC" && exit $RC