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