Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Mon, 15 May 2006 23:21:40 +0000 (23:21 +0000)
committernathan <nathan>
Mon, 15 May 2006 23:21:40 +0000 (23:21 +0000)
b=9858
test framework changes to
1. handle multiple osts (lov.sh)
2. auto-insmod local modules

19 files changed:
lustre/tests/Makefile.am
lustre/tests/acceptance-small.sh
lustre/tests/cfg/local.sh
lustre/tests/cfg/lov.sh [new file with mode: 0644]
lustre/tests/conf-sanity.sh
lustre/tests/llmount.sh
lustre/tests/llmountcleanup.sh
lustre/tests/local.sh [deleted file]
lustre/tests/lov.sh [deleted file]
lustre/tests/mountconf.sh [deleted file]
lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single.sh
lustre/tests/runtests
lustre/tests/sanity.sh
lustre/tests/sanityN.sh
lustre/tests/test-framework.sh
lustre/tests/uml.sh [deleted file]

index a7d0a0a..c2b70af 100644 (file)
@@ -4,22 +4,19 @@ AM_CFLAGS = $(LLCFLAGS)
 # LDADD = -lldap
 # LDADD := -lreadline -ltermcap # -lefence
 
-pkgexample_scripts = llmount.sh llmountcleanup.sh llecho.sh llechocleanup.sh
-pkgexample_scripts += local.sh echo.sh uml.sh lov.sh
 noinst_DATA =
 noinst_SCRIPTS = leak_finder.pl llecho.sh llmount.sh llmountcleanup.sh
 noinst_SCRIPTS += runfailure-mds runvmstat runfailure-net
 noinst_SCRIPTS += runfailure-ost runiozone runregression-net.sh runtests
 noinst_SCRIPTS += sanity.sh rundbench
 
-EXTRA_DIST = $(pkgexample_scripts) $(noinst_SCRIPTS) $(noinst_DATA) \
+EXTRA_DIST = $(noinst_SCRIPTS) $(noinst_DATA) \
              sanity.sh rundbench \
              acl/run acl/make-tree acl/getfacl-noacl.test acl/cp.test \
              acl/setfacl.test acl/permissions.test acl/misc.test \
              acl/inheritance.test
 
 if TESTS
-pkgexample_SCRIPTS = $(pkgexample_scripts)
 noinst_PROGRAMS = openunlink testreq truncate directio openme writeme
 noinst_PROGRAMS += tchmod toexcl fsx test_brw openclose createdestroy
 noinst_PROGRAMS += stat createmany chownmany statmany multifstat createtest mlink utime
index bca9acc..7021ecb 100755 (executable)
@@ -29,11 +29,10 @@ LIBLUSTRETESTS=${LIBLUSTRETESTS:-$LIBLUSTRE/tests}
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. mountconf.sh
 
-SETUP=${SETUP:-mcsetup}
-FORMAT=${FORMAT:-mcformat}
-CLEANUP=${CLEANUP:-mcstopall}
+SETUP=${SETUP:-setupall}
+FORMAT=${FORMAT:-formatall}
+CLEANUP=${CLEANUP:-stopall}
 
 for NAME in $CONFIGS; do
        export NAME MOUNT START CLEAN
index 2526a9f..e3becb6 100644 (file)
@@ -4,20 +4,23 @@ OSTNODE=${OSTNODE:-`hostname`}
 CLIENT=${CLIENT:-client}
 
 FSNAME=lustre
+
+# facet hosts
 mds_HOST=${mds_HOST:-$MDSNODE}
 mdsfailover_HOST=${mdsfailover_HOST}
 mgs_HOST=${mgs_HOST:-$mds_HOST}
-ost_HOST=${ost_HOST:-$OSTNODE}
+ost1_HOST=${ost1_HOST:-$OSTNODE}
 ostfailover_HOST=${ostfailover_HOST}
-ost2_HOST=${ost2_HOST:-$ost_HOST}
+ost2_HOST=${ost2_HOST:-$OSTNODE}
 
 TMP=${TMP:-/tmp}
 MDSDEV=${MDSDEV:-$TMP/${FSNAME}-mdt}
 MDSSIZE=${MDSSIZE:-100000}
 MDSOPT=${MDSOPT:-"--mountfsoptions=acl"}
-OSTDEV=${OSTDEV:-$TMP/${FSNAME}-ost0}
+
+OSTCOUNT=${OSTCOUNT:-2}
+OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
 OSTSIZE=${OSTSIZE:-200000}
-OSTDEV2=${OSTDEV2:-$TMP/${FSNAME}-ost1}
 
 NETTYPE=${NETTYPE:-tcp}
 MGSNID=`h2$NETTYPE $mgs_HOST`
@@ -26,8 +29,7 @@ STRIPE_BYTES=${STRIPE_BYTES:-1048576}
 STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
 TIMEOUT=${TIMEOUT:-20}
 UPCALL=${UPCALL:-DEFAULT}
-#PTLDEBUG=${PTLDEBUG:-0x33f0404}
-PTLDEBUG=${PTLDEBUG:-0xffffffff}
+PTLDEBUG=${PTLDEBUG:-0x33f0404}
 SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
 
 MKFSOPT=""
@@ -55,19 +57,18 @@ MOUNTOPT=""
 [ "x$ostfailover_HOST" != "x" ] &&
     MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
 OST_MKFS_OPTS="--ost --device-size=$OSTSIZE --mgsnode=$MGSNID --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $OSTOPT"
-OST2_MKFS_OPTS=${OST2_MKFS_OPTS:-${OST_MKFS_OPTS}}
 
 MDS_MOUNT_OPTS="-o loop"
 OST_MOUNT_OPTS="-o loop"
-OST2_MOUNT_OPTS="-o loop"
 
+#client
 MOUNT=${MOUNT:-/mnt/${FSNAME}}
 MOUNT1=${MOUNT1:-$MOUNT}
 MOUNT2=${MOUNT2:-${MOUNT}2}
+MOUNTOPT=${MOUNTOPT:-"user_xattr,acl"}
 DIR=${DIR:-$MOUNT}
 DIR1=${DIR:-$MOUNT1}
 DIR2=${DIR2:-$MOUNT2}
-MOUNTOPT=${MOUNTOPT:-"user_xattr,acl"}
 
 PDSH=${PDSH:-no_dsh}
 FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
