From: Wang Shilong Date: Wed, 13 Jun 2018 14:12:16 +0000 (+0800) Subject: LU-11086 test: reset quota setting properly X-Git-Tag: 2.11.53~22 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=04585d02d1e175cb74254c58ee65291ff707a888 LU-11086 test: reset quota setting properly some test cases don't reset quota setting properly, which make running sanity-quota.sh several times fail, this patch try to improve this problem by: 1)reset quota setting before check_runas_id_ret, as it will touch file which might hit EDQUOT if we don't cleanup quota setting properly since last run. 2)fix to reset quota for test case 55 and 60. 3)reset quota setting again after all tests finished, because some tests after sanity-quota.sh might be affected, if quota setting not reset properly for some reasons. Test-Parameters: trivial testlist=sanity-quota,sanity-quota Change-Id: I2983102ea379e64173ef8c54b149ba3b5fbfebe9 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/32707 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 814fff7..ede0594 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -128,11 +128,6 @@ DD="dd if=/dev/zero bs=1M" FAIL_ON_ERROR=false -check_runas_id_ret $TSTUSR $TSTUSR $RUNAS || - error "Please create user $TSTUSR($TSTID) and group $TSTUSR($TSTID)" -check_runas_id_ret $TSTUSR2 $TSTUSR2 $RUNAS2 || - error "Please create user $TSTUSR2($TSTID2) and group $TSTUSR2($TSTID2)" - # clear quota limits for a user or a group # usage: resetquota -u username # resetquota -g groupname @@ -431,17 +426,25 @@ enable_project_quota() { } enable_project_quota +reset_quota_settings() { + resetquota -u $TSTUSR + resetquota -g $TSTUSR + resetquota -u $TSTUSR2 + resetquota -g $TSTUSR2 + resetquota -p $TSTPRJID +} + # enable quota debug quota_init() { do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota" } quota_init +reset_quota_settings -resetquota -u $TSTUSR -resetquota -g $TSTUSR -resetquota -u $TSTUSR2 -resetquota -g $TSTUSR2 -resetquota -p $TSTPRJID +check_runas_id_ret $TSTUSR $TSTUSR $RUNAS || + error "Please create user $TSTUSR($TSTID) and group $TSTUSR($TSTID)" +check_runas_id_ret $TSTUSR2 $TSTUSR2 $RUNAS2 || + error "Please create user $TSTUSR2($TSTID2) and group $TSTUSR2($TSTID2)" test_quota_performance() { local TESTFILE="$DIR/$tdir/$tfile-0" @@ -3022,6 +3025,7 @@ test_55() { $LFS quota -v -g $TSTUSR2 $DIR + resetquota -g $TSTUSR2 cleanup_quota_test } run_test 55 "Chgrp should be affected by group quota" @@ -3268,6 +3272,7 @@ quota_fini() do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-quota" disable_project_quota } +reset_quota_settings quota_fini cd $ORIG_PWD