Whamcloud - gitweb
- merge 0.7rc1 from b_devel to HEAD (20030612 merge point)
[fs/lustre-release.git] / lustre / tests / llmount.sh
index 0fcaa83..de20003 100755 (executable)
@@ -1,46 +1,34 @@
 #!/bin/sh
+# suggested boilerplate for test script
 
-SRCDIR="`dirname $0`"
-. $SRCDIR/common.sh
-
-setup
-
-$R/usr/src/portals/linux/utils/ptlctl <<EOF
-mynid localhost
-setup tcp
-connect localhost 1234
-add_uuid self
-add_uuid mds
-add_uuid ost
-quit
-EOF
-
-dd if=/dev/zero of=/tmp/ost bs=1024 count=10000
-mke2fs -b 4096 -F /tmp/ost
-losetup ${LOOP}0 /tmp/ost || exit -1
-
-dd if=/dev/zero of=/tmp/mds bs=1024 count=10000
-mke2fs -b 4096 -F /tmp/mds
-losetup ${LOOP}1 /tmp/mds || exit -1
-
-mknod /dev/obd c 10 241
-echo 8191 > /proc/sys/portals/debug
-
-$R/usr/src/obd/utils/obdctl <<EOF
-device 0
-attach mds
-setup ${LOOP}1 ext2
-device 1
-attach obdext2
-setup ${LOOP}0
-device 2
-attach ost
-setup 1
-device 3
-attach osc
-setup -1
-quit
-EOF
-
-mkdir /mnt/obd
-mount -t lustre_light -o device=3 none /mnt/obd
+LCONF=${LCONF:-../utils/lconf}
+NAME=${NAME:-local}
+
+config=$NAME.xml
+mkconfig=$NAME.sh
+
+if [ "$PORTALS" ]; then
+  portals_opt="--portals=$PORTALS"
+fi
+
+if [ "$LUSTRE" ]; then
+  lustre_opt="--lustre=$LUSTRE"
+fi
+
+if [ "$LDAPURL" ]; then
+    conf_opt="--ldapurl $LDAPURL --config $NAME"
+else
+    sh $mkconfig $config || exit 1
+    conf_opt="$config"
+fi    
+
+[ "$NODE" ] && node_opt="--node $NODE"
+
+if [ "$1" = "-v" ]; then
+  verbose="-v"
+fi
+
+[ -x $LCONF ] || chmod a+rx $LCONF
+
+${LCONF} $portals_opt $lustre_opt $node_opt --reformat --gdb \
+    $verbose $conf_opt  || exit 2