diff --git a/lustre/tests/cfg/lov.sh b/lustre/tests/cfg/lov.sh
new file mode 100644 (file)
index 0000000..f6f6d90
--- /dev/null
@@ -0,0 +1,76 @@
+# oldstyle
+MDSNODE=${MDSNODE:-`hostname`}
+OSTNODE=${OSTNODE:-`hostname`}
+CLIENT=${CLIENT:-client}
+
+FSNAME=lustre
+
+# facet hosts
+mds_HOST=${mds_HOST:-$MDSNODE}
+mdsfailover_HOST=${mdsfailover_HOST}
+mgs_HOST=${mgs_HOST:-$mds_HOST}
+ost1_HOST=${ost1_HOST:-$OSTNODE}
+ostfailover_HOST=${ostfailover_HOST}
+ost2_HOST=${ost2_HOST:-$OSTNODE}
+
+TMP=${TMP:-/tmp}
+MDSDEV=${MDSDEV:-$TMP/${FSNAME}-mdt}
+MDSSIZE=${MDSSIZE:-400000}
+MDSOPT=${MDSOPT:-"--mountfsoptions=user_xattr,acl,"}
+
+OSTCOUNT=${OSTCOUNT:-5}
+OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
+OSTSIZE=${OSTSIZE:-150000}
+
+NETTYPE=${NETTYPE:-tcp}
+MGSNID=`h2$NETTYPE $mgs_HOST`
+FSTYPE=${FSTYPE:-ldiskfs}
+STRIPE_BYTES=${STRIPE_BYTES:-1048576}
+STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-$((OSTCOUNT -1))}
+TIMEOUT=${TIMEOUT:-20}
+UPCALL=${UPCALL:-DEFAULT}
+PTLDEBUG=${PTLDEBUG:-0x33f0404}
+SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
+
+MKFSOPT=""
+MOUNTOPT=""
+[ "x$MDSJOURNALSIZE" != "x" ] &&
+    MKFSOPT=$MKFSOPT" -J size=$MDSJOURNALSIZE"
+[ "x$MDSISIZE" != "x" ] &&
+    MKFSOPT=$MKFSOPT" -i $MDSISIZE"
+[ "x$MKFSOPT" != "x" ] &&
+    MKFSOPT="--mkfsoptions=\"$MKFSOPT\""
+[ "x$mdsfailover_HOST" != "x" ] &&
+    MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $mdsfailover_HOST`"
+[ "x$STRIPE_BYTES" != "x" ] &&
+    MOUNTOPT=$MOUNTOPT" --param default_stripe_size=$STRIPE_BYTES"
+[ "x$STRIPES_PER_OBJ" != "x" ] &&
+    MOUNTOPT=$MOUNTOPT" --param default_stripe_count=$STRIPES_PER_OBJ"
+MDS_MKFS_OPTS="--mgs --mdt --device-size=$MDSSIZE --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $MDSOPT"
+
+MKFSOPT=""
+MOUNTOPT=""
+[ "x$OSTJOURNALSIZE" != "x" ] &&
+    MKFSOPT=$MKFSOPT" -J size=$OSTJOURNALSIZE"
+[ "x$MKFSOPT" != "x" ] &&
+    MKFSOPT="--mkfsoptions=\"$MKFSOPT\""
+[ "x$ostfailover_HOST" != "x" ] &&
+    MOUNTOPT=$MOUNTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
+OST_MKFS_OPTS="--ost --device-size=$OSTSIZE --mgsnode=$MGSNID --param obd_timeout=$TIMEOUT $MKFSOPT $MOUNTOPT $OSTOPT"
+
+MDS_MOUNT_OPTS="-o loop"
+OST_MOUNT_OPTS="-o loop"
+
+#client
+MOUNT=${MOUNT:-/mnt/${FSNAME}}
+MOUNT1=${MOUNT1:-$MOUNT}
+MOUNT2=${MOUNT2:-${MOUNT}2}
+MOUNTOPT=${MOUNTOPT:-"user_xattr,"}
+DIR=${DIR:-$MOUNT}
+DIR1=${DIR:-$MOUNT1}
+DIR2=${DIR2:-$MOUNT2}
+
+PDSH=${PDSH:-no_dsh}
+FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
+POWER_DOWN=${POWER_DOWN:-"powerman --off"}
+POWER_UP=${POWER_UP:-"powerman --on"}
index 23ea6ac..d84361f 100644 (file)
 set -e
 
 ONLY=${ONLY:-"$*"}
-# bug number for skipped test:      mc mc mc mc mc mc  mc mc mc
-ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT 9  10 11 12 13 13b 14 15 18"
+
+# These tests don't apply to mountconf
+MOUNTCONFSKIP="9 10 11 12 13 13b 14 15 18"
+
+# bug number for skipped test:
+ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $MOUNTCONFSKIP"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 SRCDIR=`dirname $0`
@@ -24,20 +28,11 @@ MKFSLUSTRE=${MKFSLUSTRE:-/usr/sbin/mkfs.lustre}
 HOSTNAME=`hostname`
 
 . $LUSTRE/tests/test-framework.sh
-
 init_test_env $@
-
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 reformat() {
-        grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
-       stop ost -f
-       stop ost2 -f
-       stop mds -f
-       echo Formatting mds, ost, ost2
-       add mds $MDS_MKFS_OPTS --reformat $MDSDEV  > /dev/null
-       add ost $OST_MKFS_OPTS --reformat $OSTDEV  > /dev/null
-       add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2  > /dev/null
+        formatall
 }
 
 gen_config() {
@@ -63,19 +58,19 @@ stop_mds() {
 }
 
 start_ost() {
-       echo "start ost service on `facet_active_host ost`"
-       start ost $OSTDEV $OST_MOUNT_OPTS || return 95
+       echo "start ost1 service on `facet_active_host ost1`"
+       start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
 }
 
 stop_ost() {
-       echo "stop ost service on `facet_active_host ost`"
+       echo "stop ost1 service on `facet_active_host ost1`"
        # These tests all use non-failover stop
-       stop ost -f  || return 98
+       stop ost1 -f  || return 98
 }
 
 start_ost2() {
        echo "start ost2 service on `facet_active_host ost2`"
-       start ost2 $OSTDEV2 $OST2_MOUNT_OPTS || return 92
+       start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
 }
 
 stop_ost2() {
@@ -166,7 +161,7 @@ test_1() {
        check_mount || return 42
        cleanup || return $?
 }
-run_test 1 "start up ost twice"
+run_test 1 "start up ost twice (should return errors)"
 
 test_2() {
        start_ost
@@ -589,7 +584,7 @@ test_14() {
         start_ost
         start_mds
         mount_client $MOUNT || return $?
-        if [ -z "`do_facet ost dumpe2fs -h $OSTDEV | grep label_conf_14`" ]; then
+        if [ -z "`do_facet ost1 dumpe2fs -h $OSTDEV | grep label_conf_14`" ]; then
                 echo "Error: the mkoptions not applied to mke2fs of ost."
                 return 1
         fi
@@ -706,7 +701,7 @@ test_17() {
        start_mds && return 42
        gen_config
 }
-run_test 17 "Verify failed mds_postsetup won't fail assertion (2936)"
+run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
 
 test_18() {
         [ -f $MDSDEV ] && echo "remove $MDSDEV" && rm -f $MDSDEV
@@ -800,7 +795,28 @@ test_21() {
 
        cleanup
 }
-run_test 21 "start a client before osts"
+run_test 21 "start a client before osts (should return errs)"
+
+test_22() {
+        setup
+        # failover mds
+       stop mds   
+       # force client
+       zconf_umount `hostname` $MOUNT -f
+       # enter recovery on mds
+       start_mds
+       mount_client $MOUNT &
+       sleep 5
+       local mount_lustre_pid = `ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
+       echo mount.lustre pid is ${mount_lustre_pid}
+       kill -SIGINT ${mount_lustre_pid}
+       exit 1
+
+       sleep 5
+       stop_mds
+       stop_ost
+}
+run_test 22 "interrupt client during recovery mount delay"
 
 
 umount_client $MOUNT   
