Whamcloud - gitweb
common.sh: move all of the portals setup from setup() to setup_portals().
authoradilger <adilger>
Tue, 9 Apr 2002 00:02:46 +0000 (00:02 +0000)
committeradilger <adilger>
Tue, 9 Apr 2002 00:02:46 +0000 (00:02 +0000)
- 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.

13 files changed:
lustre/tests/common.sh
lustre/tests/lldlm.sh
lustre/tests/llecho.sh
lustre/tests/llext3.sh
lustre/tests/lllocalmount.sh
lustre/tests/llmount-client.sh
lustre/tests/llmount-server.sh
lustre/tests/llmount.sh
lustre/tests/llrext3.sh
lustre/tests/llrmount.sh
lustre/tests/mdcreq.sh
lustre/tests/ostreq.sh
lustre/tests/runfailure-mds

index c8f7570..d0f835c 100644 (file)
@@ -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
 }
index 462d5df..3cf5b4a 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 $OBDCTL <<EOF
 device 0
index 42d2a05..f906242 100644 (file)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 $OBDCTL <<EOF
 device 0
index 7dcc034..534879a 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 new_fs ext2 /tmp/ost 10000
 OST=$LOOPDEV
index 723caa7..4c62233 100755 (executable)
@@ -3,7 +3,13 @@
 SRCDIR="`dirname $0`"
 . $SRCDIR/common.sh
 
-setup
+NETWORK=tcp
+LOCALHOST=localhost
+SERVER=localhost
+PORT=1234
+
+setup_portals
+setup_lustre
 
 new_fs ext2 /tmp/ost 10000
 OST=${LOOPDEV}
index 46b3e1f..962c109 100644 (file)
@@ -9,8 +9,8 @@ LOCALHOST=dev5
 SERVER=dev4
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 $OBDCTL <<EOF
 device 0
index a506e7a..a1a76cc 100644 (file)
@@ -10,8 +10,8 @@ LOCALHOST=dev4
 SERVER=dev4
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 new_fs ext2 /tmp/ost 6000000
 OST=${LOOPDEV}
index 65adf4d..094abda 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 new_fs ext2 /tmp/ost 10000
 OST=$LOOPDEV
index a958c8d..79fe4c2 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 old_fs ext2 /tmp/ost 10000
 OST=$LOOPDEV
index 45e0b62..69f6ad9 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 old_fs ext2 /tmp/ost 80000
 OST=$LOOPDEV
index fc24eb2..e3cba0d 100644 (file)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 MDSFS=ext2
 new_fs ${MDSFS} /tmp/mds 1000
index bdfd634..658e100 100644 (file)
@@ -4,18 +4,20 @@ SRCDIR="`dirname $0`"
 . $SRCDIR/common.sh
 
 SERVER=localhost
+PORT=1234
 
-setup
+$ACCEPTOR $PORT
 
 $PTLCTL <<EOF
 mynid localhost
 setup tcp
-connect $SERVER 1234
+connect $SERVER $PORT
 add_uuid self
 add_uuid ost
 quit
 EOF
 
+setup_lustre
 
 tmp_fs ext2 /tmp/fs 10000
 OBD=${LOOPDEV}
index 940d45b..ebb06d2 100755 (executable)
@@ -8,8 +8,8 @@ LOCALHOST=localhost
 SERVER=localhost
 PORT=1234
 
-setup
 setup_portals
+setup_lustre
 
 new_fs ext2 /tmp/ost 10000
 OST=$LOOPDEV