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