Whamcloud - gitweb
LU-11607 tests: replace lustre_version/fstype - full 75/36375/3
authorJames Nunez <jnunez@whamcloud.com>
Fri, 4 Oct 2019 17:43:05 +0000 (11:43 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 14 Dec 2019 05:59:35 +0000 (05:59 +0000)
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 <jnunez@whamcloud.com>
Change-Id: I4581ccf98b9da256a00f24a2da8cd8ff41f115ca
Reviewed-on: https://review.whamcloud.com/36375
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/racer.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-vbr.sh
lustre/tests/sanity-lsnapshot.sh

index 77e4868..33d0500 100644 (file)
@@ -29,26 +29,24 @@ echo RACERDIRS=$RACERDIRS
 #LU-4684
 RACER_ENABLE_MIGRATION=false
 
 #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}
        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
 
        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
 
    $(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
 
        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
 
        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}
        RACER_ENABLE_FLR=false
 
 RACER_ENABLE_REMOTE_DIRS=${RACER_ENABLE_REMOTE_DIRS:-false}
index f9af360..2114600 100755 (executable)
@@ -24,7 +24,7 @@ remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
 #                                   7  (min)"
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="21b"
 
 #                                   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
 # 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 () {
 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
 
        touch $MOUNT/$tfile
        stat $MOUNT/$tfile >&/dev/null
@@ -908,7 +908,7 @@ test_25() {
        sleep 1
 
        # failover, replay and resend replayed waiting locks
        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
                #define OBD_FAIL_LDLM_SRV_CP_AST      0x325
                do_facet ost1 lctl set_param fail_loc=0x80000325
        else
index b759e49..f641498 100755 (executable)
@@ -862,21 +862,20 @@ test_7f() {
 run_test 7f "unlink, {lost}, rename"
 
 test_7g() {
 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
                test_7_cycle "$first" "$lost" "$last" ||
                        error "Test 7g.3 failed"
        else #LU-4442 LU-3528
index 8126799..1370711 100755 (executable)
@@ -17,12 +17,11 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 . ${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
 
 require_dsh_mds || exit 0
 require_dsh_ost || exit 0