Whamcloud - gitweb
b=18271
authorgrev <grev>
Fri, 10 Apr 2009 20:51:41 +0000 (20:51 +0000)
committergrev <grev>
Fri, 10 Apr 2009 20:51:41 +0000 (20:51 +0000)
i=Nathan.Rutman
writeconf fn fix

lustre/tests/conf-sanity.sh

index fd583c8..f21ec0b 100644 (file)
@@ -47,18 +47,19 @@ reformat() {
 }
 
 writeconf() {
-    local facet=mds
-    shift
-    stop ${facet} -f
-    rm -f ${facet}active
-    # who knows if/where $TUNEFS is installed?  Better reformat if it fails...
-    do_facet ${facet} "$TUNEFS --writeconf $MDSDEV" || echo "tunefs failed, reformatting instead" && reformat
+       local facet=mds
+       shift
+       stop ${facet} -f
+       rm -f ${facet}active
+       # who knows if/where $TUNEFS is installed?  Better reformat if it fails...
+       do_facet ${facet} "$TUNEFS --writeconf $MDSDEV" || echo "tunefs failed, reformatting instead" && reformat
+
+       gen_config
 }
 
 gen_config() {
-        reformat
-        # The MGS must be started before the OSTs for a new fs, so start
-        # and stop to generate the startup logs. 
+       # The MGS must be started before the OSTs for a new fs, so start
+       # and stop to generate the startup logs. 
        start_mds
        start_ost
        sleep 5
@@ -66,6 +67,11 @@ gen_config() {
        stop_mds
 }
 
+reformat_and_config() {
+       reformat
+       gen_config
+}
+
 start_mds() {
        echo "start mds service on `facet_active_host mds`"
        start mds $MDSDEV $MDS_MOUNT_OPTS || return 94
@@ -193,8 +199,7 @@ fi
 
 #create single point mountpoint
 
-gen_config
-
+reformat_and_config
 
 test_0() {
         setup
@@ -460,7 +465,7 @@ test_17() {
 
         start_ost
        start_mds && return 42
-       gen_config
+       reformat_and_config
 }
 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
 
@@ -500,7 +505,7 @@ test_18() {
 
         MDS_MKFS_OPTS="--mgs --mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
 
-        gen_config
+        reformat_and_config
         echo "mount lustre system..."
        setup
         check_mount || return 41
@@ -516,7 +521,7 @@ test_18() {
         cleanup || return $?
 
         MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
-        gen_config
+        reformat_and_config
 }
 run_test 18 "check mkfs creates large journals"
 
@@ -885,9 +890,6 @@ test_29() {
        cleanup_nocli
        #writeconf to remove all ost2 traces for subsequent tests
        writeconf
-       start_mds
-       start_ost
-       cleanup
 }
 run_test 29 "permanently remove an OST"
 
@@ -1578,9 +1580,7 @@ cleanup_48() {
 
        # reformat after this test is needed - if test will failed
        # we will have unkillable file at FS
-       reformat
-       setup_noconfig
-       cleanup || error "can't cleanup"
+       reformat_and_config
 }
 
 test_48() { # bug 17636