Whamcloud - gitweb
LU-8526 tests: ensure all OSTs active for allocations
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index a3a6af5..2a0dc2d 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 ONLY=${ONLY:-"$*"}
 
 # bug number for skipped test:  LU-8972
-ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 101"
+ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 is_sles11()                                            # LU-2181
@@ -455,17 +455,16 @@ run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
 
 test_5d() {
        grep " $MOUNT " /etc/mtab &&
-               error false "unexpected entry in mtab before mount" && return 10
+               error "unexpected entry in mtab before mount"
 
        start_ost || error "OST start failed"
        start_mds || error "MDS start failed"
-       stop_ost || error "Unable to stop OST1"
+       stop_ost -f || error "Unable to stop OST1"
        mount_client $MOUNT || error "mount_client $MOUNT failed"
        umount_client $MOUNT -f || error "umount_client $MOUNT failed"
        cleanup_nocli || error "cleanup_nocli failed with $?"
-       grep " $MOUNT " /etc/mtab &&
+       ! grep " $MOUNT " /etc/mtab ||
                error "$MOUNT entry in mtab after unmount"
-       pass
 }
 run_test 5d "mount with ost down"
 
@@ -702,7 +701,7 @@ run_test 19a "start/stop MDS without OSTs"
 
 test_19b() {
        start_ost || error "Unable to start OST1"
-       stop_ost || error "Unable to stop OST1"
+       stop_ost -f || error "Unable to stop OST1"
 }
 run_test 19b "start/stop OSTs without MDS"
 
@@ -3705,7 +3704,6 @@ test_50i() {
        # prepare MDT/OST, make OSC inactive for OST1
        [ "$MDSCOUNT" -lt "2" ] && skip_env "$MDSCOUNT < 2, skipping" && return
 
-       load_modules
        [ $(facet_fstype mds2) == zfs ] && import_zpool mds2
        do_facet mds2 "$TUNEFS --param mdc.active=0 $(mdsdevname 2)" ||
                error "tunefs MDT2 failed"
@@ -3736,7 +3734,7 @@ test_50i() {
        rm -rf $DIR/$tdir/2 || error "unlink dir failed"
 
        # deactivate MDC for MDT2
-       TEST="$LCTL get_param -n mdc.${FSNAME}-MDT0001-mdc-[!M]*.active"
+       local TEST="$LCTL get_param -n mdc.${FSNAME}-MDT0001-mdc-[!M]*.active"
        set_conf_param_and_check client                                 \
                "$TEST" "${FSNAME}-MDT0001.mdc.active" 0 ||
                error "Unable to deactivate MDT2"
@@ -3744,13 +3742,6 @@ test_50i() {
        $LFS mkdir -i1 $DIR/$tdir/2 &&
                error "mkdir $DIR/$tdir/2 succeeds after deactive MDT"
 
-       $LFS mkdir -i0 -c$MDSCOUNT $DIR/$tdir/striped_dir ||
-               error "mkdir $DIR/$tdir/striped_dir fails after deactive MDT2"
-
-       local stripe_count=$($LFS getdirstripe -c $DIR/$tdir/striped_dir)
-       [ $stripe_count -eq $((MDSCOUNT - 1)) ] ||
-               error "wrong $stripe_count != $((MDSCOUNT -1)) for striped_dir"
-
        # cleanup
        umount_client $MOUNT || error "Unable to umount client"
        stop_mds
@@ -5650,19 +5641,6 @@ test_81() { # LU-4665
 }
 run_test 81 "sparse OST indexing"
 
-# Wait OSTs to be active on both client and MDT side.
-wait_osts_up() {
-       local cmd="$LCTL get_param -n lov.$FSNAME-clilov-*.target_obd |
-               awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
-       wait_update $HOSTNAME "eval $cmd" $OSTCOUNT ||
-               error "wait_update OSTs up on client failed"
-
-       cmd="$LCTL get_param -n lod.$FSNAME-MDT*-*.target_obd | sort -u |
-            awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
-       wait_update_facet $SINGLEMDS "eval $cmd" $OSTCOUNT ||
-               error "wait_update OSTs up on MDT failed"
-}
-
 # Here we exercise the stripe placement functionality on a file system that
 # has formatted the OST with a random index. With the file system the following
 # functionality is tested:
@@ -5847,7 +5825,8 @@ test_82b() { # LU-4665
        wait_update $HOSTNAME "$LCTL get_param -n lov.$FSNAME-*.pools.$TESTNAME|
                               sort -u | tr '\n' ' ' " "$ost_targets_uuid" ||
                                        error "wait_update $ost_pool failed"
-       pool_list $ost_pool || error "list OST pool $ost_pool failed"
+       [[ -z $(list_pool $ost_pool) ]] &&
+                       error "list OST pool $ost_pool failed"
 
        # If [--pool|-p <pool_name>] is set with [--ost-list|-o <ost_indices>],
        # then the OSTs must be the members of the pool.