index e2dd99c..2bd4d64 100755 (executable)
@@ -1,44 +1,11 @@
 #!/bin/sh
-# suggested boilerplate for test script
 
 export PATH=`dirname $0`/../utils:$PATH
 
-LCONF=${LCONF:-lconf}
-NAME=${NAME:-local}
-LLMOUNT=${LLMOUNT:-llmount}
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
-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"
-[ "$DEBUG" ] && debug_opt="--ptldebug=$DEBUG"
-[ "$PTLDEBUG" ] && debug_opt="--ptldebug=$PTLDEBUG"
-
-echo llmount: FIXME replace llmount.sh with ". mountconf.sh" and "$SETUP"
-
-exit 1
-
-#${LCONF} $NOMOD $portals_opt $lustre_opt $debug_opt $node_opt ${REFORMAT:---reformat} $@ $conf_opt  || {
-    # maybe acceptor error, dump tcp port usage
-#    netstat -tpn
-#    exit 2
-#}
-
-#if [ "$MOUNT2" ]; then
-#      $LLMOUNT -v -o user_xattr `hostname`:/mds1/client $MOUNT2 || exit 3
-#fi
+formatall
+setupall
index 7d8eda9..417a436 100755 (executable)
@@ -2,57 +2,9 @@
 
 export PATH=`dirname $0`/../utils:$PATH
 
