Whamcloud - gitweb
LU-13784 tests: allow QUOTA_TYPE to be set 59/39359/2
authorAlexander Zarochentsev <c17826@cray.com>
Mon, 15 Jun 2020 15:07:20 +0000 (18:07 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 7 Aug 2020 04:59:44 +0000 (04:59 +0000)
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 <alexander.zarochentsev@hpe.com>
Change-Id: Ie9bfa536b5ea704e0637afb10a8bb82c64b2bdf6
Reviewed-on: https://review.whamcloud.com/39359
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Elena Gryaznova <c17455@cray.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/cfg/local.sh
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh

index df6c5c3..5530799 100644 (file)
@@ -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
index 5821ef5..7795faf 100644 (file)
@@ -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
index 84d2671..60052be 100755 (executable)
@@ -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