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