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
64 chown $UID $MOUNT && chmod 700 $MOUNT
65 if [ "$BONNIE" != "no" ]; then
66 mount | grep $MOUNT || sh llmount.sh
68 bonnie++ -f -r 0 -s $(($SIZE / 1024)) -n 10 -u $UID -d $MOUNT
74 IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE"
75 IOZFILE="-f $MOUNT/iozone"
76 if [ "$IOZONE" != "no" ]; then
77 mount | grep $MOUNT || sh llmount.sh
79 iozone $IOZONE_OPTS $IOZFILE
84 if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
86 iozone -I $IOZONE_OPTS $IOZFILE.odir
92 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
93 IOZ_THREADS=`expr $SPACE / \( $SIZE + $SIZE / 512 \)`
94 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
95 IOZVER=`iozone -v|awk '/Revision:/ {print $3}'|tr -d .`
96 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
100 while [ $THREAD -le $IOZ_THREADS ]; do
101 IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD"
102 THREAD=`expr $THREAD + 1`
104 iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE
108 elif [ $IOZVER -lt 3145 ]; then
109 VER=`iozone -v | awk '/Revision:/ { print $3 }'`
110 echo "iozone $VER too old for multi-thread test"
113 if [ "$FSX" != "no" ]; then
114 mount | grep $MOUNT || sh llmount.sh
116 ./fsx -c 50 -p 1000 -P $TMP -l $SIZE \
117 -N $(($COUNT * 100)) $MOUNT/fsxfile
130 *) # we could extract this from $NAME.xml somehow
134 if [ "$SANITYN" != "no" ]; then
135 mount | grep $MOUNT || sh llmount.sh
138 if [ "$MDSNODE" -a "$MDSNAME" -a "$CLIENT" ]; then
139 llmount $MDSNODE:/$MDSNAME/$CLIENT $MOUNT2
140 SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
143 echo "don't know \$MDSNODE, \$MDSNAME, \$CLIENT"
144 echo "can't mount2 for '$NAME', skipping sanityN.sh"
152 if [ "$LIBLUSTRE" != "no" ]; then
153 mount | grep $MOUNT || sh llmount.sh
154 export LIBLUSTRE_MOUNT_POINT=$MOUNT2
155 export LIBLUSTRE_MOUNT_TARGET=$MDSNODE:/$MDSNAME/$CLIENT
156 export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
157 #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug`
158 if [ -x $LIBLUSTRETESTS/sanity ]; then
159 $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
165 mount | grep $MOUNT && sh llmountcleanup.sh
168 if [ "$REPLAY_SINGLE" != "no" ]; then
172 if [ "$CONF_SANITY" != "no" ]; then
176 if [ "$RECOVERY_SMALL" != "no" ]; then
180 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
181 sh replay-ost-single.sh
184 if [ "$REPLAY_DUAL" != "no" ]; then
188 if [ "$INSANITY" != "no" ]; then
193 echo "completed with rc $RC" && exit $RC