Whamcloud - gitweb
520205235b2888ccac153508366650982be130f2
[fs/lustre-release.git] / lustre / tests / acceptance-small.sh
1 #!/bin/sh
2 # script which _must_ complete successfully (at minimum) before checkins to
3 # the CVS HEAD are allowed.
4 set -vxe
5
6 [ "$CONFIGS" ] || CONFIGS="local lov"
7 [ "$THREADS" ] || THREADS=1
8 [ "$SIZE" ] || SIZE=20480
9 [ "$RSIZE" ] || RSIZE=64
10 [ "$UID" ] || UID=1000
11 [ "$MNT" ] || MNT=/mnt/lustre
12 [ "$TMP" ] || TMP=/tmp
13 [ "$COUNT" ] || COUNT=1000
14 [ "$DEBUG_OFF" ] || DEBUG_OFF="eval echo 0 > /proc/sys/portals/debug"
15
16 for NAME in $CONFIGS; do
17         export NAME
18         [ -e $NAME.sh ] && sh $NAME.sh
19         [ ! -e $NAME.xml ] && echo "no config '$NAME.xml'" 1>&2 && exit 1
20
21         if [ "$RUNTESTS" != "no" ]; then
22                 sh runtests
23         fi
24
25         [ "$SANITY" != "no" ] && sh sanity.sh
26
27         if [ "$DBENCH" != "no" ]; then
28                 mount | grep $MNT || sh llmount.sh
29                 $DEBUG_OFF
30                 sh rundbench 1
31                 sh llmountcleanup.sh
32                 sh llrmount.sh
33                 if [ $THREADS -gt 1 ]; then
34                         $DEBUG_OFF
35                         sh rundbench $THREADS
36                         sh llmountcleanup.sh
37                         sh llrmount.sh
38                 fi
39                 rm -f /mnt/lustre/client.txt
40         fi
41         chown $UID $MNT && chmod 700 $MNT
42         if [ "$BONNIE" != "no" ]; then
43                 mount | grep $MNT || sh llmount.sh
44                 $DEBUG_OFF
45                 bonnie++ -s 0 -n 10 -u $UID -d $MNT
46                 sh llmountcleanup.sh
47                 sh llrmount.sh
48         fi
49         IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r $RSIZE -s $SIZE"
50         IOZONE_FILE="-f $MNT/iozone"
51         if [ "$IOZONE" != "no" ]; then
52                 mount | grep $MNT || sh llmount.sh
53                 $DEBUG_OFF
54                 iozone $IOZONE_OPTS $IOZONE_FILE
55                 sh llmountcleanup.sh
56                 sh llrmount.sh
57         fi
58         if [ "$IOZONE_DIR" != "no" ]; then
59                 mount | grep $MNT || sh llmount.sh
60                 $DEBUG_OFF
61                 iozone -I $IOZONE_OPTS $IOZONE_FILE.odir
62                 IOZVER=`iozone -v | awk '/Revision:/ { print $3 }' | tr -d '.'`
63                 sh llmountcleanup.sh
64                 sh llrmount.sh
65                 if [ "$THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
66                         $DEBUG_OFF
67                         THREAD=1
68                         IOZONE_FILE="-F "
69                         SIZE=`expr $SIZE / $THREADS`
70                         while [ $THREAD -le $THREADS ]; do
71                                 IOZONE_FILE="$IOZONE_FILE $MNT/iozone.$THREAD"
72                                 THREAD=`expr $THREAD + 1`
73                         done
74                         iozone -I $IOZONE_OPTS -t $THREADS $IOZONE_FILE
75                         sh llmountcleanup.sh
76                         sh llrmount.sh
77                 elif [ $IOZVER -lt 3145 ]; then
78                         VER=`iozone -v | awk '/Revision:/ { print $3 }'`
79                         echo "iozone $VER too old for multi-threaded tests"
80                 fi
81         fi
82         if [ "$FSX" != "no" ]; then
83                 mount | grep $MNT || sh llmount.sh
84                 $DEBUG_OFF
85                 ./fsx -W -c 50 -p 1000 -P $TMP -l 1024000 -N $(($COUNT * 100)) $MNT/fsxfile
86                 sh llmountcleanup.sh
87                 #sh llrmount.sh
88         fi      
89         mount | grep $MNT && sh llmountcleanup.sh
90 done