From 9b4b2523d9a432ca10ee48cc0276d324e893801b Mon Sep 17 00:00:00 2001 From: Alexander Zarochentsev Date: Mon, 15 Jun 2020 18:07:20 +0300 Subject: [PATCH] LU-13784 tests: allow QUOTA_TYPE to be set QUOTA_TYPE unconditionally set to "ug3" in lustre/test/cfg/local.sh, it makes enabling project quota support a non trivial task; Fixing conf-sanity test 86 to accept more than one -O option. HPE-bug-id: LUS-8983 Test-Parameters: envdefinitions="ENABLE_QUOTA=yes QUOTA_TYPE=p" Signed-off-by: Alexander Zarochentsev Change-Id: Ie9bfa536b5ea704e0637afb10a8bb82c64b2bdf6 Reviewed-on: https://review.whamcloud.com/39359 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Elena Gryaznova Reviewed-by: Artem Blagodarenko Reviewed-by: Oleg Drokin --- lustre/tests/cfg/local.sh | 2 +- lustre/tests/conf-sanity.sh | 16 ++++------------ lustre/tests/test-framework.sh | 2 ++ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index df6c5c3..5530799 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -111,7 +111,7 @@ fi DEBUG_SIZE=${DEBUG_SIZE:-$_debug_mb} ENABLE_QUOTA=${ENABLE_QUOTA:-""} -QUOTA_TYPE="ug3" +QUOTA_TYPE=${QUOTA_TYPE:-"ug3"} QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"} # "error: conf_param: No such device" issue in every test suite logs # sanity-quota test_32 hash_lqs_cur_bits is not set properly diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 5821ef5..7795faf 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -6311,23 +6311,15 @@ test_86() { [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] || skip "Need server version newer than 2.7.55" - local OST_OPTS="$(mkfs_opts ost1 $(ostdevname 1)) \ - --reformat $(ostdevname 1) $(ostvdevname 1)" - local NEWSIZE=1024 local OLDSIZE=$(do_facet ost1 "$DEBUGFS -c -R stats $(ostdevname 1)" | awk '/Flex block group size: / { print $NF; exit; }') - local opts=OST_OPTS - if [[ ${!opts} != *mkfsoptions* ]]; then - eval opts=\"${!opts} \ - --mkfsoptions='\\\"-O flex_bg -G $NEWSIZE\\\"'\" - else - val=${!opts//--mkfsoptions=\\\"/ \ - --mkfsoptions=\\\"-O flex_bg -G $NEWSIZE } - eval opts='${val}' - fi + [ "$OLDSIZE" == "$NEWSIZE" ] && skip "$NEWSIZE groups already" + local opts=" -O flex_bg -G $NEWSIZE" + opts=$(OST_FS_MKFS_OPTS+="$opts" mkfs_opts ost1 $(ostdevname 1)) + opts+=" --reformat $(ostdevname 1) $(ostvdevname 1)" echo "params: $opts" trap cleanup_86 EXIT ERR diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 84d2671..60052be 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4649,6 +4649,8 @@ mkfs_opts() { var=${type}_FS_MKFS_OPTS fs_mkfs_opts+=${!var:+" ${!var}"} + [[ "$QUOTA_TYPE" =~ "p" ]] && fs_mkfs_opts+=" -O project" + [ $fstype == ldiskfs ] && fs_mkfs_opts=$(squash_opt $fs_mkfs_opts) if [ -n "${fs_mkfs_opts## }" ]; then -- 1.8.3.1