From d2fff2c2e49526f1bcbdb1f63ed20aff558b3836 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Fri, 4 Oct 2019 11:54:56 -0600 Subject: [PATCH] LU-11607 tests: replace lustre_version/fstype - large-lun MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ie1a04103b8d721ab20992ed0a9afb3a399270937 Reviewed-on: https://review.whamcloud.com/36380 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Reviewed-by: Wei Liu --- lustre/tests/large-lun.sh | 5 +++-- lustre/tests/lfsck-performance.sh | 2 +- lustre/tests/sanity-selinux.sh | 16 ++++++++-------- lustre/tests/scrub-performance.sh | 8 ++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lustre/tests/large-lun.sh b/lustre/tests/large-lun.sh index 38be6cb..5f3f80b 100644 --- a/lustre/tests/large-lun.sh +++ b/lustre/tests/large-lun.sh @@ -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" diff --git a/lustre/tests/lfsck-performance.sh b/lustre/tests/lfsck-performance.sh index a7aee98..791d5e3 100644 --- a/lustre/tests/lfsck-performance.sh +++ b/lustre/tests/lfsck-performance.sh @@ -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 diff --git a/lustre/tests/sanity-selinux.sh b/lustre/tests/sanity-selinux.sh index c08f446..c3990be 100755 --- a/lustre/tests/sanity-selinux.sh +++ b/lustre/tests/sanity-selinux.sh @@ -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" diff --git a/lustre/tests/scrub-performance.sh b/lustre/tests/scrub-performance.sh index f04e08c..a75daa7 100644 --- a/lustre/tests/scrub-performance.sh +++ b/lustre/tests/scrub-performance.sh @@ -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} -- 1.8.3.1