Whamcloud - gitweb
LU-11843 tests: customise sanity-quota 97/33997/3
authorElena Gryaznova <c17455@cray.com>
Wed, 9 Jan 2019 11:57:04 +0000 (14:57 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 16 Jan 2019 07:08:39 +0000 (07:08 +0000)
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>
lustre/tests/sanity-quota.sh

index 48cfda6..af56cbc 100755 (executable)
@@ -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