From: adilger Date: Tue, 9 Apr 2002 00:02:46 +0000 (+0000) Subject: common.sh: move all of the portals setup from setup() to setup_portals(). X-Git-Tag: v1_7_100~5787 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2e1a3c7f9f05885e6e1fdece01c85341fae1e2e3;p=fs%2Flustre-release.git common.sh: move all of the portals setup from setup() to setup_portals(). - make the NAL module conditional upon the network connection type. - rename setup() to be setup_lustre(). all others: - you need to call setup_portals() before setup_lustre() now. --- diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh index c8f7570..d0f835c 100644 --- a/lustre/tests/common.sh +++ b/lustre/tests/common.sh @@ -1,7 +1,7 @@ export PATH=$PATH:/sbin:/usr/sbin if [ -d /r ]; then - R=/r + R=/r fi PTLCTL=$SRCDIR/../../portals/linux/utils/ptlctl @@ -11,14 +11,13 @@ ACCEPTOR=$SRCDIR/../../portals/linux/utils/acceptor LOOPNUM=0; export LOOPNUM if [ -b /dev/loop0 ]; then - LOOP=/dev/loop + LOOP=/dev/loop else - if [ -b /dev/loop/0 ]; then - LOOP=/dev/loop/ - else - echo "Cannot find /dev/loop0 or /dev/loop/0"; - exit -1 - fi + if [ -b /dev/loop/0 ]; then + LOOP=/dev/loop/ + else + echo "Cannot find /dev/loop0 or /dev/loop/0" 1>&2 && exit -1 + fi fi # Return the next unused loop device on stdout and in the $LOOPDEV @@ -92,56 +91,34 @@ old_fs () { list_mods() { $DEBCTL modules > $R/tmp/ogdb - echo "The GDB module script is in /tmp/ogdb. Press enter to continue" - read -} - -setup() { - [ -c /dev/portals ] || mknod /dev/portals c 10 240 - - insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1 - insmod $SRCDIR/../../portals/linux/qswnal/kqswnal.o - insmod $SRCDIR/../../portals/linux/socknal/ksocknal.o || exit -1 - - [ "$NETWORK" = "tcp" ] && ($ACCEPTOR $PORT) - - [ -c /dev/obd ] || mknod /dev/obd c 10 241 - - insmod $SRCDIR/../../obd/class/obdclass.o || exit -1 - insmod $SRCDIR/../../obd/rpc/ptlrpc.o || exit -1 - insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1 - insmod $SRCDIR/../../obd/ext2obd/obdext2.o || exit -1 - insmod $SRCDIR/../../obd/filterobd/obdfilter.o || exit -1 - insmod $SRCDIR/../../obd/ost/ost.o || exit -1 - insmod $SRCDIR/../../obd/osc/osc.o || exit -1 - insmod $SRCDIR/../../obd/obdecho/obdecho.o || exit -1 - insmod $SRCDIR/../../obd/mds/mds.o || exit -1 - insmod $SRCDIR/../../obd/mdc/mdc.o || exit -1 - insmod $SRCDIR/../../obd/llight/llite.o || exit -1 - - list_mods - - [ -d /mnt/lustre ] || mkdir /mnt/lustre + echo "The GDB module script is in /tmp/ogdb" } setup_portals() { if [ -z "$NETWORK" -o -z "$LOCALHOST" -o -z "$SERVER" ]; then - echo "$0: NETWORK or LOCALHOST or SERVER is not set" + echo "$0: NETWORK or LOCALHOST or SERVER is not set" 1>&2 exit -1 fi + [ -c /dev/portals ] || mknod /dev/portals c 10 240 + + insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1 + case $NETWORK in elan) if [ "$PORT" ]; then - echo "$0: NETWORK is elan but PORT is set" + echo "$0: NETWORK is elan but PORT is set" 1>&2 exit -1 fi + insmod $SRCDIR/../../portals/linux/qswnal/kqswnal.o ;; tcp) if [ -z "$PORT" ]; then - echo "$0: NETWORK is tcp but PORT is not set" + echo "$0: NETWORK is tcp but PORT is not set" 1>&2 exit -1 fi + insmod $SRCDIR/../../portals/linux/socknal/ksocknal.o || exit -1 + $ACCEPTOR $PORT ;; - *) echo "$0: unknown NETWORK \'$NETWORK\'" + *) echo "$0: unknown NETWORK \'$NETWORK\'" 1>&2 exit -1 ;; esac @@ -157,13 +134,33 @@ setup_portals() { EOF } +setup_lustre() { + [ -c /dev/obd ] || mknod /dev/obd c 10 241 + + insmod $SRCDIR/../../obd/class/obdclass.o || exit -1 + insmod $SRCDIR/../../obd/rpc/ptlrpc.o || exit -1 + insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1 + insmod $SRCDIR/../../obd/ext2obd/obdext2.o || exit -1 + insmod $SRCDIR/../../obd/filterobd/obdfilter.o || exit -1 + insmod $SRCDIR/../../obd/ost/ost.o || exit -1 + insmod $SRCDIR/../../obd/osc/osc.o || exit -1 + insmod $SRCDIR/../../obd/obdecho/obdecho.o || exit -1 + insmod $SRCDIR/../../obd/mds/mds.o || exit -1 + insmod $SRCDIR/../../obd/mdc/mdc.o || exit -1 + insmod $SRCDIR/../../obd/llight/llite.o || exit -1 + + list_mods + + [ -d /mnt/lustre ] || mkdir /mnt/lustre +} + setup_ldlm() { - [ -c /dev/portals ] || mknod /dev/portals c 10 240 + [ -c /dev/portals ] || mknod /dev/portals c 10 240 - insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1 + insmod $SRCDIR/../../portals/linux/oslib/portals.o || exit -1 - insmod $SRCDIR/../../obd/class/obdclass.o || exit -1 - insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1 + insmod $SRCDIR/../../obd/class/obdclass.o || exit -1 + insmod $SRCDIR/../../obd/ldlm/ldlm.o || exit -1 - list_mods + list_mods } diff --git a/lustre/tests/lldlm.sh b/lustre/tests/lldlm.sh index 462d5df..3cf5b4a 100755 --- a/lustre/tests/lldlm.sh +++ b/lustre/tests/lldlm.sh @@ -8,8 +8,8 @@ LOCALHOST=localhost SERVER=localhost PORT=1234 -setup setup_portals +setup_lustre $OBDCTL <