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