Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / tests / echo.sh
index 61a0378..f289f94 100755 (executable)
@@ -13,9 +13,11 @@ config=${config:-$(basename $0 .sh).xml}
 LMC=${LMC:-../utils/lmc -m $config}
 TMP=${TMP:-/tmp}
 
-SERVER=${SERVER:-localhost}
-CLIENT=${CLIENT:-localhost}
+HOSTNAME=`hostname`
+SERVER=${SERVER:-$HOSTNAME}
+CLIENT=${CLIENT:-$HOSTNAME}
 NET=${NET:-tcp}
+[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
 
 h2tcp () {
        case $1 in
@@ -24,12 +26,19 @@ h2tcp () {
        esac
 }
 
+h2mx () {
+       case $1 in
+       client) echo '\*' ;;
+       *) echo $1 ;;
+       esac
+}
+
 h2gm () {
        echo `gmnalnid -n $1`
 }
 
 h2elan () {
-    echo $1 | sed 's/[^0-9]*//g'
+       echo $1 | sed 's/[^0-9]*//g'
 }
 
 h2iib () {
@@ -38,6 +47,15 @@ h2iib () {
         *) echo $1 | sed "s/[^0-9]*//" ;;
         esac
 }
+
+#
+# PJK: I believe this is correct
+# PTL NID's are of the form
+# num@ptl
+#
+h2ptl () { 
+        echo $1 | sed 's/[^0-9]*//g' 
+}
         
 # FIXME: make LMC not require MDS for obdecho LOV
 MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
@@ -50,7 +68,7 @@ STRIPES_PER_OBJ=2     # 0 means stripe over all OSTs
 rm -f $config
 # create nodes
 $LMC --add node --node $SERVER  || exit 1
-$LMC --add net --node $SERVER --nid `h2$NET $SERVER` --nettype $NET || exit 2
+$LMC --add net --node $SERVER --nid `h2$NET $SERVER` --nettype $NET $PORT_OPT|| exit 2
 
 if (($LOV)); then
     $LMC --add mds --node $SERVER --mds mds1 --fstype $FSTYPE --dev $MDSDEV --size $MDSSIZE || exit 10
@@ -65,7 +83,7 @@ fi
 
 if [ "$SERVER" != "$CLIENT" ]; then
    $LMC --add node --node $CLIENT  || exit 1
-   $LMC --add net --node $CLIENT --nid `h2$NET $CLIENT` --nettype $NET || exit 2
+   $LMC --add net --node $CLIENT --nid `h2$NET $CLIENT` --nettype $NET $PORT_OPT || exit 2
 fi
 
 $LMC --add echo_client --node $CLIENT --ost ${OBD_NAME} || exit 3