From 782b3533edb419374b7357b67ba4f9960d7e96cf Mon Sep 17 00:00:00 2001 From: James Nunez Date: Fri, 4 Oct 2019 11:43:05 -0600 Subject: [PATCH] LU-11607 tests: replace lustre_version/fstype - full 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 an environment variable for the Lustre version of 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 racer, replay-dual, replay-vbr and sanity-lsnapshot test suites. While doing this, replace ‘$SINGLEMDS’ with ‘MDS1_VERSION’ in lustre_version_code() and facet_fstype(). Clean up around any modifications by removing calls to return after skip() or skip_env() and converting spaces to tabs. Test-Parameters: trivial fstype=ldiskfs testlist=replay-vbr,sanity-lsnapshot Test-Parameters: fstype=zfs testlist=replay-vbr,sanity-lsnapshot Test-Parameters: fstype=ldiskfs testlist=racer,replay-dual Test-Parameters: fstype=zfs testlist=racer,replay-dual Signed-off-by: James Nunez Change-Id: I4581ccf98b9da256a00f24a2da8cd8ff41f115ca Reviewed-on: https://review.whamcloud.com/36375 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Wei Liu --- lustre/tests/racer.sh | 14 ++++++-------- lustre/tests/replay-dual.sh | 8 ++++---- lustre/tests/replay-vbr.sh | 29 ++++++++++++++--------------- lustre/tests/sanity-lsnapshot.sh | 11 +++++------ 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index 77e4868..33d0500 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -29,26 +29,24 @@ echo RACERDIRS=$RACERDIRS #LU-4684 RACER_ENABLE_MIGRATION=false -if ((MDSCOUNT > 1 && - $(lustre_version_code $SINGLEMDS) >= $(version_code 2.8.0))); then +if ((MDSCOUNT > 1 && "$MDS1_VERSION" >= $(version_code 2.8.0))); then RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-true} RACER_ENABLE_STRIPED_DIRS=${RACER_ENABLE_STRIPED_DIRS:-true} RACER_ENABLE_MIGRATION=${RACER_ENABLE_MIGRATION:-true} -elif ((MDSCOUNT > 1 && - $(lustre_version_code $SINGLEMDS) >= $(version_code 2.5.0))); then +elif ((MDSCOUNT > 1 && "$MDS1_VERSION" >= $(version_code 2.5.0))); then RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-true} fi -[[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.9.54) || +[[ "$MDS1_VERSION" -lt $(version_code 2.9.54) || $(facet_fstype mgs) != zfs ]] && RACER_ENABLE_SNAPSHOT=false -[[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.9.55) ]] && +[[ "$MDS1_VERSION" -le $(version_code 2.9.55) ]] && RACER_ENABLE_PFL=false -[[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.10.53) ]] && +[[ "$MDS1_VERSION" -le $(version_code 2.10.53) ]] && RACER_ENABLE_DOM=false -[[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ]] && +[[ "$MDS1_VERSION" -lt $(version_code 2.10.55) ]] && RACER_ENABLE_FLR=false RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-false} diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index f9af360..2114600 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -24,7 +24,7 @@ remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0 # 7 (min)" [ "$SLOW" = "no" ] && EXCEPT_SLOW="21b" -[[ $(facet_fstype $SINGLEMDS) == zfs ]] && +[[ "$mds1_FSTYPE" == zfs ]] && # bug number for skipped test: LU-2230 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21b" if $SHARED_KEY; then @@ -873,8 +873,8 @@ test_23d () { run_test 23d "c1 rmdir d1, M0 drop update reply and fail M0/M1, c2 mkdir d1" test_24 () { - [[ $(lustre_version_code $SINGLEMDS) -gt $(version_code 2.5.2) ]] || - { skip "Need MDS version newer than 2.5.2"; return 0; } + [[ "$MDS1_VERSION" -gt $(version_code 2.5.2) ]] || + skip "Need MDS version newer than 2.5.2" touch $MOUNT/$tfile stat $MOUNT/$tfile >&/dev/null @@ -908,7 +908,7 @@ test_25() { sleep 1 # failover, replay and resend replayed waiting locks - if [ $(lustre_version_code ost1) -ge $(version_code 2.6.90) ]; then + if [ "$OST1_VERSION" -ge $(version_code 2.6.90) ]; then #define OBD_FAIL_LDLM_SRV_CP_AST 0x325 do_facet ost1 lctl set_param fail_loc=0x80000325 else diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index b759e49..f641498 100755 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -862,21 +862,20 @@ test_7f() { run_test 7f "unlink, {lost}, rename" test_7g() { - first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" - lost="mkdir $MOUNT2/$tdir/$tfile-0;rmdir $MOUNT2/$tdir/$tfile-0" - last="createmany -o $DIR/$tdir/$tfile- 1" - test_7_cycle "$first" "$lost" "$last" && error "Test 7g.1 failed" - - first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" - lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0" - last="mkdir $DIR/$tdir/$tfile-0" - test_7_cycle "$first" "$lost" "$last" && error "Test 7g.2 failed" - - first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile" - lost="createmany -o $MOUNT2/$tdir/$tfile- 1" - last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" - if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.1) ] - then + first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" + lost="mkdir $MOUNT2/$tdir/$tfile-0;rmdir $MOUNT2/$tdir/$tfile-0" + last="createmany -o $DIR/$tdir/$tfile- 1" + test_7_cycle "$first" "$lost" "$last" && error "Test 7g.1 failed" + + first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" + lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0" + last="mkdir $DIR/$tdir/$tfile-0" + test_7_cycle "$first" "$lost" "$last" && error "Test 7g.2 failed" + + first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile" + lost="createmany -o $MOUNT2/$tdir/$tfile- 1" + last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1" + if [ "$MDS1_VERSION" -lt $(version_code 2.5.1) ]; then test_7_cycle "$first" "$lost" "$last" || error "Test 7g.3 failed" else #LU-4442 LU-3528 diff --git a/lustre/tests/sanity-lsnapshot.sh b/lustre/tests/sanity-lsnapshot.sh index 8126799..1370711 100755 --- a/lustre/tests/sanity-lsnapshot.sh +++ b/lustre/tests/sanity-lsnapshot.sh @@ -17,12 +17,11 @@ init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -[[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] || -[[ $(lustre_version_code ost1) -lt $(version_code 2.9.55) ]] && - skip "Need server version at least 2.9.55" && exit 0 -[[ $(facet_fstype mds1) = "ldiskfs" ]] || -[[ $(facet_fstype ost1) = "ldiskfs" ]] && - skip "ZFS only test" && exit 0 +[[ "$MDS1_VERSION" -lt $(version_code 2.9.55) ]] || +[[ "$OST1_VERSION" -lt $(version_code 2.9.55) ]] && + skip "Need server version at least 2.9.55" +[[ "$mds1_FSTYPE" = "ldiskfs" ]] || [[ "$ost1_FSTYPE" = "ldiskfs" ]] && + skip "ZFS only test" require_dsh_mds || exit 0 require_dsh_ost || exit 0 -- 1.8.3.1