-LCONF=${LCONF:-lconf}
-NAME=${NAME:-local}
-TMP=${TMP:-/tmp}
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
-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
-    if [ ! -f $config ]; then
-       sh $mkconfig $config || exit 1
-    fi
-    conf_opt="$config"
-fi    
-
-[ "$NODE" ] && node_opt="--node $NODE"
-
-[ "$MOUNT2" ] && umount $MOUNT2
-
-#${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt --cleanup $@ \
-    --dump $TMP/debug $conf_opt
-
-echo FIXME llmountcleanup should be replaced with $CLEANUP
-exit 1
-
-rc=$?
-echo "lconf DONE"
-BUSY=`dmesg | grep -i destruct`
-if [ "$BUSY" ]; then
-       echo "$BUSY" 1>&2
-       mv $TMP/debug $TMP/debug-busy.`date +%s`
-       exit 255
-fi
-LEAK_LUSTRE=`dmesg | tail -n 30 | grep "obd mem.*leaked"`
-LEAK_PORTALS=`dmesg | tail -n 20 | grep "Portals memory leaked"`
-if [ "$LEAK_LUSTRE" -o "$LEAK_PORTALS" ]; then
-       echo "$LEAK_LUSTRE" 1>&2
-       echo "$LEAK_PORTALS" 1>&2
-       mv $TMP/debug $TMP/debug-leak.`date +%s`
-       echo "Memory leaks detected"
-       exit 254
-fi
-lsmod | grep lnet && echo "modules still loaded" && exit 1
-
-exit $rc
+cleanupall
diff --git a/lustre/tests/local.sh b/lustre/tests/local.sh
deleted file mode 100755 (executable)
index 436fd69..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-
-LMC=echo 
-TMP=${TMP:-/tmp}
-
-FSNAME=lustre
-HOSTNAME=`hostname`
-MDSDEV=${MDSDEV:-$TMP/mdt-${FSNAME}}
-MDSSIZE=${MDSSIZE:-400000}
-MOUNT=${MOUNT:-/mnt/${FSNAME}}
-MOUNT2=${MOUNT2:-${MOUNT}2}
-NETTYPE=${NETTYPE:-tcp}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-OSTDEV=${OSTDEV:-$TMP/ost0-${FSNAME}}
-OSTSIZE=${OSTSIZE:-400000}
-OSTDEV2=${OSTDEV2:-$TMP/ost1-${FSNAME}}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-# specific journal size for the ost, in MB
-JSIZE=${JSIZE:-0}
-[ "$JSIZE" -gt 0 ] && OST_MKFS_OPTS=$OST_MKFS_OPTS" -J size=$JSIZE"
-MDSISIZE=${MDSISIZE:-0}
-[ "$MDSISIZE" -gt 0 ] && MDS_MKFS_OPTS=$MDS_MKFS_OPTS" -i $MDSISIZE"
-
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=1      # 0 means stripe over all OSTs
-
-rm -f $config
-
-h2tcp () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 ;;
-       esac
-}
-
-h2elan () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 | sed "s/[^0-9]*//" ;;
-       esac
-}
-
-h2gm () {
-       echo `gmlndnid -n$1`
-}
-
-h2iib () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 | sed "s/[^0-9]*//" ;;
-       esac
-}
-
-MGSNID=`h2$NETTYPE $HOSTNAME`
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
-    MDS_MOUNT_OPTS="--mountfsoptions=$MDS_MOUNT_OPTS"
-[ "x$MDS_MKFS_OPTS" != "x" ] &&
-    MDS_MOUNT_OPTS="--mkfsoptions=\"$MDS_MOUNT_OPTS\""
-[ "x$QUOTA_OPTS" != "x" ] &&
-    QUOTA_OPTS="--quota $QUOTA_OPTS"
-[ ! -z "$mdsfailover_HOST" ] && MDS_FAIL_OPT="--failnode=$mdsfailover_HOST"    
-
-MDS_OPTS="--mgs $MDS_FAIL_OPT --device-size=$MDSSIZE $MDS_MOUNT_OPTS $MDS_MKFS_OPTS"
-echo mkfs.lustre --mdt $MDS_OPTS --reformat $MDSDEV
-
-[ "x$OST_MOUNT_OPTS" != "x" ] &&
-    OST_MOUNT_OPTS="--mountfsoptions=$OST_MOUNT_OPTS"
-[ "x$OST_MKFS_OPTS" != "x" ] &&
-    OST_MOUNT_OPTS="--mkfsoptions=\"$OST_MOUNT_OPTS\""
-
-OST_OPTS="--mgsnode=`h2$NETTYPE $HOSTNAME` $OST_FAIL_OPT --device-size=$OSTSIZE $OST_MOUNT_OPTS $OST_MKFS_OPTS"
-echo mkfs.lustre --ost $OST_OPTS --reformat $OSTDEV
-
-OST2_OPTS="--mgsnode=`h2$NETTYPE $HOSTNAME` $OST_FAIL_OPT --device-size=$OSTSIZE $OST_MOUNT_OPTS $OST_MKFS_OPTS"
-echo mkfs.lustre --ost $OST2_OPTS --reformat $OSTDEV2
-
diff --git a/lustre/tests/lov.sh b/lustre/tests/lov.sh
deleted file mode 100755 (executable)
index 0dbce33..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-
-set -e
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-
-LMC="${LMC:-lmc} -m $config"
-TMP=${TMP:-/tmp}
-
-HOSTNAME=`hostname`
-MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
-MDSSIZE=${MDSSIZE:-400000}
-FSTYPE=${FSTYPE:-ext3}
-MOUNT=${MOUNT:-/mnt/lustre}
-MOUNT2=${MOUNT2:-${MOUNT}2}
-NETTYPE=${NETTYPE:-tcp}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-OSTCOUNT=${OSTCOUNT:-5}
-# OSTDEVn will still override the device for OST n
-
-OSTSIZE=${OSTSIZE:-150000}
-# 1 to config an echo client instead of llite
-ECHO_CLIENT=${ECHO_CLIENT:-}
-
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-$((OSTCOUNT -1))}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-# specific journal size for the ost, in MB
-JSIZE=${JSIZE:-0}
-JARG=""
-[ "$JSIZE" -gt 0 ] && JARG="--journal_size $JSIZE"
-
-rm -f $config
-
-# create nodes
-${LMC} --add node --node $HOSTNAME || exit 10
-${LMC} --add net --node $HOSTNAME --nid $HOSTNAME \
-    --nettype $NETTYPE $PORT_OPT || exit 11
-${LMC} --add net --node client --nid '*' --nettype $NETTYPE $PORT_OPT || exit 12
-
-[ "x$QUOTA_OPTS" != "x" ] &&
-    QUOTA_OPTS="--quota $QUOTA_OPTS"
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
-    MDS_MOUNT_OPTS="--mountfsoptions $MDS_MOUNT_OPTS"
-
-${LMC} --format --add mds --node $HOSTNAME --mds mds1 --fstype $FSTYPE \
-       --dev $MDSDEV $MDS_MOUNT_OPTS $QUOTA_OPTS --size $MDSSIZE $MDSOPT || exit 20
-
-# configure ost
-${LMC} --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \
-       --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 $LOVOPT || exit 20
-
-for num in `seq $OSTCOUNT`; do
-    OST=ost$num
-    DEVPTR=OSTDEV$num
-    eval $DEVPTR=${!DEVPTR:=$TMP/$OST-`hostname`}
-    ${LMC} --add ost --node $HOSTNAME --lov lov1 --ost $OST --fstype $FSTYPE \
-       --dev ${!DEVPTR} --size $OSTSIZE $JARG $OSTOPT $QUOTA_OPTS|| exit 30
-done
-
-
-if [ -z "$ECHO_CLIENT" ]; then
-       # create client config
-       [ "x$CLIENTOPT" != "x" ] && CLIENTOPT="--clientoptions $CLIENTOPT"
-       ${LMC} --add mtpt --node $HOSTNAME --path $MOUNT \
-               --mds mds1 --lov lov1 $CLIENTOPT || exit 40
-       ${LMC} --add mtpt --node client --path $MOUNT2 \
-               --mds mds1 --lov lov1 $CLIENTOPT || exit 41
-else
-       ${LMC} --add echo_client --node $HOSTNAME --ost lov1 || exit 42
-fi
diff --git a/lustre/tests/mountconf.sh b/lustre/tests/mountconf.sh
deleted file mode 100755 (executable)
index 0d71f75..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-#set -vx
-
-# mountconf setup of MDS and two OSTs
-
-#export PATH=`dirname $0`/../utils:$PATH
-#LUSTRE=${LUSTRE:-`dirname $0`/..}
-#. $LUSTRE/tests/test-framework.sh
-#init_test_env $@
-
-mcstopall() {
-    # make sure we are using the primary server, so test-framework will
-    # be able to clean up properly.
-    activemds=`facet_active mds`
-    if [ $activemds != "mds" ]; then
-        fail mds
-    fi
-
-    grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT $*
-    stop ost -f
-    stop ost2 -f
-    stop mds -f
-    return 0
-}
-
-mccleanup() {
-    echo "mountconf cleanup $*"
-    mcstopall $*
-    unload_modules
-}
-
-mcformat() {
-    mcstopall
-    echo Formatting mds, ost, ost2
-    add mds $MDS_MKFS_OPTS --reformat $MDSDEV    > /dev/null || exit 10
-    add ost $OST_MKFS_OPTS --reformat $OSTDEV    > /dev/null || exit 10
-    add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2 > /dev/null || exit 10
-}
-export MCFORMAT=${MCFORMAT:-"mcformat"}
-
-mount_client() {
-    grep " $1 " /proc/mounts || zconf_mount `hostname` $*
-}
-
-mcsetup() {
-    echo Setup mds, ost, ost2
-    start mds $MDSDEV $MDS_MOUNT_OPTS
-    start ost $OSTDEV $OST_MOUNT_OPTS
-    start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
-    [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-
-    mount_client $MOUNT
-    sleep 5
-}
-
-export MCSETUP=${MCSETUP:-"mcsetup"}
-export MCCLEANUP=${MCCLEANUP:-"mccleanup"}
-
index 2f1d764..77d6d04 100755 (executable)
@@ -22,16 +22,13 @@ build_test_filter
 SETUP=${SETUP:-"setup"}
 CLEANUP=${CLEANUP:-"cleanup"}
 
-# for MCSETUP and MCCLEANUP
-. mountconf.sh
-
 setup() {
-    $MCFORMAT
-    $MCSETUP
+    formatall
+    setupall
 }
 
 cleanup() {
-       $MCCLEANUP > /dev/null || { echo "FAILed to clean up"; exit 20; }
+       cleanupall > /dev/null || { echo "FAILed to clean up"; exit 20; }
 }
 
 if [ ! -z "$EVAL" ]; then
@@ -201,7 +198,7 @@ test_16() {
     stop_read_ahead
 
 #define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
-    do_facet ost sysctl -w lustre.fail_loc=0x80000504
+    do_facet ost1 sysctl -w lustre.fail_loc=0x80000504
     cancel_lru_locks osc
     # OST bulk will time out here, client resends
     do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1
@@ -314,7 +311,7 @@ test_20a() {        # bug 2983 - ldlm_handle_enqueue cleanup
        sleep 1
        cancel_lru_locks osc
 #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
-       do_facet ost sysctl -w lustre.fail_loc=0x80000308
+       do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
        kill -USR1 $MULTI_PID
        wait $MULTI_PID
        rc=$?
@@ -327,7 +324,7 @@ test_20b() {        # bug 2986 - ldlm_handle_enqueue error during open
        touch $DIR/$tdir/${tfile}
        cancel_lru_locks osc
 #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
-       do_facet ost sysctl -w lustre.fail_loc=0x80000308
+       do_facet ost1 sysctl -w lustre.fail_loc=0x80000308
        dd if=/etc/hosts of=$DIR/$tdir/$tfile && \
                error "didn't fail open enqueue" || true
 }
@@ -368,7 +365,7 @@ test_26() {      # bug 5921 - evict dead exports by pinger
        [ "`lsmod | grep mds`" ] && \
            echo "skipping test 26 (local MDS)" && return
        OST_FILE=$LPROC/obdfilter/ost_svc/num_exports
-        OST_EXP="`do_facet ost cat $OST_FILE`"
+        OST_EXP="`do_facet ost1 cat $OST_FILE`"
        OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2`
        echo starting with $OST_NEXP1 OST exports
 # OBD_FAIL_PTLRPC_DROP_RPC 0x505
@@ -378,7 +375,7 @@ test_26() {      # bug 5921 - evict dead exports by pinger
        # might have to wait for the next ping.
        echo Waiting for $(($TIMEOUT * 4)) secs
        sleep $(($TIMEOUT * 4))
-        OST_EXP="`do_facet ost cat $OST_FILE`"
+        OST_EXP="`do_facet ost1 cat $OST_FILE`"
        OST_NEXP2=`echo $OST_EXP | cut -d' ' -f2`
        echo ending with $OST_NEXP2 OST exports
        do_facet client sysctl -w lustre.fail_loc=0x0
@@ -392,7 +389,7 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
        MDS_FILE=$LPROC/mds/${mds_svc}/num_exports
         MDS_NEXP1="`do_facet mds cat $MDS_FILE | cut -d' ' -f2`"
        OST_FILE=$LPROC/obdfilter/${ost_svc}/num_exports
-        OST_NEXP1="`do_facet ost cat $OST_FILE | cut -d' ' -f2`"
+        OST_NEXP1="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
        echo starting with $OST_NEXP1 OST and $MDS_NEXP1 MDS exports
        zconf_umount `hostname` $MOUNT2 -f
        # evictor takes up to 2.25x to evict.  But if there's a 
@@ -400,7 +397,7 @@ test_26b() {      # bug 10140 - evict dead exports by pinger
        # might have to wait for the next ping.
        echo Waiting for $(($TIMEOUT * 4)) secs
        sleep $(($TIMEOUT * 4))
-        OST_NEXP2="`do_facet ost cat $OST_FILE | cut -d' ' -f2`"
+        OST_NEXP2="`do_facet ost1 cat $OST_FILE | cut -d' ' -f2`"
         MDS_NEXP2="`do_facet mds cat $MDS_FILE | cut -d' ' -f2`"
        echo ending with $OST_NEXP2 OST and $MDS_NEXP2 MDS exports
         [ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted from OST"
index 05dfdde..c2ce337 100755 (executable)
@@ -18,18 +18,7 @@ CLEANUP=${CLEANUP:-"cleanup"}
 build_test_filter
 
 cleanup() {
-    # make sure we are using the primary server, so test-framework will
-    # be able to clean up properly.
-    activemds=`facet_active mds`
-    if [ $activemds != "mds" ]; then
-        fail mds
-    fi
-
-    grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
-    grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2
-    stop mds -f
-    stop ost2 -f
-    stop ost -f
+    stopall
 }
 
 if [ "$ONLY" == "cleanup" ]; then
@@ -40,16 +29,9 @@ fi
 
 setup() {
     cleanup
-    add mds $MDS_MKFS_OPTS --reformat $MDSDEV
-    add ost $OST_MKFS_OPTS --reformat $OSTDEV
-    add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2
-    start mds $MDSDEV $MDS_MOUNT_OPTS
-    start ost $OSTDEV $OST_MOUNT_OPTS
-    start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
-    # client actions will get EIO until MDT contacts OSTs, so give it a sec
-    sleep 5
-    zconf_mount `hostname` $MOUNT
-    zconf_mount `hostname` $MOUNT2
+    formatall
+    setupall
+    mount_client $MOUNT2
 }
 
 $SETUP
@@ -362,11 +344,11 @@ test_15b() {
     echo "data" > "$MOUNT2/${tfile}-m2"
     umount $MOUNT2
 
-    do_facet ost "sysctl -w lustre.fail_loc=0x80000802"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0x80000802"
     facet_failover mds
 
     df $MOUNT || return 1
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
     
     zconf_mount `hostname` $MOUNT2
     return 0
index f74e4f4..ef76250 100755 (executable)
@@ -4,9 +4,7 @@ set -e
 
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
-
 init_test_env $@
-
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
@@ -16,28 +14,15 @@ ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
 # BUG NUMBER: 2766?
 ALWAYS_EXCEPT="5 $REPLAY_OST_SINGLE_EXCEPT"
 
+# It is replay-ost-single, after all
+OSTCOUNT=1
+
 gen_config() {
-    grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
-    stop ost -f
-    stop ost2 -f
-    stop mds -f
-    echo Formatting mds, ost
-    add mds $MDS_MKFS_OPTS --reformat $MDSDEV
-    add ost $OST_MKFS_OPTS --reformat $OSTDEV
+    formatall
 }
 
 cleanup() {
-    # make sure we are using the primary server, so test-framework will
-    # be able to clean up properly.
-    activeost=`facet_active ost`
-    if [ $activeost != "ost" ]; then
-        fail ost
-    fi
-
-    zconf_umount `hostname` $MOUNT
-    stop mds
-    stop ost
-    unload_modules
+    cleanupall
 }
 
 if [ "$ONLY" == "cleanup" ]; then
@@ -54,14 +39,14 @@ CLEANUP=${CLEANUP:-"cleanup"}
 setup() {
     gen_config
     start mds $MDSDEV $MDS_MOUNT_OPTS
-    start ost $OSTDEV $OST_MOUNT_OPTS
+    start ost1 `ostdevname 1` $OST_MOUNT_OPTS
     [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
     if [ -z "`grep " $MOUNT " /proc/mounts`" ]; then
        # test "-1" needed during initial client->OST connection
        log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`"
        #define OBD_FAIL_OST_ALL_REPLY_NET       0x211
-       do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
+       do_facet ost1 "sysctl -w lustre.fail_loc=0x80000211"
        zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
     fi
 }
@@ -71,7 +56,7 @@ mkdir -p $DIR
 $SETUP
 
 test_0() {
-    fail ost
+    fail ost1
     cp /etc/profile  $DIR/$tfile
     sync
     diff /etc/profile $DIR/$tfile
@@ -81,7 +66,7 @@ run_test 0 "empty replay"
 
 test_1() {
     date > $DIR/$tfile
-    fail ost
+    fail ost1
     $CHECKSTAT -t file $DIR/$tfile || return 1
     rm -f $DIR/$tfile
 }
@@ -91,7 +76,7 @@ test_2() {
     for i in `seq 10`; do
         echo "tag-$i" > $DIR/$tfile-$i
     done 
-    fail ost
+    fail ost1
     for i in `seq 10`; do
       grep -q "tag-$i" $DIR/$tfile-$i || error "f2-$i"
     done 
@@ -104,7 +89,7 @@ test_3() {
     dd if=/dev/urandom bs=4096 count=1280 | tee $verify > $DIR/$tfile &
     ddpid=$!
     sync &
-    fail ost
+    fail ost1
     wait $ddpid || return 1
     cmp $verify $DIR/$tfile || return 2
     rm -f $verify $DIR/$tfile
@@ -120,7 +105,7 @@ test_4() {
     done
     cmp $verify $DIR/$tfile &
     cmppid=$!
-    fail ost
+    fail ost1
     wait $cmppid || return 1
     rm -f $verify $DIR/$tfile
 }
@@ -136,7 +121,7 @@ test_5() {
     PID=$!
     
     sleep 8
-    fail ost
+    fail ost1
     wait $PID || return 1
     rm -f $DIR/$tfile
 }
@@ -161,7 +146,7 @@ test_6() {
     log "before: $before after_dd: $after_dd"
     (( $before > $after_dd )) || return 1
     rm -f $f
-    fail ost
+    fail ost1
     $CHECKSTAT -t file $f && return 2 || true
     sync
     # let the delete happen
@@ -185,7 +170,7 @@ test_7() {
     (( $before > $after_dd )) || return 1
     replay_barrier ost
     rm -f $f
-    fail ost
+    fail ost1
     $CHECKSTAT -t file $f && return 2 || true
     sync
     # let the delete happen
index 513766c..f254d28 100755 (executable)
@@ -9,11 +9,9 @@ set -e
 
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
-
 init_test_env $@
-
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh 
+
 
 # Skip these tests
 # bug number: 2766
@@ -22,7 +20,7 @@ ALWAYS_EXCEPT="0b   $REPLAY_SINGLE_EXCEPT"
 build_test_filter
 
 SETUP=${SETUP:-"setup"}
-CLEANUP=${CLEANUP:-"mcstopall"}
+CLEANUP=${CLEANUP:-"stopall"}
 
 if [ "$ONLY" == "cleanup" ]; then
     sysctl -w lnet.debug=0 || true
@@ -31,8 +29,8 @@ if [ "$ONLY" == "cleanup" ]; then
 fi
 
 setup() {
-    mcformat
-    mcsetup
+    formatall
+    setupall
 }
 
 $SETUP
@@ -52,7 +50,7 @@ run_test 0 "empty replay"
 test_0b() {
     # this test attempts to trigger a race in the precreation code, 
     # and must run before any other objects are created on the filesystem
-    fail ost
+    fail ost1
     createmany -o $DIR/$tfile 20 || return 1
     unlinkmany $DIR/$tfile 20 || return 2
 }
@@ -68,7 +66,7 @@ test_1() {
 run_test 1 "simple create"
 
 test_1a() {
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
 
     rm -fr $DIR/$tfile
     local old_last_id=`cat $LPROC/obdfilter/*/last_id`
@@ -93,7 +91,7 @@ test_1a() {
     rm -fr $DIR/$tfile
 
 #define OBD_FAIL_OST_CROW_EIO | OBD_FAIL_ONCE
-    do_facet ost "sysctl -w lustre.fail_loc=0x80000801"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0x80000801"
 
     rm -fr $DIR/1a1
     old_last_id=`cat $LPROC/obdfilter/*/last_id`
@@ -107,7 +105,7 @@ test_1a() {
     
     rm -fr $DIR/1a1
     
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
 }
 #CROW run_test 1a "CROW object create (check OST last_id)"
 
@@ -870,10 +868,10 @@ test_43() { # bug 2530
     replay_barrier mds
 
     # OBD_FAIL_OST_CREATE_NET 0x204
-    do_facet ost "sysctl -w lustre.fail_loc=0x80000204"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
     fail mds
     sleep 10
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
 
     return 0
 }
@@ -952,8 +950,8 @@ test_47() { # bug 2824
     createmany -o $DIR/$tfile 20  || return 1
 
     # OBD_FAIL_OST_CREATE_NET 0x204
-    fail ost
-    do_facet ost "sysctl -w lustre.fail_loc=0x80000204"
+    fail ost1
+    do_facet ost1 "sysctl -w lustre.fail_loc=0x80000204"
     df $MOUNT || return 2
 
     # let the MDS discover the OST failure, attempt to recover, fail
@@ -964,7 +962,7 @@ test_47() { # bug 2824
     createmany -o $DIR/$tfile 20 || return 3
     unlinkmany $DIR/$tfile 20 || return 4
 
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
     return 0
 }
 run_test 47 "MDS->OSC failure during precreate cleanup (2824)"
@@ -974,13 +972,13 @@ test_48() {
     createmany -o $DIR/$tfile 20  || return 1
     # OBD_FAIL_OST_EROFS 0x216
     fail mds
-    do_facet ost "sysctl -w lustre.fail_loc=0x80000216"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0x80000216"
     df $MOUNT || return 2
 
     createmany -o $DIR/$tfile 20 20 || return 2
     unlinkmany $DIR/$tfile 40 || return 3
 
-    do_facet ost "sysctl -w lustre.fail_loc=0"
+    do_facet ost1 "sysctl -w lustre.fail_loc=0"
     return 0
 }
 run_test 48 "MDS->OSC failure during precreate cleanup (2824)"
index 7071490..2b781a5 100755 (executable)
@@ -11,11 +11,10 @@ export PATH=/sbin:/usr/sbin:$SRCDIR:$SRCDIR/../utils:$PATH
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
 
-SETUP=${SETUP:-mcsetup}
-FORMAT=${FORMAT:-mcformat}
-CLEANUP=${CLEANUP:-mcstopall}
+SETUP=${SETUP:-setupall}
+FORMAT=${FORMAT:-formatall}
+CLEANUP=${CLEANUP:-stopall}
 
 fail() { 
        echo "ERROR: $1" 1>&2
index bd208f3..1ca3bb1 100644 (file)
@@ -74,22 +74,20 @@ export NAME=${NAME:-local}
 
 SAVE_PWD=$PWD
 
-# for MCSETUP and MCCLEANUP
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
 
 cleanup() {
        echo -n "cln.."
-       $MCCLEANUP ${FORCE} $* || { echo "FAILed to clean up"; exit 20; }
+       cleanupall ${FORCE} $* || { echo "FAILed to clean up"; exit 20; }
 }
 CLEANUP=${CLEANUP:-:}
 
 setup() {
        echo -n "mnt.."
-       $MCSETUP || exit 10
+       setupall || exit 10
        echo "done"
 }
 SETUP=${SETUP:-:}
@@ -217,8 +215,8 @@ mounted_lustre_filesystems() {
 
 MOUNTED="`mounted_lustre_filesystems`"
 if [ -z "$MOUNTED" ]; then
-        $MCFORMAT
-       $MCSETUP
+        formatall
+       setupall
        MOUNTED="`mounted_lustre_filesystems`"
        [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
        I_MOUNTED=yes
@@ -2980,7 +2978,7 @@ if [ "`mount | grep ^$NAME`" ]; then
     rm -rf $DIR/[Rdfs][1-9]*
 fi
 if [ "$I_MOUNTED" = "yes" ]; then
-    $MCCLEANUP -f || error "cleanup failed"
+    cleanupall -f || error "cleanup failed"
 fi
 
 
index beec261..c662499 100644 (file)
@@ -36,23 +36,21 @@ fi
 
 SAVE_PWD=$PWD
 
-# for MCSETUP and MCCLEANUP
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
-. mountconf.sh
 
 cleanup() {
        echo -n "cln.."
        grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2 ${FORCE}
-       $MCCLEANUP ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
+       cleanupall ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
 }
 CLEANUP=${CLEANUP:-:}
 
 setup() {
        echo -n "mnt.."
-       $MCSETUP || exit 10
+       setupall || exit 10
        echo "done"
 }
 SETUP=${SETUP:-:}
@@ -181,8 +179,8 @@ mounted_lustre_filesystems() {
 }
 MOUNTED="`mounted_lustre_filesystems`"
 if [ -z "$MOUNTED" ]; then
-    $MCFORMAT
-    $MCSETUP
+    formatall
+    setupall
     mount_client $MOUNT2
     MOUNTED="`mounted_lustre_filesystems`"
     [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
index 25c8ff9..e28894f 100644 (file)
@@ -70,6 +70,39 @@ init_test_env() {
 #    echo "CONFIG=`canonical_path $CONFIG`"  > $LUSTRE/tests/CONFIG
 }
 
+load_module() {
+    EXT=".ko"
+    module=$1
+    shift
+    BASE=`basename $module $EXT`
+    lsmod | grep ${BASE} > /dev/null || insmod ${LUSTRE}/${module}${EXT} $@
+}
+
+load_modules() {
+    echo Loading modules from $LUSTRE
+    load_module ../lnet/libcfs/libcfs
+    # note that insmod will ignore anything in modprobe.conf
+    load_module ../lnet/lnet/lnet $LNETOPTS
+    LNETLND=${LNETLND:-"socklnd/ksocklnd"}
+    load_module ../lnet/klnds/$LNETLND
+    load_module lvfs/lvfs
+    load_module obdclass/obdclass
+    load_module ptlrpc/ptlrpc
+    load_module mdc/mdc
+    load_module osc/osc
+    load_module lov/lov
+    load_module mds/mds
+    load_module ldiskfs/ldiskfs
+    load_module lvfs/fsfilt_ldiskfs
+    load_module ost/ost
+    load_module obdfilter/obdfilter
+    load_module llite/llite
+    load_module mgc/mgc
+    load_module mgs/mgs
+    # 'mount' doesn't look in $PATH 
+    cp $LUSTRE/utils/mount.lustre /sbin/.
+}
+
 unload_modules() {
     lsmod | grep lnet > /dev/null && $LCTL dk $TMP/debug
     local MODULES=`$LCTL modules | awk '{ print $2 }'`
@@ -119,11 +152,15 @@ start() {
 }
 
 stop() {
+    local running
     facet=$1
     shift
+    HOST=`facet_active_host $facet`
+    [ -z $HOST ] && echo stop: no host for $facet && return 0
     # the following line fails with VERBOSE set 
-    local running=`do_facet ${facet} "grep -c /mnt/${facet}' ' /proc/mounts" | awk '{print $(NF)}'`
-    if [ $running -ne 0 ]; then
+    #running=`do_facet ${facet} awk '/mnt\/${facet} / {print "FOUND"}' /proc/mounts`
+    running=`do_facet ${facet} "grep -c /mnt/${facet}' ' /proc/mounts" | awk '{print $(NF)}'`
+    if [ ${running} -ne 0 ]; then
        echo "Stopping /mnt/${facet} (opts:$@)"
        do_facet ${facet} umount -d $@ /mnt/${facet}
     fi
@@ -248,7 +285,7 @@ replay_barrier() {
 }
 
 replay_barrier_nodf() {
-    local facet=$1
+    local facet=$1    echo running=${running}
     do_facet $facet sync
     local svc=${facet}_svc
     echo Replay barrier on ${!svc}
@@ -265,7 +302,7 @@ mds_evict_client() {
 
 ost_evict_client() {
     UUID=`cat /proc/fs/lustre/osc/*_MNT_*/uuid | head -n 1`
-    do_facet ost "echo $UUID > /proc/fs/lustre/obdfilter/ost_svc/evict_client"
+    do_facet ost1 "echo $UUID > /proc/fs/lustre/obdfilter/ost_svc/evict_client"
 }
 
 fail() {
@@ -402,6 +439,7 @@ do_facet() {
     facet=$1
     shift
     HOST=`facet_active_host $facet`
+    [ -z $HOST ] && echo No host defined for facet ${facet} && exit 1
     do_node $HOST $@
 }
 
@@ -414,6 +452,69 @@ add() {
     $MKFS $*
 }
 
+ostdevname() {
+    num=$1
+    DEVNAME=OSTDEV$num
+    #if $OSTDEVn isn't defined, default is $OSTDEVBASE + num
+    eval DEVPTR=${!DEVNAME:=${OSTDEVBASE}${num}}
+    echo -n $DEVPTR
+}
+
+
+########
+## MountConf setup
+
+stopall() {
+    # make sure we are using the primary server, so test-framework will
+    # be able to clean up properly.
+    activemds=`facet_active mds`
+    if [ $activemds != "mds" ]; then
+        fail mds
+    fi
+    
+    # assume client mount is local 
+    grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT $*
+    grep " $MOUNT2 " /proc/mounts && zconf_umount `hostname` $MOUNT2 $*
+    stop mds -f
+    for num in `seq $OSTCOUNT`; do
+       stop ost$num -f
+    done
+    return 0
+}
+
+cleanupall() {
+    stopall $*
+    unload_modules
+}
+
+formatall() {
+    stopall
+    # We need ldiskfs here, may as well load them all
+    load_modules
+    echo Formatting mds, osts
+    add mds $MDS_MKFS_OPTS --reformat $MDSDEV    > /dev/null || exit 10
+    for num in `seq $OSTCOUNT`; do
+       DEVNAME=`ostdevname $num`
+       add ost$num $OST_MKFS_OPTS --reformat $DEVNAME > /dev/null || exit 10
+    done
+}
+
+mount_client() {
+    grep " $1 " /proc/mounts || zconf_mount `hostname` $*
+}
+
+setupall() {
+    echo Setup mdt, osts
+    start mds $MDSDEV $MDS_MOUNT_OPTS
+    for num in `seq $OSTCOUNT`; do
+       DEVNAME=`ostdevname $num`
+       start ost$num $DEVNAME $OST_MOUNT_OPTS
+    done
+    [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
+    mount_client $MOUNT
+    sleep 5
+}
+
 
 ####### 
 # General functions
@@ -491,10 +592,10 @@ drop_reint_reply() {
 pause_bulk() {
 #define OBD_FAIL_OST_BRW_PAUSE_BULK      0x214
     RC=0
-    do_facet ost sysctl -w lustre.fail_loc=0x214
+    do_facet ost1 sysctl -w lustre.fail_loc=0x214
     do_facet client "$1" || RC=$?
     do_facet client "sync"
-    do_facet ost sysctl -w lustre.fail_loc=0
+    do_facet ost1 sysctl -w lustre.fail_loc=0
     return $RC
 }
 
@@ -618,7 +719,7 @@ equals_msg() {
 
 log() {
        echo "$*"
-       lsmod | grep lnet > /dev/null || modprobe lnet
+       lsmod | grep lnet > /dev/null || load_modules
        $LCTL mark "$*" 2> /dev/null || true
 }
 
diff --git a/lustre/tests/uml.sh b/lustre/tests/uml.sh
deleted file mode 100644 (file)
index 7d7301b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/bash
-
-export PATH=`dirname $0`/../utils:$PATH
-
-config=${1:-`basename $0 .sh`.xml}
-LMC=${LMC:-lmc}
-TMP=${TMP:-/tmp}
-
-MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
-MDSSIZE=${MDSSIZE:-100000}
-
-OSTDEVBASE=$TMP/ost
-#OSTDEV1=${OSTDEV1:-${OSTDEVBASE}1}
-#OSTDEV2=${OSTDEV2:-${OSTDEVBASE}2}
-#etc
-OSTSIZE=${OSTSIZE:-100000}
-STRIPECNT=${STRIPECNT:-1}
-STRIPE_BYTES=${STRIPE_BYTES:-1048576}
-OSDTYPE=${OSDTYPE:-obdfilter}
-OSTFAILOVER=${OSTFAILOVER:-}
-
-MOUNT=${MOUNT:-/mnt/lustre}
-FSTYPE=${FSTYPE:-ext3}
-
-MDS_MOUNT_OPTS="user_xattr,acl,${MDS_MOUNT_OPTS:-""}"
-CLIENTOPT="user_xattr,${CLIENTOPT:-""}"
-
-NETTYPE=${NETTYPE:-tcp}
-NIDTYPE=${NIDTYPE:-$NETTYPE}
-[ "$ACCEPTOR_PORT" ] && PORT_OPT="--port $ACCEPTOR_PORT"
-
-# NOTE - You can't have different MDS/OST nodes and also have clients on the
-#        MDS/OST nodes without using --endlevel and --startlevel during lconf.
-#        You can put both MDS/OST on one node and client can be there too.
-#        CLIENTS is a space-separated list of client nodes.
-#
-#        The rule is that both the MDS and the OST must be set up before any
-#        of the clients can be started, so plan accordingly.
-
-# Three separate systems
-MDSNODE=${MDSNODE:-uml1}
-OSTNODES=${OSTNODES:-"uml2 uml2"}
-CLIENTS=${CLIENTS:-"uml3"}
-
-# Single system with additional clients
-#MDSNODE=uml1
-#OSTNODES="uml1 uml1"
-#CLIENTS="$MDSNODE client"
-
-# Two systems with client on MDS, and additional clients (set up OST first)
-#MDSNODE=uml1
-#OSTNODES="uml2 uml2"
-#CLIENTS="$MDSNODE client"
-
-# Two systems with client on OST, and additional clients (set up MDS first)
-#MDSNODE=uml1
-#OSTNODES="uml2 uml2"
-#CLIENTS="$OSTNODES client"
-
-rm -f $config
-
-h2tcp () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 ;;
-       esac
-}
-
-h2elan () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 | sed "s/[^0-9]*//" ;;
-       esac
-}
-
-h2gm () {
-       echo `gmlndnid -n$1`
-}
-
-h2iib () {
-       case $1 in
-       client) echo '\*' ;;
-       *) echo $1 | sed "s/[^0-9]*//" ;;
-       esac
-}
-
-# create nodes
-echo -n "adding NET for:"
-for NODE in `echo $MDSNODE $OSTNODES $CLIENTS | tr -s " " "\n" | sort -u`; do
-       echo -n " $NODE"
-       ${LMC} -m $config --add net --node $NODE --nid `h2$NIDTYPE $NODE` \
-    --nettype $NETTYPE $PORT_OPT || exit 1
-done
-
-# configure mds server
-[ "x$MDS_MOUNT_OPTS" != "x" ] &&
-    MDS_MOUNT_OPTS="--mountfsoptions $MDS_MOUNT_OPTS"
-
-echo; echo "adding MDS on: $MDSNODE"
-${LMC} -m $config --add mds --node $MDSNODE --mds mds1 --fstype $FSTYPE \
-       --dev $MDSDEV $MDS_MOUNT_OPTS --size $MDSSIZE $MDSOPT || exit 10
-
-# configure ost
-${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \
-       --stripe_cnt $STRIPECNT --stripe_pattern 0 $LOVOPT || exit 20
-COUNT=1
-echo -n "adding OST on:"
-for NODE in $OSTNODES; do
-       eval OSTDEV=\$OSTDEV$COUNT
-       echo -n " $NODE"
-       OSTDEV=${OSTDEV:-$OSTDEVBASE$COUNT-`hostname`}
-       case "$OSDTYPE" in
-               obdfilter)
-                       OSTARGS="--fstype $FSTYPE --dev $OSTDEV --size $OSTSIZE"
-                       ;;
-               obdecho)
-                       OSTARGS="--osdtype=obdecho"
-                       ;;
-       esac
-        ${LMC} -m $config --add ost --node $NODE --lov lov1 $OSTARGS \
-               $OSTFAILOVER $OSTOPT || exit 21
-       COUNT=`expr $COUNT + 1`
-done
-
-# create client config(s)
-[ "x$CLIENTOPT" != "x" ] && CLIENTOPT="--clientoptions $CLIENTOPT"
-echo; echo -n "adding CLIENT on:"
-for NODE in $CLIENTS; do
-       echo -n " $NODE"
-       ${LMC} -m $config --add mtpt --node $NODE --path $MOUNT --mds mds1 \
-               --lov lov1 $CLIENTOPT || exit 30
-done
-echo