Whamcloud - gitweb
LU-11607 tests: replace lustre_version/fstype - large-lun 80/36380/2
authorJames Nunez <jnunez@whamcloud.com>
Fri, 4 Oct 2019 17:54:56 +0000 (11:54 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 27 Oct 2019 04:17:31 +0000 (04:17 +0000)
The routine get_lustre_env() is available to all Lustre test
suites and sets environment variables for the Lustre version
installed on servers and clients.

Replace calls to lustre_version_code() and facet_fstype()
for all server types with definitions from get_lustre_env()
for the large-lun, lfsck-performance, sanity-selinux and
scrub-performance test suites.

While doing this, replace ‘$SINGLEMDS’ with ‘MDS1_VERSION’
in lustre_version_code() and facet_fstype().

Test-Parameters: trivial fstype=ldiskfs testlist=sanity-selinux,scrub-performance
Test-Parameters: fstype=zfs testlist=ldiskfs testlist=sanity-selinux,scrub-performance
Test-Parameters: fstype=ldiskfs testlist=large-lun,lfsck-performance
Test-Parameters: fstype=zfs testlist=ldiskfs testlist=large-lun,lfsck-performance
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: Ie1a04103b8d721ab20992ed0a9afb3a399270937
Reviewed-on: https://review.whamcloud.com/36380
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/large-lun.sh
lustre/tests/lfsck-performance.sh
lustre/tests/sanity-selinux.sh
lustre/tests/scrub-performance.sh

index 38be6cb..5f3f80b 100644 (file)
@@ -148,9 +148,10 @@ do_fsck() {
 trap cleanupall EXIT
 
 test_1 () {
-       [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
-               skip_env "ldiskfs only test"
+       [ "$mds1_FSTYPE" != ldiskfs ] && skip_env "ldiskfs only test"
+
        local dev
+
        for num in $(seq $OSTCOUNT); do
                dev=$(ostdevname $num)
                log "run llverdev on the OST $dev"
index a7aee98..791d5e3 100644 (file)
@@ -179,7 +179,7 @@ test_0() {
 run_test 0 "lfsck namespace performance (routine case) without load"
 
 test_1() {
-       [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
+       [ "$mds1_FSTYPE" != ldiskfs ] &&
                skip_env "not implemented for ZFS"
 
        local BCOUNT=0
index c08f446..c3990be 100755 (executable)
@@ -422,8 +422,8 @@ trace_cmd() {
 }
 
 test_20d() {
-       if [ $MDS1_VERSION -lt $(version_code 2.12.50) ] ||
-          [ $CLIENT_VERSION -lt $(version_code 2.12.50) ]; then
+       if [ "$MDS1_VERSION" -lt $(version_code 2.12.50) ] ||
+          [ "$CLIENT_VERSION" -lt $(version_code 2.12.50) ]; then
                skip "Need version >= 2.12.50"
        fi
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
@@ -522,11 +522,11 @@ remove_nodemap() {
 }
 
 test_21a() {
-       local sepol
-
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.11.56) ] &&
                skip "Need MDS >= 2.11.56"
 
+       local sepol
+
        # umount client
        if [ "$MOUNT_2" ] && $(grep -q $MOUNT2' ' /proc/mounts); then
                umount_client $MOUNT2 || error "umount $MOUNT2 failed"
@@ -591,11 +591,11 @@ test_21a() {
 run_test 21a "Send sepol at connect"
 
 test_21b() {
-       local sepol
-
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.11.56) ] &&
                skip "Need MDS >= 2.11.56"
 
+       local sepol
+
        mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
        echo test > $DIR/$tdir/toopen ||
                error "failed to write to $DIR/$tdir/toopen"
index f04e08c..a75daa7 100644 (file)
@@ -16,10 +16,10 @@ init_logging
 [ "$SLOW" = "no" ] &&
        skip "skip scrub performance test under non-SLOW mode" && exit 0
 
-[ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
-       skip "ldiskfs only test" && exit 0
-[[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.2.90) ]] &&
-       skip "Need MDS version at least 2.2.90" && exit 0
+[ "$mds1_FSTYPE" != ldiskfs ] &&
+       skip "ldiskfs only test"
+[[ "$MDS1_VERSION" -lt $(version_code 2.2.90) ]] &&
+       skip "Need MDS version at least 2.2.90"
 require_dsh_mds || exit 0
 
 NTHREADS=${NTHREADS:-0}