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