The routine get_lustre_env() is available to all Lustre test
suites and sets an environment variable for the file system
type for MDS1 and OST1 and sets variables for the Lustre
version of servers.
In sanity-dom and sanity-quota, replace the calls to
facet_fstype() and lustre_version_code() for all server
types with definitions in get_lustre_env().
While doing this, replace 'facet_fstype $SINGLEMDS' and
'lustre_version_code $SINGLEMDS' with $mds1_FSTYPE
and $MDS1_VERSION, respectively.
Clean up around any modifications by removing calls to
return after skip() or skip_env() and convert spaces
to tabs.
Test-Parameters: trivial testlist=sanity-dom,sanity-quota
Test-Parameters: fstype=zfs testlist=sanity-dom,sanity-quota
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I4dffae5ad69aa2dec5b85e285a9b314b9b35b2ba
Reviewed-on: https://review.whamcloud.com/35766
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
-[[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.56) ]] ||
- { skip "Need MDS version at least 2.10.56"; exit 0; }
+[[ "$MDS1_VERSION" -ge $(version_code 2.10.56) ]] ||
+ skip "Need MDS version at least 2.10.56"
OPENFILE=${OPENFILE:-openfile}
MOUNT_2=${MOUNT_2:-"yes"}
OPENFILE=${OPENFILE:-openfile}
MOUNT_2=${MOUNT_2:-"yes"}
# Test duration: 30 min
[ "$SLOW" = "no" ] && EXCEPT_SLOW="61"
# Test duration: 30 min
[ "$SLOW" = "no" ] && EXCEPT_SLOW="61"
-if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
+if [ "$mds1_FSTYPE" = zfs ]; then
# bug number: LU-2887
# Test duration: 21 9 min"
[ "$SLOW" = "no" ] && EXCEPT_SLOW+=" 12a 9"
# bug number: LU-2887
# Test duration: 21 9 min"
[ "$SLOW" = "no" ] && EXCEPT_SLOW+=" 12a 9"
require_dsh_ost || exit 0
# Does e2fsprogs support quota feature?
require_dsh_ost || exit 0
# Does e2fsprogs support quota feature?
-if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
+if [ "$mds1_FSTYPE" == ldiskfs ] &&
do_facet $SINGLEMDS "! $DEBUGFS -c -R supported_features |
grep -q 'quota'"; then
do_facet $SINGLEMDS "! $DEBUGFS -c -R supported_features |
grep -q 'quota'"; then
- skip_env "e2fsprogs doesn't support quota" && exit 0
+ skip_env "e2fsprogs doesn't support quota"
fi
QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
fi
QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
local etime=$(date +%s)
delta=$((etime - stime))
if [ $delta -gt 0 ]; then
local etime=$(date +%s)
delta=$((etime - stime))
if [ $delta -gt 0 ]; then
- rate=$((size * 1024 / delta))
- if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
- # LU-2872 - see LU-2887 for fix
- [ $rate -gt 64 ] ||
- error "SLOW IO for $TSTUSR (user): $rate KB/sec"
- else
- [ $rate -gt 1024 ] ||
- error "SLOW IO for $TSTUSR (user): $rate KB/sec"
- fi
+ rate=$((size * 1024 / delta))
+ if [ "$mds1_FSTYPE" = zfs ]; then
+ # LU-2872 - see LU-2887 for fix
+ [ $rate -gt 64 ] ||
+ error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+ else
+ [ $rate -gt 1024 ] ||
+ error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+ fi
$LFS setquota -u $TSTUSR -b 0 -B 0 -i $LIMIT -I 0 $DIR ||
error "set user quota failed"
$LFS setquota -u $TSTUSR -b 0 -B 0 -i $LIMIT -I 0 $DIR ||
error "set user quota failed"
- [ $(facet_fstype $SINGLEMDS) = "zfs" ] && GRACE=20
+ [ "$mds1_FSTYPE" = zfs ] && GRACE=20
test_file_soft $TESTFILE $LIMIT $GRACE "u"
test_file_soft $TESTFILE $LIMIT $GRACE "u"
# enable ost quota
set_ost_qtype $QTYPE || error "enable ost quota failed"
# trigger reintegration
# enable ost quota
set_ost_qtype $QTYPE || error "enable ost quota failed"
# trigger reintegration
- local procf="osd-$(facet_fstype ost1).$FSNAME-OST*."
+ local procf="osd-$ost1_FSTYPE.$FSNAME-OST*."
procf=${procf}quota_slave.force_reint
do_facet ost1 $LCTL set_param $procf=1 ||
error "force reintegration failed"
procf=${procf}quota_slave.force_reint
do_facet ost1 $LCTL set_param $procf=1 ||
error "force reintegration failed"
# LU-2435: skip this quota test if underlying zfs version has not
# supported native dnode accounting
# LU-2435: skip this quota test if underlying zfs version has not
# supported native dnode accounting
- [ "$(facet_fstype mds1)" == "zfs" ] && {
+ [ "$mds1_FSTYPE" == zfs ] && {
local F="feature@userobj_accounting"
local pool=$(zpool_name mds1)
local feature=$(do_facet mds1 $ZPOOL get -H $F $pool)
local F="feature@userobj_accounting"
local pool=$(zpool_name mds1)
local feature=$(do_facet mds1 $ZPOOL get -H $F $pool)
- [ $(facet_fstype ost1) == "zfs" ] &&
+ [ "$ost1_FSTYPE" == zfs ] &&
skip "Overwrite in place is not guaranteed to be " \
"space neutral on ZFS"
skip "Overwrite in place is not guaranteed to be " \
"space neutral on ZFS"
# chown/chgrp to the file created with MDS_OPEN_DELAY_CREATE
# LU-5006
test_37() {
# chown/chgrp to the file created with MDS_OPEN_DELAY_CREATE
# LU-5006
test_37() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.93) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.6.93) ] &&
skip "Old server doesn't have LU-5006 fix."
setup_quota_test || error "setup quota failed with $?"
skip "Old server doesn't have LU-5006 fix."
setup_quota_test || error "setup quota failed with $?"
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.8.60) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.8.60) ] &&
skip "Old server doesn't have LU-8801 fix."
[ "$UID" != 0 ] && skip_env "must run as root" && return
skip "Old server doesn't have LU-8801 fix."
[ "$UID" != 0 ] && skip_env "must run as root" && return
cancel_lru_locks osc
sync; sync_all_data || true
cancel_lru_locks osc
sync; sync_all_data || true
- local procf="osd-$(facet_fstype $SINGLEMDS).$FSNAME-MDT0000"
+ local procf="osd-$mds1_FSTYPE.$FSNAME-MDT0000"
procf=${procf}.quota_slave.acct_user
local accnt_cnt
procf=${procf}.quota_slave.acct_user
local accnt_cnt
run_test 54 "basic lfs project interface test"
test_55() {
run_test 54 "basic lfs project interface test"
test_55() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.58) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.10.58) ] &&
skip "Not supported before 2.10.58."
setup_quota_test || error "setup quota failed with $?"
skip "Not supported before 2.10.58."
setup_quota_test || error "setup quota failed with $?"
run_test 57 "lfs project could tolerate errors"
test_59() {
run_test 57 "lfs project could tolerate errors"
test_59() {
- [ "$(facet_fstype $SINGLEMDS)" != "ldiskfs" ] &&
+ [ "$mds1_FSTYPE" != ldiskfs ] &&
skip "ldiskfs only test"
disable_project_quota
setup_quota_test || error "setup quota failed with $?"
skip "ldiskfs only test"
disable_project_quota
setup_quota_test || error "setup quota failed with $?"
# test default quota
test_default_quota() {
# test default quota
test_default_quota() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.51) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.11.51) ] &&
skip "Not supported before 2.11.51."
local qtype=$1
skip "Not supported before 2.11.51."
local qtype=$1
run_test 62 "Project inherit should be only changed by root"
test_dom() {
run_test 62 "Project inherit should be only changed by root"
test_dom() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.55) ] &&
- skip "Not supported before 2.11.55" && return
+ [ "$MDS1_VERSION" -lt $(version_code 2.11.55) ] &&
+ skip "Not supported before 2.11.55"
local qtype=$1
local qid=$TSTUSR
local qtype=$1
local qid=$TSTUSR