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>
#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) ]] &&
-[[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.10.53) ]] &&
+[[ "$MDS1_VERSION" -le $(version_code 2.10.53) ]] &&
-[[ $(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}
# 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
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
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
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
. ${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