Whamcloud - gitweb
land b_md onto HEAD:
[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         mount | grep $MNT || sh llmount.sh
26         [ "$SANITY" != "no" ] && sh sanity.sh
27         if [ "$DBENCH" != "no" ]; then
28                 $DEBUG_OFF
29                 sh rundbench 1
30                 sh llmountcleanup.sh
31                 sh llrmount.sh
32                 if [ $THREADS -gt 1 ]; then
33                         sh rundbench $THREADS
34                         sh llmountcleanup.sh
35                         sh llrmount.sh
36                 fi
37                 rm -f /mnt/lustre/client.txt
38         fi
39         chown $UID $MNT && chmod 700 $MNT
40         if [ "$BONNIE" != "no" ]; then
41                 $DEBUG_OFF
42                 bonnie++ -s 0 -n 10 -u $UID -d $MNT
43                 sh llmountcleanup.sh
44                 sh llrmount.sh
45         fi
46         IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r $RSIZE -s $SIZE"
47         IOZONE_FILE="-f $MNT/iozone"
48         if [ "$IOZONE" != "no" ]; then
49                 $DEBUG_OFF
50                 iozone $IOZONE_OPTS $IOZONE_FILE
51                 sh llmountcleanup.sh
52                 sh llrmount.sh
53         fi
54         if [ "$IOZONE_DIR" != "no" ]; then
55                 $DEBUG_OFF
56                 iozone -I $IOZONE_OPTS $IOZONE_FILE.odir
57                 IOZVER=`iozone -v | awk '/Revision:/ { print $3 }' | tr -d '.'`
58                 sh llmountcleanup.sh
59                 sh llrmount.sh
60                 if [ "$THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
61                         $DEBUG_OFF
62                         THREAD=1
63                         IOZONE_FILE="-F "
64                         SIZE=`expr $SIZE / $THREADS`
65                         while [ $THREAD -le $THREADS ]; do
66                                 IOZONE_FILE="$IOZONE_FILE $MNT/iozone.$THREAD"
67                                 THREAD=`expr $THREAD + 1`
68                         done
69                         iozone -I $IOZONE_OPTS -t $THREADS $IOZONE_FILE
70                         sh llmountcleanup.sh
71                         sh llrmount.sh
72                 elif [ $IOZVER -lt 3145 ]; then
73                         VER=`iozone -v | awk '/Revision:/ { print $3 }'`
74                         echo "iozone $VER too old for multi-threaded tests"
75                 fi
76         fi
77         if [ "$FSX" != "no" ]; then
78                 $DEBUG_OFF
79                 ./fsx -c 50 -p 1000 -P $TMP -l 1024000 -N $(($COUNT * 100)) $MNT/fsxfile
80                 sh llmountcleanup.sh
81                 #sh llrmount.sh
82         fi      
83         mount | grep $MNT && sh llmountcleanup.sh
84 done