Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Sat, 25 Mar 2006 01:40:05 +0000 (01:40 +0000)
committernathan <nathan>
Sat, 25 Mar 2006 01:40:05 +0000 (01:40 +0000)
b=9858
test changes for mountconf

12 files changed:
lustre/tests/cfg/local.sh
lustre/tests/conf-sanity.sh
lustre/tests/mountconf.sh
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/utils/mount_lustre.c

index 07f6187..56fa05b 100644 (file)
@@ -8,6 +8,7 @@ mds_HOST=${mds_HOST:-$MDSNODE}
 mdsfailover_HOST=${mdsfailover_HOST}
 mgs_HOST=${mgs_HOST:-$MDSNODE}
 ost_HOST=${ost_HOST:-$OSTNODE}
+ostfailover_HOST=${ostfailover_HOST}
 ost2_HOST=${ost2_HOST:-$ost_HOST}
 client_HOST=${client_HOST:-$CLIENT}
 NETTYPE=${NETTYPE:-tcp}
@@ -22,8 +23,8 @@ OSTDEV2=${OSTDEV2:-$ROOT/tmp/${FSNAME}-ost1}
 FSTYPE=${FSTYPE:-ext3}
 
 MDS_MKFS_OPTS="--mgs --mdt --index=0 --device-size=$MDSSIZE $MDSOPT"
-OST_MKFS_OPTS="--ost --index=0 --device-size=$OSTSIZE --mgsnid=`h2$NETTYPE $HOSTNAME` $OSTOPT"
-OST2_MKFS_OPTS="--ost --index=1 --device-size=$OSTSIZE --mgsnid=`h2$NETTYPE $HOSTNAME` $OSTOPT"
+OST_MKFS_OPTS="--ost --index=0 --device-size=$OSTSIZE --mgsnode=`h2$NETTYPE $HOSTNAME` $OSTOPT"
+OST2_MKFS_OPTS="--ost --index=1 --device-size=$OSTSIZE --mgsnode=`h2$NETTYPE $HOSTNAME` $OSTOPT"
 
 MDS_MOUNT_OPTS="-o loop"
 OST_MOUNT_OPTS="-o loop"
