From ae2a66b3fab463039c03ca42578bb73afa749fe8 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 22 Mar 2002 23:52:08 +0000 Subject: [PATCH] Move portals setup into a helper function "setup_portals" that uses the enviroment variables "NETWORK={elan,tcp}", LOCALHOST, SERVER, and PORT. --- lustre/tests/common.sh | 35 +++++++++++++++++++++++++++++++++-- lustre/tests/llext3.sh | 17 ++++++----------- lustre/tests/llmount.sh | 14 ++++---------- lustre/tests/llrext3.sh | 21 ++++++++------------- lustre/tests/llrmount.sh | 16 ++++++---------- 5 files changed, 57 insertions(+), 46 deletions(-) diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh index 35b9a0a..fcfe368 100644 --- a/lustre/tests/common.sh +++ b/lustre/tests/common.sh @@ -1,4 +1,3 @@ - export PATH=$PATH:/sbin:/usr/sbin if [ -d /r ]; then @@ -58,7 +57,7 @@ setup() { insmod $SRCDIR/../../portals/linux/qswnal/kqswnal.o insmod $SRCDIR/../../portals/linux/socknal/ksocknal.o || exit -1 - $ACCEPTOR 1234 & + [ "$NETWORK" = "tcp" ] && $ACCEPTOR $PORT & [ -c /dev/obd ] || mknod /dev/obd c 10 241 @@ -77,6 +76,38 @@ setup() { [ -d /mnt/obd ] || mkdir /mnt/obd } +setup_portals() { + if [ "$NETWORK" -a "$LOCALHOST" -a "$SERVER" ]; then + echo "$0: NETWORK or LOCALHOST or SERVER is not set" + exit -1 + fi + + case $NETWORK in + elan) if [ "$PORT" ]; then + echo "$0: NETWORK is elan but PORT is set" + exit -1 + fi + ;; + tcp) if [ -z "$PORT" ]; then + echo "$0: NETWORK is tcp but PORT is not set" + exit -1 + fi + ;; + *) echo "$0: unknown NETWORK \'$NETWORK\'" + exit -1 + ;; + esac + + $PTLCTL <<- EOF + setup $NETWORK + mynid $LOCALHOST + connect $SERVER $PORT + add_uuid self + add_uuid mds + add_uuid ost + EOF +} + setup_ldlm() { [ -c /dev/portals ] || mknod /dev/portals c 10 240 diff --git a/lustre/tests/llext3.sh b/lustre/tests/llext3.sh index 211cfdf..530ddce 100755 --- a/lustre/tests/llext3.sh +++ b/lustre/tests/llext3.sh @@ -3,21 +3,16 @@ SRCDIR="`dirname $0`" . $SRCDIR/common.sh -setup +NETWORK=tcp +LOCALHOST=localhost +SERVER=localhost +PORT=1234 -$PTLCTL < /proc/sys/portals/debug diff --git a/lustre/tests/llrmount.sh b/lustre/tests/llrmount.sh index ca1ed31..2a79f38 100755 --- a/lustre/tests/llrmount.sh +++ b/lustre/tests/llrmount.sh @@ -3,17 +3,13 @@ SRCDIR="`dirname $0`" . $SRCDIR/common.sh -setup +NETWORK=tcp +LOCALHOST=localhost +SERVER=localhost +PORT=1234 -$PTLCTL <