Whamcloud - gitweb
- run config in production
authorrread <rread>
Fri, 12 Jul 2002 03:02:27 +0000 (03:02 +0000)
committerrread <rread>
Fri, 12 Jul 2002 03:02:27 +0000 (03:02 +0000)
lustre/tests/common.sh
lustre/utils/lconf

index 6357dee..a97bfcb 100644 (file)
@@ -6,6 +6,7 @@ export PATH=$PATH:/sbin:/usr/sbin
 # check if running in source directory
 # will probably need to create variable for each module.
 if [ -f $SRCDIR/Makefile.am ]; then
+    USEDEV=yes
     PORTALS=$SRCDIR/../../portals
     LUSTRE=$SRCDIR/..
 
@@ -15,6 +16,7 @@ if [ -f $SRCDIR/Makefile.am ]; then
 
     OBDCTL=$LUSTRE/utils/obdctl
 else
+    USEDEV=no
     # should have configure set the paths here
     BINDIR=/usr/sbin
     PORTALS=/lib/modules
@@ -137,6 +139,19 @@ list_mods() {
        [ "$DEBUG_WAIT" = "yes" ] && echo -n "Press ENTER to continue" && read
 }
 
+# start acceptor for a given network and port.
+# not all networks need an acceptor
+start_acceptor() {
+    case $NETWORK in
+    elan)   [ "$PORT" ] && fail "$0: NETWORK is elan but PORT is set"
+       ;;
+    tcp)    [ "$PORT" ] || fail "$0: NETWORK is tcp but PORT is not set"
+       $ACCEPTOR $PORT
+       ;;
+    *)         fail "$0: unknown NETWORK '$NETWORK'" ;;
+
+}
+
 # We need at least one setup file to be given.  It can be passed on
 # the command-line, or it can be found in the home directory, or it
 # can even be sourced into the current shell environment.
@@ -182,19 +197,19 @@ setup_portals() {
 
        [ -c /dev/portals ] || mknod /dev/portals c 10 240
 
-       do_insmod $PORTALS/linux/oslib/portals.o || exit -1
+       if [  "$USEDEV" = "yes ]; then
+           do_insmod $PORTALS/linux/oslib/portals.o || exit -1
 
-       case $NETWORK in
-       elan)   [ "$PORT" ] && fail "$0: NETWORK is elan but PORT is set"
-               do_insmod $PORTALS/linux/qswnal/kqswnal.o || exit -1
-               ;;
-       tcp)    [ "$PORT" ] || fail "$0: NETWORK is tcp but PORT is not set"
-               do_insmod $PORTALS/linux/socknal/ksocknal.o || exit -1
-               $ACCEPTOR $PORT
-               ;;
-       *)      fail "$0: unknown NETWORK '$NETWORK'" ;;
+           case $NETWORK in
+           elan)  do_insmod $PORTALS/linux/qswnal/kqswnal.o || exit -1
+                   ;;
+           tcp)   do_insmod $PORTALS/linux/socknal/ksocknal.o || exit -1
+                  ;;
+           *)  fail "$0: unknown NETWORK '$NETWORK'" ;;
        esac
 
+       start_acceptor
+
        $PTLCTL <<- EOF
        setup $NETWORK
        mynid $LOCALHOST
