Whamcloud - gitweb
LU-2469 tests: use MDS/OSTDEV and MDS/OSTDEVBASE with zfs 16/5016/21
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Tue, 18 Dec 2012 19:05:55 +0000 (14:05 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Nov 2013 02:41:31 +0000 (02:41 +0000)
Add support for using MDSDEVn, OSTDEVn, MDSDEVBASE and OSTDEVBASE
variables when testing with zfs.
Add *ZFSDEVn variable for specifying ZFS format devices.
Remove use of *DEVn use outside of test-framework.sh

MDSDEV et al. specify physical device formatted.

Formerly Change-Id I89115ce935294cdbbd6620fec3f9dc3eb76f8960

Test-Parameters: mdsfilesystemtype=zfs ostfilesystemtype=zfs  mdtfilesystemtype=zfs testlist=sanity
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: If6506995d9d61f9c97827f45071f0d317c7a09f9
Reviewed-on: http://review.whamcloud.com/5016
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/cfg/local.sh
lustre/tests/conf-sanity.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-single.sh
lustre/tests/test-framework.sh

index 13f06a3..892178d 100644 (file)
@@ -47,6 +47,10 @@ OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-}
 # OSTDEV1="/dev/sda"
 # on specific hosts with
 # ost1_HOST="uml2"
+#
+# For ZFS, ost devices can be specified via either or both of the following:
+# OSTZFSDEV1="${FSNAME}-ost1/ost1"
+# OSTDEV1="/dev/sdb1"
 
 NETTYPE=${NETTYPE:-tcp}
 MGSNID=${MGSNID:-`h2$NETTYPE $mgs_HOST`}
index 32ee910..93dfacb 100644 (file)
@@ -123,7 +123,7 @@ reformat() {
 
 start_mgs () {
        echo "start mgs"
-       start mgs $MGSDEV $MGS_MOUNT_OPTS
+       start mgs $(mgsdevname) $MGS_MOUNT_OPTS
 }
 
 start_mdt() {
index a07c407..0d38b23 100755 (executable)
@@ -1508,10 +1508,11 @@ test_103()
         stop mds1
 
         # We need this test because mds is like a client in IR context.
-        start mds1 $MDSDEV1 || error "MDS should start w/o mgs"
+        start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS ||
+               error "MDS should start w/o mgs"
 
         # start mgs and remount mds w/ ir
-        start mgs $MGSDEV
+        start mgs $(mgsdevname) $MGS_MOUNT_OPTS
         clients_up
 
         # remount client so that fsdb will be created on the MGS
index 87e73b9..de79700 100755 (executable)
@@ -1556,9 +1556,10 @@ test_61d() { # bug 16002 # bug 17466 # bug 22137
 #   OBD_FAIL_OBD_LLOG_SETUP        0x605
     stop mgs
     do_facet mgs "lctl set_param fail_loc=0x80000605"
-    start mgs $MGSDEV $MGS_MOUNT_OPTS && error "mgs start should have failed"
+    start mgs $(mgsdevname) $MGS_MOUNT_OPTS &&
+       error "mgs start should have failed"
     do_facet mgs "lctl set_param fail_loc=0"
-    start mgs $MGSDEV $MGS_MOUNT_OPTS || error "cannot restart mgs"
+    start mgs $(mgsdevname) $MGS_MOUNT_OPTS || error "cannot restart mgs"
 }
 run_test 61d "error in llog_setup should cleanup the llog context correctly"
 
index 0c81610..f046b87 100644 (file)
@@ -2855,9 +2855,10 @@ add() {
        fi
 }
 
+# Device formatted as ost
 ostdevname() {
-    num=$1
-    DEVNAME=OSTDEV$num
+       local num=$1
+       local DEVNAME=OSTDEV$num
 
        local fstype=$(facet_fstype ost$num)
 
@@ -2866,8 +2867,9 @@ ostdevname() {
                        #if $OSTDEVn isn't defined, default is $OSTDEVBASE + num
                        eval DEVPTR=${!DEVNAME:=${OSTDEVBASE}${num}};;
                zfs )
-                       #dataset name is independent of vdev device names
-                       eval DEVPTR=${FSNAME}-ost${num}/ost${num};;
+                       #try $OSTZFSDEVn - independent of vdev
+                       DEVNAME=OSTZFSDEV$num
+                       eval DEVPTR=${!DEVNAME:=${FSNAME}-ost${num}/ost${num}};;
                * )
                        error "unknown fstype!";;
        esac
@@ -2875,9 +2877,11 @@ ostdevname() {
     echo -n $DEVPTR
 }
 
+# Physical device location of data
 ostvdevname() {
-       num=$1
-       DEVNAME=OSTDEV$num
+       local num=$1
+       local DEVNAME
+       local VDEVPTR
 
        local fstype=$(facet_fstype ost$num)
 
@@ -2886,7 +2890,9 @@ ostvdevname() {
                        # vdevs are not supported by ldiskfs
                        eval VDEVPTR="";;
                zfs )
-                       #if $OSTDEVn isn't defined, default is $OSTDEVBASE + num
+                       #if $OSTDEVn isn't defined, default is $OSTDEVBASE{n}
+                       # Device formated by zfs
+                       DEVNAME=OSTDEV$num
                        eval VDEVPTR=${!DEVNAME:=${OSTDEVBASE}${num}};;
                * )
                        error "unknown fstype!";;
@@ -2895,19 +2901,21 @@ ostvdevname() {
        echo -n $VDEVPTR
 }
 
+# Logical device formated for lustre
 mdsdevname() {
-    num=$1
-    DEVNAME=MDSDEV$num
+       local num=$1
+       local DEVNAME=MDSDEV$num
 
        local fstype=$(facet_fstype mds$num)
 
        case $fstype in
                ldiskfs )
-                       #if $MDSDEVn isn't defined, default is $MDSDEVBASE + num
+                       #if $MDSDEVn isn't defined, default is $MDSDEVBASE{n}
                        eval DEVPTR=${!DEVNAME:=${MDSDEVBASE}${num}};;
                zfs )
-                       #dataset name is independent of vdev device names
-                       eval DEVPTR=${FSNAME}-mdt${num}/mdt${num};;
+                       # try $MDSZFSDEVn - independent of vdev
+                       DEVNAME=MDSZFSDEV$num
+                       eval DEVPTR=${!DEVNAME:=${FSNAME}-mdt${num}/mdt${num}};;
                * )
                        error "unknown fstype!";;
        esac
