2 # script which _must_ complete successfully (at minimum) before checkins to
3 # the CVS HEAD are allowed.
7 PATH=`dirname $0`/../utils:$PATH
9 [ "$CONFIGS" ] || CONFIGS="local" #"local lov"
10 [ "$MAX_THREADS" ] || MAX_THREADS=20
11 RAMKB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo`
12 if [ -z "$THREADS" ]; then
13 THREADS=$((RAMKB / 16384))
14 [ $THREADS -gt $MAX_THREADS ] && THREADS=$MAX_THREADS
16 [ "$SIZE" ] || SIZE=$((RAMKB * 2))
17 [ "$RSIZE" ] || RSIZE=512
18 [ "$UID" ] || UID=1000
19 [ "$MOUNT" ] || MOUNT=/mnt/lustre
20 [ "$MOUNT2" ] || MOUNT2=${MOUNT}2
21 [ "$TMP" ] || TMP=/tmp
22 [ "$COUNT" ] || COUNT=1000
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=0x33f0484"
28 LIBLUSTRE=${LIBLUSTRE:-../liblustre}
29 LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
31 LUSTRE=${LUSTRE:-`dirname $0`/..}
32 . $LUSTRE/tests/test-framework.sh
35 SETUP=${SETUP:-setupall}
36 FORMAT=${FORMAT:-formatall}
37 CLEANUP=${CLEANUP:-stopall}
40 mount | grep $MOUNT && return
45 echo "-----============= acceptance-small: "$*" ============-----"
48 for NAME in $CONFIGS; do
49 export NAME MOUNT START CLEAN
50 . $LUSTRE/tests/cfg/$NAME.sh
52 assert_env mds_HOST MDS_MKFS_OPTS MDSDEV
53 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
54 assert_env FSNAME MOUNT MOUNT2
58 if [ "$RUNTESTS" != "no" ]; then
65 if [ "$SANITY" != "no" ]; then
67 SANITYLOG=/tmp/sanity.log sh sanity.sh
72 which dbench > /dev/null 2>&1 || DBENCH=no
73 if [ "$DBENCH" != "no" ]; then
75 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
76 DB_THREADS=$((SPACE / 50000))
77 [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
84 if [ $DB_THREADS -gt 1 ]; then
86 sh rundbench $DB_THREADS
91 rm -f /mnt/lustre/`hostname`/client.txt
94 chown $UID $MOUNT && chmod 700 $MOUNT
95 which bonnie++ > /dev/null 2>&1 || BONNIE=no
96 if [ "$BONNIE" != "no" ]; then
98 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
99 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
101 bonnie++ -f -r 0 -s $((SIZE / 1024)) -n 10 -u $UID -d $MOUNT
108 which iozone > /dev/null 2>&1 || IOZONE=no
109 if [ "$IOZONE" != "no" ]; then
111 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
112 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
113 IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE"
114 IOZFILE="-f $MOUNT/iozone"
116 iozone $IOZONE_OPTS $IOZFILE
121 # check if O_DIRECT support is implemented in kernel
122 if [ -z "$O_DIRECT" ]; then
123 touch $MOUNT/f.iozone
124 if ! ./directio write $MOUNT/f.iozone 0 1; then
127 rm -f $MOUNT/f.iozone
129 if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
131 iozone -I $IOZONE_OPTS $IOZFILE.odir
137 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
138 IOZ_THREADS=$((SPACE / SIZE * 2 / 3 ))
139 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
140 IOZVER=`iozone -v | awk '/Revision:/ {print $3}' | tr -d .`
141 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
145 while [ $THREAD -le $IOZ_THREADS ]; do
146 IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD"
147 THREAD=$((THREAD + 1))
149 iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE
153 elif [ $IOZVER -lt 3145 ]; then
154 VER=`iozone -v | awk '/Revision:/ { print $3 }'`
155 echo "iozone $VER too old for multi-thread test"
159 if [ "$FSX" != "no" ]; then
161 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
162 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
164 ./fsx -c 50 -p 1000 -P $TMP -l $SIZE \
165 -N $(($COUNT * 100)) $MOUNT/fsxfile
171 if [ "$SANITYN" != "no" ]; then
177 #echo "can't mount2 for '$NAME', skipping sanityN.sh"
178 SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
186 if [ "$LFSCK" != "no" -a -x /usr/sbin/lfsck ]; then
188 E2VER=`e2fsck -V 2>&1 | head -n 1 | cut -d' ' -f 2`
189 [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
190 [ "`echo $E2VER | grep cfs`" ] && sh lfscktest.sh
193 if [ "$LIBLUSTRE" != "no" ]; then
196 export LIBLUSTRE_MOUNT_POINT=$MOUNT2
197 export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
198 export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
199 #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug`
200 if [ -x $LIBLUSTRETESTS/sanity ]; then
202 $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
211 if [ "$SANITY_QUOTA" != "no" ]; then
216 if [ "$REPLAY_SINGLE" != "no" ]; then
221 if [ "$CONF_SANITY" != "no" ]; then
226 if [ "$RECOVERY_SMALL" != "no" ]; then
231 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
232 title replay-ost-single
233 sh replay-ost-single.sh
236 if [ "$REPLAY_DUAL" != "no" ]; then
241 if [ "$INSANITY" != "no" ]; then
249 echo "$0: completed with rc $RC" && exit $RC