Whamcloud - gitweb
adjust krb5 related scripts, add krb5 support in replay-ost-single,
[fs/lustre-release.git] / lustre / tests / llmount.sh
index 30a9286..253932f 100755 (executable)
@@ -1,46 +1,43 @@
 #!/bin/sh
+# suggested boilerplate for test script
+
+export PATH=`dirname $0`/../utils:$PATH
+
+LCONF=${LCONF:-lconf}
+NAME=${NAME:-local}
+LLMOUNT=${LLMOUNT:-llmount}
+SECURITY=${SECURITY:-"null"}
+
+config=$(dirname $0)/$NAME.xml
+mkconfig=$(dirname $0)/$NAME.sh
+
+. krb5_env.sh
+start_krb5_kdc || exit 1
+start_lsvcgssd || exit 2
+start_lgssd || exit 3
+
+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 4
+    conf_opt="$config"
+fi    
+
+[ "$NODE" ] && node_opt="--node $NODE"
+[ "$DEBUG" ] && debug_opt="--ptldebug=$DEBUG"
+
+${LCONF} $NOMOD --sec $SECURITY $portals_opt $lustre_opt $node_opt \
+         ${REFORMAT:---reformat} $@ $conf_opt  || exit 5
+
+if [ "$MOUNT2" ]; then
+       $LLMOUNT -v -o sec=$SECURITY `hostname`:/mds1/client $MOUNT2 || exit 6
+fi
 
-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 -N 150000 -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