@@ -2915,10 +2923,10 @@ mdsdevname() {
        echo -n $DEVPTR
 }
 
+# Physical location of data
 mdsvdevname() {
-       num=$1
-       DEVNAME=MDSDEV$num
-
+       local VDEVPTR=""
+       local num=$1
        local fstype=$(facet_fstype mds$num)
 
        case $fstype in
@@ -2926,7 +2934,9 @@ mdsvdevname() {
                        # vdevs are not supported by ldiskfs
                        eval VDEVPTR="";;
                zfs )
-                       #if $MDSDEVn isn't defined, default is $MDSDEVBASE + num
+                       # if $MDSDEVn isn't defined, default is $MDSDEVBASE{n}
+                       # Device formated by ZFS
+                       local DEVNAME=MDSDEV$num
                        eval VDEVPTR=${!DEVNAME:=${MDSDEVBASE}${num}};;
                * )
                        error "unknown fstype!";;
@@ -2949,10 +2959,11 @@ mgsdevname() {
                fi;;
        zfs )
                if [ $(facet_host mgs) = $(facet_host mds1) ] &&
-                  ( [ -z "$MGSDEV" ] || [ $MGSDEV = $(mdsvdevname 1) ] ); then
+                   ( [ -z "$MGSZFSDEV" ] &&
+                       [ -z "$MGSDEV" -o "$MGSDEV" = $(mdsvdevname 1) ] ); then
                        DEVPTR=$(mdsdevname 1)
                else
-                       DEVPTR=${FSNAME}-mgs/mgs
+                       DEVPTR=${MGSZFSDEV:-${FSNAME}-mgs/mgs}
                fi;;
        * )
                error "unknown fstype!";;
@@ -2962,8 +2973,7 @@ mgsdevname() {
 }
 
 mgsvdevname() {
-       local VDEVPTR
-       DEVNAME=MGSDEV
+       local VDEVPTR=""
 
        local fstype=$(facet_fstype mgs)
 
@@ -2973,9 +2983,10 @@ mgsvdevname() {
                ;;
        zfs )
                if [ $(facet_host mgs) = $(facet_host mds1) ] &&
-                  ( [ -z "$MGSDEV" ] || [ $MGSDEV = $(mdsvdevname 1) ] ); then
+                  ( [ -z "$MGSDEV" ] &&
+                      [ -z "$MGSZFSDEV" -o "$MGSZFSDEV" = $(mdsdevname 1) ]); then
                        VDEVPTR=$(mdsvdevname 1)
-               else
+               elif [ -n "$MGSDEV" ]; then
                        VDEVPTR=$MGSDEV
                fi;;
        * )