Whamcloud - gitweb
LU-9899 tests: mount client on MGS for tests with pools
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 13c1857..6e272a1 100644 (file)
@@ -64,12 +64,12 @@ OSTDEV1_2=$fs2ost_DEV
 OSTDEV2_2=$fs3ost_DEV
 
 if ! combined_mgs_mds; then
-       # bug number for skipped test: LU-9860 LU-9860 LU-9860 LU-9860
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT  33a     43b     53b     54b"
+       # bug number for skipped test: LU-9860 LU-9860 LU-9860
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT  43b     53b     54b"
        # bug number for skipped test: LU-9875 LU-9879 LU-9879 LU-9879 LU-9879
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT  70e     80      84      87      100"
-       # bug number for skipped test: LU-8110 LU-9400 LU-9879 LU-9879 LU-9879
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT  102     103     104     105     107"
+       # bug number for skipped test: LU-8110 LU-9879 LU-9879 LU-9879
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT  102     104     105     107"
 fi
 
 # pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
@@ -255,7 +255,9 @@ cleanup_nocli() {
 }
 
 cleanup() {
-       umount_client $MOUNT || return 200
+       local force=""
+       [ "x$1" != "x" ] && force='-f'
+       umount_client $MOUNT $force|| return 200
        cleanup_nocli || return $?
 }
 
@@ -2455,15 +2457,20 @@ test_33a() { # bug 12333, was test_33
                mkfsoptions="--mkfsoptions=\\\"-J size=8\\\"" # See bug 17931.
        fi
 
-       add fs2mds $(mkfs_opts mds1 ${fs2mdsdev}) --mgs --fsname=${FSNAME2} \
-               --reformat $mkfsoptions $fs2mdsdev $fs2mdsvdev || exit 10
+       if combined_mgs_mds; then
+               local mgs_flag="--mgs"
+       fi
+
+       add fs2mds $(mkfs_opts mds1 ${fs2mdsdev}) --fsname=${FSNAME2} \
+               --reformat $mgs_flag $mkfsoptions $fs2mdsdev $fs2mdsvdev ||
+               exit 10
        add fs2ost $(mkfs_opts ost1 ${fs2ostdev}) --mgsnode=$MGSNID \
                --fsname=${FSNAME2} --index=8191 --reformat $fs2ostdev \
                $fs2ostvdev || exit 10
 
        start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_fs2 EXIT INT
        start fs2ost $fs2ostdev $OST_MOUNT_OPTS
-       do_facet $SINGLEMDS "$LCTL conf_param $FSNAME2.sys.timeout=200" ||
+       do_facet mgs "$LCTL conf_param $FSNAME2.sys.timeout=200" ||
                error "$LCTL conf_param $FSNAME2.sys.timeout=200 failed"
        mkdir -p $MOUNT2 || error "mkdir $MOUNT2 failed"
        $MOUNT_CMD $MGSNID:/${FSNAME2} $MOUNT2 || error "$MOUNT_CMD failed"
@@ -2938,7 +2945,7 @@ test_41b() {
        echo "blah blah" > $MOUNT/$tfile
        cat $MOUNT/$tfile || error "cat $MOUNT/$tfile failed"
 
-       umount_client $MOUNT || error "umount_client $MOUNT failed"
+       umount_client $MOUNT -f || error "umount_client $MOUNT failed"
        stop_ost || error "Unable to stop OST1"
        stop_mds || error "Unable to stop MDS"
        stop_mds || error "Unable to stop MDS on second try"
@@ -5070,6 +5077,7 @@ test_70e() {
        soc=$(do_facet mds1 "$LCTL get_param -n \
                mdt.*MDT0000.sync_lock_cancel")
        [ $soc == "never" ] || error "SoC enabled on single MDS"
+       umount_client $MOUNT -f > /dev/null
 
        cleanup || error "cleanup failed with $?"
 }
@@ -5913,6 +5921,9 @@ cleanup_82b() {
        # Remove OSTs from a pool and destroy the pool.
        destroy_pool $ost_pool || true
 
+       if ! combined_mgs_mds ; then
+               umount_mgs_client
+       fi
        restore_ostindex
 }
 
@@ -5952,6 +5963,10 @@ test_82b() { # LU-4665
        done
 
        mount_client $MOUNT || error "mount client $MOUNT failed"
+       if ! combined_mgs_mds ; then
+               mount_mgs_client
+       fi
+
        wait_osts_up
        $LFS df $MOUNT || error "$LFS df $MOUNT failed"
        mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
@@ -7202,7 +7217,7 @@ test_99()
        do_facet ost1 $DEBUGFS -c -R stats `ostdevname 1` | grep "meta_bg" ||
                error "meta_bg is not set"
 
-       return 0
+       reformat
 }
 run_test 99 "Adding meta_bg option"
 
@@ -7301,7 +7316,7 @@ test_renamefs() {
 
        echo "rename $FSNAME to $newname"
 
-       if [ ! combined_mgs_mds ]; then
+       if ! combined_mgs_mds ; then
                local facet=$(mgsdevname)
 
                do_facet mgs \
@@ -7373,6 +7388,9 @@ test_103() {
        cp $LUSTRE/tests/test-framework.sh $DIR/$tdir ||
                error "(2) Fail to copy test-framework.sh"
 
+       if ! combined_mgs_mds ; then
+               mount_mgs_client
+       fi
        do_facet mgs $LCTL pool_new $FSNAME.pool1 ||
                error "(3) Fail to create $FSNAME.pool1"
        # name the pool name as the fsname
@@ -7384,6 +7402,9 @@ test_103() {
        $SETSTRIPE -p $FSNAME $DIR/$tdir/d0 ||
                error "(6) Fail to setstripe on $DIR/$tdir/d0"
 
+       if ! combined_mgs_mds ; then
+               umount_mgs_client
+       fi
        KEEP_ZPOOL=true
        stopall
 
@@ -7393,6 +7414,9 @@ test_103() {
        FSNAME="mylustre"
        setupall
 
+       if ! combined_mgs_mds ; then
+               mount_mgs_client
+       fi
        test_103_check_pool $save_fsname 7
 
        if [ $OSTCOUNT -ge 2 ]; then
@@ -7401,6 +7425,9 @@ test_103() {
 
        $SETSTRIPE -p $save_fsname $DIR/$tdir/f0 ||
                error "(16) Fail to setstripe on $DIR/$tdir/f0"
+       if ! combined_mgs_mds ; then
+               umount_mgs_client
+       fi
 
        stopall
 
@@ -7409,8 +7436,14 @@ test_103() {
        FSNAME="tfs"
        setupall
 
+       if ! combined_mgs_mds ; then
+               mount_mgs_client
+       fi
        test_103_check_pool $save_fsname 17
 
+       if ! combined_mgs_mds ; then
+               umount_mgs_client
+       fi
        stopall
 
        test_renamefs $save_fsname
@@ -7479,7 +7512,7 @@ error_and_umount() {
 }
 
 test_105() {
-       cleanup
+       cleanup -f
        reformat
        setup
        mkdir -p $TMP/$tdir