Whamcloud - gitweb
land 0.5.20.3 b_devel onto HEAD (b_devel will remain)
[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" -a -z "$SANITYN" ] && SANITYN=no
7 [ "$CONFIGS" ] || CONFIGS="local lov"
8 [ "$MAX_THREADS" ] || MAX_THREADS=50
9 if [ -z "$THREADS" ]; then
10         KB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo`
11         THREADS=`expr $KB / 16384`
12         [ $THREADS -gt $MAX_THREADS ] && THREADS=$MAX_THREADS
13 fi
14 [ "$SIZE" ] || SIZE=20480
15 [ "$RSIZE" ] || RSIZE=64
16 [ "$UID" ] || UID=1000
17 [ "$MNT" ] || MNT=/mnt/lustre
18 [ "$TMP" ] || TMP=/tmp
19 [ "$COUNT" ] || COUNT=1000
20 [ "$DEBUG_OFF" ] || DEBUG_OFF="eval echo 0 > /proc/sys/portals/debug"
21
22 for NAME in $CONFIGS; do
23         export NAME
24         [ -e $NAME.sh ] && sh $NAME.sh
25         [ ! -e $NAME.xml ] && echo "no config '$NAME.xml'" 1>&2 && exit 1
26
27         if [ "$RUNTESTS" != "no" ]; then
28                 sh runtests
29         fi
30
31         [ "$SANITY" != "no" ] && sh sanity.sh
32         [ "$SANITY" != "no" ] && START=" " CLEAN=" " sh sanity.sh
33
34         if [ "$DBENCH" != "no" ]; then
35                 mount | grep $MNT || sh llmount.sh
36                 SPACE=`df $MNT | tail -1 | awk '{ print $4 }'`
37                 DB_THREADS=`expr $SPACE / 50000`
38                 [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
39
40                 $DEBUG_OFF
41                 sh rundbench 1
42                 sh llmountcleanup.sh
43                 sh llrmount.sh
44                 if [ $DB_THREADS -gt 1 ]; then
45                         $DEBUG_OFF
46                         sh rundbench $DB_THREADS
47                         sh llmountcleanup.sh
48                         sh llrmount.sh
49                 fi
50                 rm -f /mnt/lustre/client.txt
51         fi
52         chown $UID $MNT && chmod 700 $MNT
53         if [ "$BONNIE" != "no" ]; then
54                 mount | grep $MNT || sh llmount.sh
55                 $DEBUG_OFF
56                 bonnie++ -s 0 -n 10 -u $UID -d $MNT
57                 sh llmountcleanup.sh
58                 sh llrmount.sh
59         fi
60         IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r $RSIZE -s $SIZE"
61         IOZONE_FILE="-f $MNT/iozone"
62         if [ "$IOZONE" != "no" ]; then
63                 mount | grep $MNT || sh llmount.sh
64                 $DEBUG_OFF
65                 iozone $IOZONE_OPTS $IOZONE_FILE
66                 sh llmountcleanup.sh
67                 sh llrmount.sh
68         fi
69         if [ "$IOZONE_DIR" != "no" ]; then
70                 mount | grep $MNT || sh llmount.sh
71                 SPACE=`df $MNT | tail -1 | awk '{ print $4 }'`
72                 IOZ_THREADS=`expr $SPACE / $SIZE`
73                 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
74
75                 $DEBUG_OFF
76                 iozone -I $IOZONE_OPTS $IOZONE_FILE.odir
77                 IOZVER=`iozone -v | awk '/Revision:/ { print $3 }' | tr -d '.'`
78                 sh llmountcleanup.sh
79                 sh llrmount.sh
80                 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
81                         $DEBUG_OFF
82                         THREAD=1
83                         IOZONE_FILE="-F "
84                         while [ $THREAD -le $IOZ_THREADS ]; do
85                                 IOZONE_FILE="$IOZONE_FILE $MNT/iozone.$THREAD"
86                                 THREAD=`expr $THREAD + 1`
87                         done
88                         iozone -I $IOZONE_OPTS -t $IOZ_THREADS $IOZONE_FILE
89                         sh llmountcleanup.sh
90                         sh llrmount.sh
91                 elif [ $IOZVER -lt 3145 ]; then
92                         VER=`iozone -v | awk '/Revision:/ { print $3 }'`
93                         echo "iozone $VER too old for multi-threaded tests"
94                 fi
95         fi
96         if [ "$FSX" != "no" ]; then
97                 mount | grep $MNT || sh llmount.sh
98                 $DEBUG_OFF
99                 ./fsx -W -c 50 -p 1000 -P $TMP -l 1024000 -N $(($COUNT * 100)) $MNT/fsxfile
100                 sh llmountcleanup.sh
101                 #sh llrmount.sh
102         fi      
103         mount | grep $MNT && sh llmountcleanup.sh
104 done
105
106 if [ "$SANITYN" != "no" ]; then
107         export NAME=mount2
108         mount | grep $MNT || sh llmount.sh
109         sh sanityN.sh
110         mount | grep $MNT && sh llmountcleanup.sh
111 fi