Whamcloud - gitweb
land b_md onto HEAD:
[fs/lustre-release.git] / lustre / tests / llecho.sh
index 95d40f8..a47c088 100644 (file)
@@ -1,20 +1,49 @@
 #!/bin/sh
 
 config=echo.xml
-lmc=../utils/lmc
-lconf=../utils/lconf
+LCONF=${LCONF:-../utils/lconf}
+LMC=${LMC:-../utils/lmc}
+
+SERVER=localhost
+CLIENT=localhost
+
+# FIXME: make LMC not require MDS for obdecho LOV
+MDSDEV=$TMP/mds1
+MDSSIZE=10000
+
+STRIPE_BYTES=65536
+STRIPES_PER_OBJ=2      # 0 means stripe over all OSTs
+
+LOV=0
+while [ "$1" ]; do
+        case $1 in
+        --lov) LOV="1" ;;
+       *) OPTS="$OPTS $1" ;;
+        esac
+        shift
+done
 
 # create nodes
-$lmc -o $config --node localhost --net localhost tcp 
-$lmc -m $config --node localhost --obdtype=obdecho --ost
-# force the osc to be configured (this is normally done when it is mounted)
-$lmc -m $config --node localhost --osc OSC_localhost
+$LMC -o $config --node $SERVER --net $SERVER tcp || exit 1
 
-$lconf --gdb $config
+if (($LOV)); then
+    $LMC -m $config --node $SERVER --mds mds1 $MDSDEV $MDSSIZE || exit 10
+    $LMC -m $config --lov lov1 mds1 $STRIPE_BYTES $STRIPES_PER_OBJ 0 || exit 11
+    $LMC -m $config --node $SERVER --lov lov1 --obdtype=obdecho --ost || exit 12
+    $LMC -m $config --node $SERVER --lov lov1 --obdtype=obdecho --ost || exit 13
+
+    $LMC -m $config --node $CLIENT --echo_client lov1 || exit 3
+else
+    $LMC -m $config --node $SERVER --obdtype=obdecho --ost || exit 2
+    # force the osc to be configured (this is normally done when it is mounted)
+    $LMC -m $config --node $CLIENT --osc OSC_$SERVER || exit 3
+    $LMC -m $config --node $CLIENT --echo_client OSC_${SERVER} || exit 3
+fi
+
+$LCONF --gdb $OPTS $config || exit 4
 
 cat <<EOF
 
 run getattr tests as:
-../utils/lctl --device '\$OSC_localhost' test_getattr 1000000
+../utils/lctl --device '\$ECHO_$SERVER' test_getattr 1000000
 EOF
-