Patch adds the possibility to not turn project quotas OFF
at the end of sanity-quota if it is ON initially.
ENABLE_PROJECT_QUOTA=false is ignored in this case.
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: LUS-6162
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Test-Parameters: trivial testlist=sanity-quota
Change-Id: Ic7d58f4a077acdbeec426613777e3c7c0778f0a0
Reviewed-on: https://review.whamcloud.com/33997
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
mount
setupall
}
-enable_project_quota
+
+project_quota_enabled () {
+ local rc=0
+ for num in $(seq $MDSCOUNT); do
+ do_facet mds$num $DEBUGFS -R features $(mdsdevname $num) |
+ grep -q project || rc=1
+ done
+ for num in $(seq $OSTCOUNT); do
+ do_facet ost$num $DEBUGFS -R features $(ostdevname $num) |
+ grep -q project || rc=1
+ done
+ [ $rc -eq 0 ] && PQ_CLEANUP=false || PQ_CLEANUP=true
+ return $rc
+}
+
+project_quota_enabled || enable_project_quota
reset_quota_settings() {
resetquota -u $TSTUSR
quota_fini()
{
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-quota"
- disable_project_quota
+ if $PQ_CLEANUP; then
+ disable_project_quota
+ fi
}
reset_quota_settings
quota_fini