From ec794140e483701e8689597ca6b963d018c146ed Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Wed, 9 Jan 2019 14:57:04 +0300 Subject: [PATCH] LU-11843 tests: customise sanity-quota 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 Cray-bug-id: LUS-6162 Reviewed-by: Alexander Boyko Reviewed-by: Vladimir Saveliev Test-Parameters: trivial testlist=sanity-quota Change-Id: Ic7d58f4a077acdbeec426613777e3c7c0778f0a0 Reviewed-on: https://review.whamcloud.com/33997 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alexandr Boyko Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 48cfda6..af56cbc 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -436,7 +436,22 @@ enable_project_quota() { 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 @@ -3437,7 +3452,9 @@ run_test 63 "quota on DoM tests" 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 -- 1.8.3.1