Whamcloud - gitweb
Copy the extent lock policy data only in the completion callback, or in the
[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 PATH=`dirname $0`/../utils:$PATH
7
8 [ "$CONFIGS" ] || CONFIGS="local lov"
9 [ "$MAX_THREADS" ] || MAX_THREADS=10
10 if [ -z "$THREADS" ]; then
11         KB=`awk '/MemTotal:/ { print $2 }' /proc/meminfo`
12         THREADS=`expr $KB / 16384`
13         [ $THREADS -gt $MAX_THREADS ] && THREADS=$MAX_THREADS
14 fi
15 [ "$SIZE" ] || SIZE=40960
16 [ "$RSIZE" ] || RSIZE=512
17 [ "$UID" ] || UID=1000
18 [ "$MOUNT" ] || MOUNT=/mnt/lustre
19 [ "$MOUNT2" ] || MOUNT2=${MOUNT}2
20 [ "$TMP" ] || TMP=/tmp
21 [ "$COUNT" ] || COUNT=1000
22 #[ "$DEBUG_LVL" ] || DEBUG_LVL=0x370200
23 [ "$DEBUG_LVL" ] || DEBUG_LVL=0
24 [ "$DEBUG_OFF" ] || DEBUG_OFF="eval echo $DEBUG_LVL > /proc/sys/portals/debug"
25 [ "$DEBUG_ON" ] || DEBUG_ON="eval echo -1 > /proc/sys/portals/debug"
26
27 for NAME in $CONFIGS; do
28         export NAME MOUNT
29         [ -e $NAME.sh ] && sh $NAME.sh
30         [ ! -e $NAME.xml ] && [ -z "$LDAPURL" ] && \
31                 echo "no config '$NAME.xml'" 1>&2 && exit 1
32
33         if [ "$RUNTESTS" != "no" ]; then
34                 sh runtests
35         fi
36
37         if [ "$SANITY" != "no" ]; then
38                 SANITYLOG=/tmp/sanity.log START=: CLEAN=: sh sanity.sh
39         fi
40
41         if [ "$DBENCH" != "no" ]; then
42                 mount | grep $MOUNT || sh llmount.sh
43                 SPACE=`df $MOUNT | tail -1 | awk '{ print $4 }'`
44                 DB_THREADS=`expr $SPACE / 50000`
45                 [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
46
47                 $DEBUG_OFF
48                 sh rundbench 1
49                 $DEBUG_ON
50                 sh llmountcleanup.sh
51                 sh llrmount.sh
52                 if [ $DB_THREADS -gt 1 ]; then
53                         $DEBUG_OFF
54                         sh rundbench $DB_THREADS
55                         $DEBUG_ON
56                         sh llmountcleanup.sh
57                         sh llrmount.sh
58                 fi
59                 rm -f /mnt/lustre/`hostname`/client.txt
60         fi
61         chown $UID $MOUNT && chmod 700 $MOUNT
62         if [ "$BONNIE" != "no" ]; then
63                 mount | grep $MOUNT || sh llmount.sh
64                 $DEBUG_OFF
65                 bonnie++ -f -r 0 -s $(($SIZE / 1024)) -n 10 -u $UID -d $MOUNT
66                 $DEBUG_ON
67                 sh llmountcleanup.sh
68                 sh llrmount.sh
69         fi
70         IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r $RSIZE -s $SIZE"
71         if [ "$O_DIRECT" -a  "$O_DIRECT" != "no" ]; then
72             IOZONE_OPTS="-I $IOZONE_OPTS"
73         fi
74         IOZONE_FILE="-f $MOUNT/iozone"
75         if [ "$IOZONE" != "no" ]; then
76                 mount | grep $MOUNT || sh llmount.sh
77                 $DEBUG_OFF
78                 iozone $IOZONE_OPTS $IOZONE_FILE
79                 $DEBUG_ON
80                 sh llmountcleanup.sh
81                 sh llrmount.sh
82         fi
83         if [ "$IOZONE_DIR" != "no" ]; then
84                 mount | grep $MOUNT || sh llmount.sh
85                 SPACE=`df $MOUNT | tail -1 | awk '{ print $4 }'`
86                 IOZ_THREADS=`expr $SPACE / \( $SIZE + $SIZE / 512 \)`
87                 [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
88
89                 $DEBUG_OFF
90                 iozone $IOZONE_OPTS $IOZONE_FILE.odir
91                 IOZVER=`iozone -v | awk '/Revision:/ { print $3 }' | tr -d '.'`
92                 $DEBUG_ON
93                 sh llmountcleanup.sh
94                 sh llrmount.sh
95                 if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
96                         $DEBUG_OFF
97                         THREAD=1
98                         IOZONE_FILE="-F "
99                         while [ $THREAD -le $IOZ_THREADS ]; do
100                                 IOZONE_FILE="$IOZONE_FILE $MOUNT/iozone.$THREAD"
101                                 THREAD=`expr $THREAD + 1`
102                         done
103                         iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZONE_FILE
104                         $DEBUG_ON
105                         sh llmountcleanup.sh
106                         sh llrmount.sh
107                 elif [ $IOZVER -lt 3145 ]; then
108                         VER=`iozone -v | awk '/Revision:/ { print $3 }'`
109                         echo "iozone $VER too old for multi-threaded tests"
110                 fi
111         fi
112         if [ "$FSX" != "no" ]; then
113                 mount | grep $MOUNT || sh llmount.sh
114                 $DEBUG_OFF
115                 ./fsx -W -c 50 -p 1000 -P $TMP -l $SIZE \
116                         -N $(($COUNT * 100)) $MOUNT/fsxfile
117                 $DEBUG_ON
118                 sh llmountcleanup.sh
119                 sh llrmount.sh
120         fi      
121         if [ "$SANITYN" != "no" ]; then
122                 mount | grep $MOUNT || sh llmount.sh
123                 $DEBUG_OFF
124
125                 mkdir -p $MOUNT2
126                 case $NAME in
127                 local|lov)
128                         MDSNODE=`hostname`
129                         MDSNAME=mds1
130                         CLIENT=client
131                         ;;
132                 *)      # we could extract this from $NAME.xml somehow
133                         ;;
134                 esac
135                 if [ "$MDSNODE" -a "$MDSNAME" -a "$CLIENT" ]; then
136                         llmount $MDSNODE:/$MDSNAME/$CLIENT $MOUNT2
137                         SANITYLOG=$TMP/sanity.log START=: CLEAN=: sh sanityN.sh
138                         umount $MOUNT2
139                 else
140                         echo "don't know \$MDSNODE, \$MDSNAME, \$CLIENT"
141                         echo "can't mount2 for '$NAME', skipping sanityN.sh"
142                 fi
143
144                 $DEBUG_ON
145                 sh llmountcleanup.sh
146                 #sh llrmount.sh
147         fi
148
149         mount | grep $MOUNT && sh llmountcleanup.sh
150 done
151
152 if [ "$REPLAY_SINGLE" != "no" ]; then
153         sh replay-single.sh
154 fi
155
156 if [ "$CONF_SANITY" != "no" ]; then
157         sh conf-sanity.sh
158 fi
159
160 if [ "$RECOVERY_SMALL" != "no" ]; then
161         sh recovery-small.sh
162 fi
163
164 if [ "$REPLAY_OST_SINGLE" != "no" ]; then
165         sh replay-ost-single.sh
166 fi