@@ -212,24 +227,26 @@ setup_portals() {
 setup_lustre() {
        [ -c /dev/obd ] || mknod /dev/obd c 10 241
 
-       do_insmod $LUSTRE/obdclass/obdclass.o || exit -1
-       do_insmod $LUSTRE/ptlrpc/ptlrpc.o || exit -1
-       do_insmod $LUSTRE/ldlm/ldlm.o || exit -1
-       do_insmod $LUSTRE/extN/extN.o || \
+       if [ "$USEDEV" = "yes" ]; then
+           do_insmod $LUSTRE/obdclass/obdclass.o || exit -1
+           do_insmod $LUSTRE/ptlrpc/ptlrpc.o || exit -1
+           do_insmod $LUSTRE/ldlm/ldlm.o || exit -1
+           do_insmod $LUSTRE/extN/extN.o || \
                echo "info: can't load extN.o module, not fatal if using ext3"
-       do_insmod $LUSTRE/mds/mds.o || exit -1
-       #do_insmod $LUSTRE/mds/mds_ext2.o || exit -1
-       #do_insmod $LUSTRE/mds/mds_ext3.o || exit -1
-       do_insmod $LUSTRE/mds/mds_extN.o || \
+           do_insmod $LUSTRE/mds/mds.o || exit -1
+           #do_insmod $LUSTRE/mds/mds_ext2.o || exit -1
+           #do_insmod $LUSTRE/mds/mds_ext3.o || exit -1
+           do_insmod $LUSTRE/mds/mds_extN.o || \
                echo "info: can't load mds_extN.o module, needs extN.o"
-       do_insmod $LUSTRE/obdecho/obdecho.o || exit -1
-       #do_insmod $LUSTRE/obdext2/obdext2.o || exit -1
-       do_insmod $LUSTRE/obdfilter/obdfilter.o || exit -1
-       do_insmod $LUSTRE/ost/ost.o || exit -1
-       do_insmod $LUSTRE/osc/osc.o || exit -1
-       do_insmod $LUSTRE/mdc/mdc.o || exit -1
-       do_insmod $LUSTRE/lov/lov.o || exit -1
-       do_insmod $LUSTRE/llite/llite.o || exit -1
+           do_insmod $LUSTRE/obdecho/obdecho.o || exit -1
+           #do_insmod $LUSTRE/obdext2/obdext2.o || exit -1
+           do_insmod $LUSTRE/obdfilter/obdfilter.o || exit -1
+               do_insmod $LUSTRE/ost/ost.o || exit -1
+           do_insmod $LUSTRE/osc/osc.o || exit -1
+           do_insmod $LUSTRE/mdc/mdc.o || exit -1
+               do_insmod $LUSTRE/lov/lov.o || exit -1
+           do_insmod $LUSTRE/llite/llite.o || exit -1
+       fi 
 
         echo "$R/tmp/lustre-log" > /proc/sys/portals/debug_path
        list_mods
index 1e52620..b6596a7 100755 (executable)
@@ -170,15 +170,15 @@ def prepare_network(node):
 # formatting anything.
 # FIXME: check if device is already formatted.
 def prepare_obd(obd):
-    obdname = obd.getAttribute('name')
-    (dev, size, fstype, format) = getDeviceInfo(obd)
-    print "OBD: ", dev, size, fstype, format
+    (name, dev, size, fstype, format) = getOBDInfo(obd)
+    print "OBD: ", name, dev, size, fstype, format
 ##     if not is_block(dev):
 ##         dev = init_loop(dev, size, fstype)
 ##     if (format == 'yes'):
 ##         mkfs(fstype, dev)
 
-def prepare_ost(node):
+def prepare_ost(ost):
+    name = getOSTInfo(ost)
     print 'prepare ost'
 
 def prepare_mds(node):
@@ -197,7 +197,8 @@ def prepare_mountpoint(node):
 # XML processing 
 
 # extract device attributes for an obd
-def getDeviceInfo(obd):
+def getOBDInfo(obd):
+    obdname = obd.getAttribute('name')
     dev = obd.getElementsByTagName('device')[0]
     dev.normalize();
     try:
@@ -207,7 +208,12 @@ def getDeviceInfo(obd):
 
     fstype = getText(obd, 'fstype')
     format = getText(obd, 'autoformat')
-    return (dev.firstChild.data, size, fstype, format)
+    return (obdname, dev.firstChild.data, size, fstype, format)
+    
+# extract device attributes for an obd
+def getOSTInfo(node):
+    name = node.getAttribute('name')
+    return (name)
     
 # Get the text content from the first matching child
 def getText(node, tag):