Whamcloud - gitweb
LU-839 tests: test_52 fails with loop devices MRP-233
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index f55c2f4..fc6ec98 100644 (file)
@@ -49,6 +49,16 @@ if [ -n "$MDSSIZE" ]; then
     STORED_MDSSIZE=$MDSSIZE
 fi
 
+# pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
+for facet in MGS MDS OST; do
+    opts=${facet}_MKFS_OPTS
+    if [[ ${!opts} != *lazy_itable_init* ]]; then
+        eval SAVED_${facet}_MKFS_OPTS=\"${!opts}\"
+        eval ${facet}_MKFS_OPTS=\"${!opts} \
+--mkfsoptions='\\\"-E lazy_itable_init\\\"'\"
+    fi
+done
+
 init_logging
 
 #
@@ -725,6 +735,7 @@ test_21d() {
         stop_mgs
         #writeconf to remove all ost2 traces for subsequent tests
         writeconf
+        start_mgs
 }
 run_test 21d "start mgs then ost and then mds"
 
@@ -754,6 +765,8 @@ test_22() {
                sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
        fi
        mount_client $MOUNT
+        wait_osc_import_state mds ost FULL
+        wait_osc_import_state client ost FULL
        check_mount || return 41
        pass
 
@@ -1757,6 +1770,8 @@ run_test 41a "mount mds with --nosvc and --nomgs"
 test_41b() {
         echo $MDS_MOUNT_OPTS | grep "loop" && skip " loop devices does not work with nosvc option" && return
 
+        ! combined_mgs_mds && skip "needs combined mgs device" && return 0
+
         stopall
         reformat
         local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
@@ -1968,9 +1983,9 @@ test_46a() {
        # wait until osts in sync
        for (( i=2; i<=$OSTCOUNT; i++ )); do
            wait_osc_import_state mds ost$i FULL
+           wait_osc_import_state client ost$i FULL
        done
 
-
        #second client see all ost's
 
        mount_client $MOUNT2 || return 8
@@ -2439,6 +2454,8 @@ test_52() {
        [ $? -eq 0 ] || { error "Unable to stop ost1"; return 11; }
 
        echo mount ost1 as ldiskfs
+       do_node $ost1node mkdir -p $ost1mnt
+       [ $? -eq 0 ] || { error "Unable to create $ost1mnt"; return 23; }
        do_node $ost1node mount -t $FSTYPE $ost1_dev $ost1mnt $OST_MOUNT_OPTS
        [ $? -eq 0 ] || { error "Unable to mount ost1 as ldiskfs"; return 12; }
 
@@ -2461,7 +2478,7 @@ test_52() {
        diff_files_xattrs $ost1node $ost1tmp/objects $ost1tmp/object_xattrs $objects
        [ $? -eq 0 ] || { error "Unable to diff objects"; return 16; }
 
-       do_node $ost1node "umount $ost1_dev"
+       do_node $ost1node "umount $ost1mnt"
        [ $? -eq 0 ] || { error "Unable to umount ost1 as ldiskfs"; return 17; }
 
        start_ost
@@ -2578,33 +2595,20 @@ test_53b() {
 }
 run_test 53b "check MDT thread count params"
 
-run_llverfs()
-{
-        local dir=$1
-        local partial_arg=""
-        local size=$(df -B G $dir | tail -1 | awk '{print $2}' | sed 's/G//') # Gb
-
-        # Run in partial (fast) mode if the size
-        # of a partition > 10 GB
-        [ $size -gt 10 ] && partial_arg="-p"
-
-        llverfs $partial_arg $dir
-}
-
 test_54a() {
-    do_rpc_nodes $(facet_host ost1) run_llverdev $(ostdevname 1)
+    do_rpc_nodes $(facet_host ost1) run_llverdev $(ostdevname 1) -p
     [ $? -eq 0 ] || error "llverdev failed!"
     reformat_and_config
 }
-run_test 54a "llverdev"
+run_test 54a "test llverdev and partial verify of device"
 
 test_54b() {
     setup
-    run_llverfs $MOUNT
+    run_llverfs $MOUNT -p
     [ $? -eq 0 ] || error "llverfs failed!"
     cleanup
 }
-run_test 54b "llverfs"
+run_test 54b "test llverfs and partial verify of filesystem"
 
 lov_objid_size()
 {
@@ -2617,7 +2621,7 @@ test_55() {
        local ostdev=$(ostdevname 1)
        local saved_opts=$OST_MKFS_OPTS
 
-       for i in 1023 2048
+       for i in 1023 2048
        do
                OST_MKFS_OPTS="$saved_opts --index $i"
                reformat
@@ -2760,5 +2764,13 @@ fi
 
 cleanup_gss
 
+# restore the ${facet}_MKFS_OPTS variables
+for facet in MGS MDS OST; do
+    opts=SAVED_${facet}_MKFS_OPTS
+    if [[ -n ${!opts} ]]; then
+        eval ${facet}_MKFS_OPTS=\"${!opts}\"
+    fi
+done
+
 complete $(basename $0) $SECONDS
 exit_status