Whamcloud - gitweb
LU-5863 tests: add a separate MGS/MDS test case into conf-sanity 91/13391/3
authorJian Yu <jian.yu@intel.com>
Wed, 14 Jan 2015 01:16:54 +0000 (17:16 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 25 Jan 2015 01:54:39 +0000 (01:54 +0000)
In conf-sanity.sh, test 21d is a basic test case that verifies
separate MGS/MDS. However, it's always skipped under combined
MGS/MDS configuration. This patch adds a new test case 21e to
setup another Lustre filesystem to verify separate MGS/MDS without
depending on the configuration of the origial Lustre filesystem.

Test-Parameters: alwaysuploadlogs \
envdefinitions=SLOW=yes,ONLY=21 \
mdtfilesystemtype=ldiskfs mdsfilesystemtype=ldiskfs \
ostfilesystemtype=ldiskfs testlist=conf-sanity

Test-Parameters: alwaysuploadlogs \
envdefinitions=SLOW=yes,ONLY=21 \
mdtfilesystemtype=zfs mdsfilesystemtype=zfs \
ostfilesystemtype=zfs testlist=conf-sanity

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I3defa936a9b4f97dc3849c3a4a9626332da53d0f
Reviewed-on: http://review.whamcloud.com/13391
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh

index 37cd791..b88859d 100644 (file)
@@ -59,6 +59,14 @@ STORED_OSTSIZE=$OSTSIZE
 MDSSIZE=200000
 OSTSIZE=200000
 
+fs2mds_HOST=$mds_HOST
+fs2ost_HOST=$ost_HOST
+fs3ost_HOST=$ost_HOST
+
+MDSDEV1_2=$fs2mds_DEV
+OSTDEV1_2=$fs2ost_DEV
+OSTDEV2_2=$fs3ost_DEV
+
 if ! combined_mgs_mds; then
     # bug number for skipped test:    23954
     ALWAYS_EXCEPT="$ALWAYS_EXCEPT       24b"
@@ -249,6 +257,16 @@ cleanup() {
        cleanup_nocli || return $?
 }
 
+cleanup_fs2() {
+       trap 0
+       echo "umount $MOUNT2 ..."
+       umount $MOUNT2 || true
+       echo "stopping fs2mds ..."
+       stop fs2mds -f || true
+       echo "stopping fs2ost ..."
+       stop fs2ost -f || true
+}
+
 check_mount() {
        do_facet client "cp /etc/passwd $DIR/a" || return 71
        do_facet client "rm $DIR/a" || return 72
@@ -759,6 +777,58 @@ test_21d() {
 }
 run_test 21d "start mgs then ost and then mds"
 
+cleanup_21e() {
+       MGSNID="$saved_mgsnid"
+       cleanup_fs2
+       echo "stopping fs2mgs ..."
+       stop $fs2mgs -f || true
+}
+
+test_21e() { # LU-5863
+       if [[ -z "$fs3ost_DEV" || -z "$fs2ost_DEV" || -z "$fs2mds_DEV" ]]; then
+               is_blkdev $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) &&
+               skip_env "mixed loopback and real device not working" && return
+       fi
+
+       local fs2mdsdev=$(mdsdevname 1_2)
+       local fs2ostdev=$(ostdevname 1_2)
+       local fs3ostdev=$(ostdevname 2_2)
+
+       local fs2mdsvdev=$(mdsvdevname 1_2)
+       local fs2ostvdev=$(ostvdevname 1_2)
+       local fs3ostvdev=$(ostvdevname 2_2)
+
+       # temporarily use fs3ost as fs2mgs
+       local fs2mgs=fs3ost
+       local fs2mgsdev=$fs3ostdev
+       local fs2mgsvdev=$fs3ostvdev
+
+       local fsname=test1234
+
+       add $fs2mgs $(mkfs_opts mgs $fs2mgsdev) --fsname=$fsname \
+               --reformat $fs2mgsdev $fs2mgsvdev || error "add fs2mgs failed"
+       start $fs2mgs $fs2mgsdev $MGS_MOUNT_OPTS && trap cleanup_21e EXIT INT ||
+               error "start fs2mgs failed"
+
+       local saved_mgsnid="$MGSNID"
+       MGSNID=$(do_facet $fs2mgs $LCTL list_nids | xargs | tr ' ' ,)
+
+       add fs2mds $(mkfs_opts mds1 $fs2mdsdev $fsname) \
+               --reformat $fs2mdsdev $fs2mdsvdev || error "add fs2mds failed"
+       add fs2ost $(mkfs_opts ost1 $fs2ostdev $fsname) \
+               --reformat $fs2ostdev $fs2ostvdev || error "add fs2ost failed"
+
+       start fs2ost $fs2ostdev $OST_MOUNT_OPTS || error "start fs2ost failed"
+       start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS || error "start fs2mds failed"
+
+       mkdir -p $MOUNT2 || error "mkdir $MOUNT2 failed"
+       $MOUNT_CMD $MGSNID:/$fsname $MOUNT2 || error "mount $MOUNT2 failed"
+       DIR=$MOUNT2 MOUNT=$MOUNT2 check_mount || error "check $MOUNT2 failed"
+
+       cleanup_21e
+}
+run_test 21e "separate MGS and MDS"
+
 test_22() {
        start_mds || error "MDS start failed"
 
@@ -862,23 +932,6 @@ test_23b() {    # was test_23
 }
 run_test 23b "Simulate -EINTR during mount"
 
-fs2mds_HOST=$mds_HOST
-fs2ost_HOST=$ost_HOST
-
-MDSDEV1_2=$fs2mds_DEV
-OSTDEV1_2=$fs2ost_DEV
-OSTDEV2_2=$fs3ost_DEV
-
-cleanup_fs2() {
-       trap 0
-       echo "umount $MOUNT2 ..."
-       umount $MOUNT2 || true
-       echo "stopping fs2mds ..."
-       stop fs2mds -f || true
-       echo "stopping fs2ost ..."
-       stop fs2ost -f || true
-}
-
 test_24a() {
        local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
 
@@ -2293,7 +2346,6 @@ test_36() { # 12743
 
        local rc=0
        local FSNAME2=test1234
-       local fs3ost_HOST=$ost_HOST
        local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
 
        [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
index 13d02b9..96d86bc 100755 (executable)
@@ -3295,10 +3295,6 @@ mkfs_opts() {
        local fs_mkfs_opts
        local var
 
-       if [ $type == MGS ] && combined_mgs_mds; then
-               return 1
-       fi
-
        if [ $type == MGS ] || ( [ $type == MDS ] &&
                                  [ "$dev" == $(mgsdevname) ] &&
                                 [ "$host" == "$(facet_host mgs)" ] ); then