index 3a7b71b..3481cf8 100644 (file)
@@ -104,7 +104,8 @@ cleanup() {
 check_mount() {
        do_facet client "touch $DIR/a" || return 71
        do_facet client "rm $DIR/a" || return 72
-       # make sure lustre is actually mounted
+       # make sure lustre is actually mounted (touch will block, 
+        # but grep won't, so do it after) 
         do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
        echo "setup single mount lustre success"
 }
index 0c37aad..c1e3f7f 100755 (executable)
@@ -4,14 +4,11 @@
 
 # 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 $@
-
-. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
+#export PATH=`dirname $0`/../utils:$PATH
+#LUSTRE=${LUSTRE:-`dirname $0`/..}
+#. $LUSTRE/tests/test-framework.sh
+#init_test_env $@
+#. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 
 stop_all() {
@@ -54,13 +51,3 @@ mcsetup() {
 export MCSETUP=${MCSETUP:-"mcsetup"}
 export MCCLEANUP=${MCCLEANUP:-"mccleanup"}
 
-
-#${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,acl `hostname`:/mds1/client $MOUNT2 || exit 3
-#fi
index ef8f460..436a8cd 100755 (executable)
@@ -6,46 +6,27 @@ set -e
 ALWAYS_EXCEPT="20b  24   27 $RECOVERY_SMALL_EXCEPT"
 
 LUSTRE=${LUSTRE:-`dirname $0`/..}
-
 . $LUSTRE/tests/test-framework.sh
-
 init_test_env $@
-
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 build_test_filter
 
-
 # Allow us to override the setup if we already have a mounted system by
 # setting SETUP=" " and CLEANUP=" "
 SETUP=${SETUP:-"setup"}
 CLEANUP=${CLEANUP:-"cleanup"}
-FORCE=${FORCE:-"-f"}
 
-make_config() {
-    rm -f $XMLCONFIG
-    add_mds mds --dev $MDSDEV --size $MDSSIZE
-    add_lov lov1 mds --stripe_sz $STRIPE_BYTES \
-       --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
-    add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE
-    add_ost ost2 --lov lov1 --dev ${OSTDEV}-2 --size $OSTSIZE
-    add_client client mds --lov lov1 --path $MOUNT
-}
+# for MCSETUP and MCCLEANUP
+. mountconf.sh
 
 setup() {
-    make_config
-    start ost --reformat $OSTLCONFARGS 
-    start ost2 --reformat $OSTLCONFARGS 
-    [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-    start mds $MDSLCONFARGS --reformat
-    grep " $MOUNT " /proc/mounts || zconf_mount `hostname`  $MOUNT
+    $MCFORMAT
+    $MCSETUP
 }
 
 cleanup() {
-    zconf_umount `hostname` $MOUNT
-    stop mds ${FORCE} $MDSLCONFARGS
-    stop ost2 ${FORCE}
-    stop ost ${FORCE} --dump $TMP/recovery-small-`hostname`.log
+       $MCCLEANUP > /dev/null || { echo "FAILed to clean up"; exit 20; }
 }
 
 if [ ! -z "$EVAL" ]; then
@@ -55,12 +36,11 @@ fi
 
 if [ "$ONLY" == "cleanup" ]; then
     sysctl -w lnet.debug=0 || true
-    FORCE=--force cleanup
+    cleanup
     exit
 fi
 
-REFORMAT=--reformat $SETUP
-unset REFORMAT
+$SETUP
 
 [ "$ONLY" == "setup" ] && exit
 
@@ -83,14 +63,14 @@ test_3() {
 run_test 3 "stat: drop req, drop rep"
 
 test_4() {
-    do_facet client "cp /etc/resolv.conf $MOUNT/resolv.conf" || return 1
-    drop_request "cat $MOUNT/resolv.conf > /dev/null"   || return 2
-    drop_reply "cat $MOUNT/resolv.conf > /dev/null"     || return 3
+    do_facet client "cp /etc/passwd $MOUNT/passwd" || return 1
+    drop_request "cat $MOUNT/passwd > /dev/null"   || return 2
+    drop_reply "cat $MOUNT/passwd > /dev/null"     || return 3
 }
 run_test 4 "open: drop req, drop rep"
 
 test_5() {
-    drop_request "mv $MOUNT/resolv.conf $MOUNT/renamed" || return 1
+    drop_request "mv $MOUNT/passwd $MOUNT/renamed" || return 1
     drop_reint_reply "mv $MOUNT/renamed $MOUNT/renamed-again" || return 2
     do_facet client "checkstat -v $MOUNT/renamed-again"  || return 3
 }
@@ -534,5 +514,4 @@ test_52() {
 }
 run_test 52 "failover OST under load"
 
-
-FORCE=--force $CLEANUP
+$CLEANUP
index 329c410..d4aed5d 100755 (executable)
@@ -14,57 +14,40 @@ init_test_env $@
 
 SETUP=${SETUP:-"setup"}
 CLEANUP=${CLEANUP:-"cleanup"}
-FORCE=${FORCE:-"--force"}
-
-gen_config() {
-    rm -f $XMLCONFIG
-    add_mds mds --dev $MDSDEV --size $MDSSIZE
-    if [ ! -z "$mdsfailover_HOST" ]; then
-    add_mdsfailover mds --dev $MDSDEV --size $MDSSIZE
-    fi
-    
-    add_lov lov1 mds --stripe_sz $STRIPE_BYTES \
-   --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
-    add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE --failover
-    add_ost ost2 --lov lov1 --dev ${OSTDEV}-2 --size $OSTSIZE --failover
-    add_client client mds --lov lov1 --path $MOUNT
-}
-
-
 
 build_test_filter
 
 cleanup() {
-    # make sure we are using the primary MDS, so the config log will
+    # 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
 
-    umount $MOUNT2 || true
-    umount $MOUNT  || true
-    rmmod llite || true
-    stop mds ${FORCE}
-    stop ost2 ${FORCE}
-    stop ost ${FORCE}  --dump $TMP/replay-dual-`hostname`.log
+    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
 }
 
 if [ "$ONLY" == "cleanup" ]; then
     sysctl -w lnet.debug=0
-    FORCE=--force cleanup
+    cleanup
     exit
 fi
 
 setup() {
-    gen_config
-    start ost --reformat $OSTLCONFARGS 
-    start ost2 --reformat $OSTLCONFARGS 
-    start mds $MDSLCONFARGS --reformat
-    grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
-    grep " $MOUNT2 " /proc/mounts || zconf_mount `hostname` $MOUNT2
-
-#    echo $TIMEOUT > /proc/sys/lustre/timeout
+    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
+    zconf_mount `hostname` $MOUNT
+    zconf_mount `hostname` $MOUNT2
 }
 
 $SETUP
@@ -472,5 +455,5 @@ if [ "$ONLY" != "setup" ]; then
    equals_msg test complete, cleaning up
    SLEEP=$((`date +%s` - $NOW))
    [ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
-   FORCE=--force $CLEANUP
+   $CLEANUP
 fi
index 369df0a..f74e4f4 100755 (executable)
@@ -10,38 +10,39 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 ostfailover_HOST=${ostfailover_HOST:-$ost_HOST}
+#failover= must be defined in OST_MKFS_OPTIONS if ostfailover_HOST != ost_HOST
 
 # Skip these tests
 # BUG NUMBER: 2766?
 ALWAYS_EXCEPT="5 $REPLAY_OST_SINGLE_EXCEPT"
 
 gen_config() {
-    rm -f $XMLCONFIG
-    add_mds mds --dev $MDSDEV --size $MDSSIZE
-    add_lov lov1 mds --stripe_sz $STRIPE_BYTES \
-       --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
-    add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE --failover
-    if [ ! -z "$ostfailover_HOST" ]; then
-        add_ostfailover ost --dev $OSTDEV --size $OSTSIZE
-    fi
-    add_client client mds --lov lov1 --path $MOUNT
+    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
 }
 
 cleanup() {
-    # make sure we are using the primary MDS, so the config log will
+    # 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 ${FORCE} $MDSLCONFARGS
-    stop ost ${FORCE} --dump $TMP/replay-ost-single-`hostname`.log
+    stop mds
+    stop ost
+    unload_modules
 }
 
 if [ "$ONLY" == "cleanup" ]; then
     sysctl -w lnet.debug=0
-    FORCE=--force cleanup
+    cleanup
     exit
 fi
 
@@ -52,18 +53,15 @@ CLEANUP=${CLEANUP:-"cleanup"}
 
 setup() {
     gen_config
-
-    start ost --reformat $OSTLCONFARGS
+    start mds $MDSDEV $MDS_MOUNT_OPTS
+    start ost $OSTDEV $OST_MOUNT_OPTS
     [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-    start mds --reformat $MDSLCONFARGS
 
     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"
-
        zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
     fi
 }
@@ -199,4 +197,4 @@ test_7() {
 run_test 7 "Fail OST before obd_destroy"
 
 equals_msg test complete, cleaning up
-FORCE=--force $CLEANUP
+$CLEANUP
index 16dd696..8405e72 100755 (executable)
@@ -21,12 +21,17 @@ ALWAYS_EXCEPT="0b  39   $REPLAY_SINGLE_EXCEPT"
 build_test_filter
 
 cleanup() {
-    grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
+    # 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
+
+    zconf_umount `hostname` $MOUNT
     stop ost -f
     stop ost2 -f
     stop mds -f
-    #no dump option in mountconf...
-    #stop ost ${FORCE} --dump $TMP/replay-single-`hostname`.log
 }
 
 SETUP=${SETUP:-"setup"}
@@ -47,9 +52,6 @@ setup() {
     start ost $OSTDEV $OST_MOUNT_OPTS
     start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
     [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
-
-    #add_lov lov1 mds --stripe_sz $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
-
     grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
 }
 
index 7ed88cb..997e0a2 100755 (executable)
@@ -36,11 +36,11 @@ while [ "$1" ]; do
        shift
 done
 
-MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -n 1`"
-if [ -z "$MOUNT" ]; then
+EXISTING_MOUNT="`mount | awk '/ lustre(_lite)? / { print $3 }' | tail -n 1`"
+if [ -z "$EXISTING_MOUNT" ]; then
        sh llmount.sh $OPTS
-       MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -n 1`"
-       [ -z "$MOUNT" ] && fail "no lustre filesystem mounted" 1
+       EXISTING_MOUNT="`mount | awk '/ lustre(_lite)? / { print $3 }' | tail -n 1`"
+       [ -z "$EXISTING_MOUNT" ] && fail "no lustre filesystem mounted" 1
        I_MOUNTED="yes"
 fi
 
index ebf0584..9a05cc9 100644 (file)
@@ -69,6 +69,10 @@ 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() {
@@ -2945,11 +2949,12 @@ HOME=$OLDHOME
 
 log "cleanup: ======================================================"
 if [ "`mount | grep ^$NAME`" ]; then
-       rm -rf $DIR/[Rdfs][1-9]*
-       if [ "$I_MOUNTED" = "yes" ]; then
-               $MCCLEANUP || error "cleanup failed"
-       fi
+    rm -rf $DIR/[Rdfs][1-9]*
+fi
+if [ "$I_MOUNTED" = "yes" ]; then
+    $MCCLEANUP || error "cleanup failed"
 fi
 
+
 echo '=========================== finished ==============================='
 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true
index 9c21bfd..763e655 100644 (file)
@@ -34,6 +34,10 @@ 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() {
@@ -536,6 +540,9 @@ run_test 23 " others should see updated atime while another read===="
 
 log "cleanup: ======================================================"
 rm -rf $DIR1/[df][0-9]* $DIR1/lnk || true
+if [ "$I_MOUNTED" = "yes" ]; then
+    $MCCLEANUP || error "cleanup failed"
+fi
 
 echo '=========================== finished ==============================='
 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true
index 3431ef1..79aa820 100644 (file)
@@ -120,7 +120,7 @@ start() {
 stop() {
     facet=$1
     shift
-    local running=`do_facet ${facet} grep -c /mnt/${facet}" " /proc/mounts`
+    local running=`do_facet ${facet} "grep -c /mnt/${facet}' ' /proc/mounts"`
     if [ $running -ne 0 ]; then
        echo "Stopping /mnt/${facet} (opts:$@)"
        do_facet ${facet} umount -d $@ /mnt/${facet}
index ca2a5ab..8d1d4b3 100644 (file)
@@ -383,6 +383,9 @@ int main(int argc, char *const argv[])
                 if (errno == ENOENT)
                         fprintf(stderr,"Is the mgs specification correct? "
                                 "(%s)\n", source);
+                if (errno == EALREADY)
+                        fprintf(stderr,"This service is already running. "
+                                "(%s)\n", source);
                 rc = errno;
         } else if (!nomtab) {
                 rc = update_mtab_entry(source, target, "lustre", options,0,0,0);