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="eval sysctl -w lnet.debug=\"$DEBUG_LVL\""
25 [ "$DEBUG_ON" ] || DEBUG_ON="eval sysctl -w lnet.debug=0x33f0484"
28 LIBLUSTRE=${LIBLUSTRE:-../liblustre}
29 LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
34 LUSTRE=${LUSTRE:-`dirname $0`/..}
35 . $LUSTRE/tests/test-framework.sh
38 SETUP=${SETUP:-setupall}
39 FORMAT=${FORMAT:-formatall}
40 CLEANUP=${CLEANUP:-stopall}
43 mount | grep $MOUNT && return
48 echo "-----============= acceptance-small: "$*" ============-----"
49 RANTEST=${RANTEST}$*", "
52 for NAME in $CONFIGS; do
53 export NAME MOUNT START CLEAN
54 . $LUSTRE/tests/cfg/$NAME.sh
56 assert_env mds_HOST MDS_MKFS_OPTS MDSDEV
57 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
58 assert_env FSNAME MOUNT MOUNT2
62 if [ "$RUNTESTS" != "no" ]; then
69 if [ "$SANITY" != "no" ]; then
71 SANITYLOG=/tmp/sanity.log sh sanity.sh
76 which dbench > /dev/null 2>&1 || DBENCH=no
77 if [ "$DBENCH" != "no" ]; then
79 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
80 DB_THREADS=$((SPACE / 50000))
81 [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
88 if [ $DB_THREADS -gt 1 ]; then
90 sh rundbench $DB_THREADS
95 rm -f /mnt/lustre/`hostname`/client.txt
98 chown $UID $MOUNT && chmod 700 $MOUNT
99 which bonnie++ > /dev/null 2>&1 || BONNIE=no
100 if [ "$BONNIE" != "no" ]; then
102 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
103 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
105 bonnie++ -f -r 0 -s $((SIZE / 1024)) -n 10 -u $UID -d $MOUNT
112 which iozone > /dev/null 2>&1 || IOZONE=no
113 if [ "$IOZONE" != "no" ]; then
115 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
116 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
117 IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE"
118 IOZFILE="-f $MOUNT/iozone"
120 iozone $IOZONE_OPTS $IOZFILE
125 # check if O_DIRECT support is implemented in kernel
126 if [ -z "$O_DIRECT" ]; then
127 touch $MOUNT/f.iozone
128 if ! ./directio write $MOUNT/f.iozone 0 1; then
131 rm -f $MOUNT/f.iozone
133 if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
135 iozone -I $IOZONE_OPTS $IOZFILE.odir
141 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
142 IOZ_THREADS=$((SPACE / SIZE * 2 / 3 ))
143 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
144 IOZVER=`iozone -v | awk '/Revision:/ {print $3}' | tr -d .`
145 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
149 while [ $THREAD -le $IOZ_THREADS ]; do
150 IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD"
151 THREAD=$((THREAD + 1))
153 iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE
157 elif [ $IOZVER -lt 3145 ]; then
158 VER=`iozone -v | awk '/Revision:/ { print $3 }'`
159 echo "iozone $VER too old for multi-thread test"
163 if [ "$FSX" != "no" ]; then
165 SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
166 [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
168 ./fsx -c 50 -p 1000 -P $TMP -l $SIZE \
169 -N $(($COUNT * 100)) $MOUNT/fsxfile
175 if [ "$SANITYN" != "no" ]; then
181 #echo "can't mount2 for '$NAME', skipping sanityN.sh"
182 SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
190 if [ "$LFSCK" != "no" -a -x /usr/sbin/lfsck ]; then
192 E2VER=`e2fsck -V 2>&1 | head -n 1 | cut -d' ' -f 2`
193 if grep -q obdfilter /proc/fs/lustre/devices; then
194 if [ `echo $E2VER | cut -d. -f2` -ge 39 ] && \
195 [ "`echo $E2VER | grep cfs`" ]; then
199 echo "e2fsck does not support lfsck, skipping"
202 echo "remote OST, skipping test"
206 if [ "$LIBLUSTRE" != "no" ]; then
208 assert_env MGSNID MOUNT2
211 # Liblustre needs accept=all, noacl
212 LNETOPTS="accept=all" MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl" $SETUP
213 export LIBLUSTRE_MOUNT_POINT=$MOUNT2
214 export LIBLUSTRE_MOUNT_TARGET=$MGSNID:/$FSNAME
215 export LIBLUSTRE_TIMEOUT=`cat /proc/sys/lustre/timeout`
216 #export LIBLUSTRE_DEBUG_MASK=`cat /proc/sys/lnet/debug`
217 if [ -x $LIBLUSTRETESTS/sanity ]; then
219 $LIBLUSTRETESTS/sanity --target=$LIBLUSTRE_MOUNT_TARGET
228 if [ "$REPLAY_SINGLE" != "no" ]; then
233 if [ "$CONF_SANITY" != "no" ]; then
238 if [ "$RECOVERY_SMALL" != "no" ]; then
243 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
244 title replay-ost-single
245 sh replay-ost-single.sh
248 if [ "$REPLAY_DUAL" != "no" ]; then
253 if [ "$INSANITY" != "no" ]; then
258 if [ "$SANITY_QUOTA" != "no" ]; then
266 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
267 echo "Tests ran: $RANTEST"
269 echo "$0: completed with rc $RC" && exit $RC