Whamcloud - gitweb
- add an argument to select which tests to run
[fs/lustre-release.git] / lustre / tests / lov.sh
index 6419d9b..2be5a74 100755 (executable)
@@ -1,27 +1,53 @@
 #!/bin/bash
 
+set -e
+
+export PATH=`dirname $0`/../utils:$PATH
+
 config=${1:-lov.xml}
 
-LMC=../utils/lmc
+LMC=${LMC:-lmc}
 TMP=${TMP:-/tmp}
 
-MDSDEV=$TMP/mds1
-MDSSIZE=50000
+MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
+MDSSIZE=${MDSSIZE:-100000}
+FSTYPE=${FSTYPE:-ext3}
+
+OSTCOUNT=${OSTCOUNT:-5}
+# OSTDEVN will still override the device for OST N
 
-OSTDEV1=$TMP/ost1
-OSTDEV2=$TMP/ost2
-OSTSIZE=100000
+OSTSIZE=${OSTSIZE:-100000}
+# 1 to config an echo client instead of llite
+ECHO_CLIENT=${ECHO_CLIENT:-}
+
+STRIPE_BYTES=65536
+STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-$((OSTCOUNT -1))}
+
+# specific journal size for the ost, in MB
+JSIZE=${JSIZE:-0}
+JARG=""
+[ "$JSIZE" -gt 0 ] && JARG="--journal_size $JSIZE"
 
 # create nodes
-${LMC} -o $config --node localhost --net localhost tcp || exit 1
+${LMC} -o $config --add net --node localhost --nid localhost --nettype tcp
 
 # configure mds server
-${LMC} -m $config --format --node localhost --mds mds1 $MDSDEV $MDSSIZE || exit 10
+${LMC} -m $config --format --add mds --node localhost --mds mds1 --fstype $FSTYPE --dev $MDSDEV --size $MDSSIZE
 
 # configure ost
-${LMC} -m $config --lov lov1 mds1 65536 0 0 || exit 20
-${LMC} -m $config --node localhost --lov lov1 --ost $OSTDEV1 $OSTSIZE || exit 21
-${LMC} -m $config --node localhost --lov lov1 --ost $OSTDEV2 $OSTSIZE || exit 22
-
-# create client config
-${LMC} -m $config  --node localhost --mtpt /mnt/lustre mds1 lov1 || exit 30
+${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
+
+for num in `seq $OSTCOUNT`; do
+    OST=ost$num
+    DEVPTR=OSTDEV$num
+    eval $DEVPTR=${!DEVPTR:=$TMP/$OST-`hostname`}
+    ${LMC} -m $config --add ost --node localhost --lov lov1 --ost $OST --fstype $FSTYPE --dev ${!DEVPTR} --size $OSTSIZE $JARG
+done
+
+
+if [ -z "$ECHO_CLIENT" ]; then
+       # create client config
+       ${LMC} -m $config  --add mtpt --node localhost --path /mnt/lustre --mds mds1 --lov lov1
+else
+       ${LMC} -m $config  --add echo_client --node localhost --ost lov1
+fi