From e7d63451eed447187dde0c672a65c1504ff24a07 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Sun, 6 Oct 2024 00:12:08 +0800 Subject: [PATCH] LU-18394 test: adjust step for different OS Arch in test_49 of sanity-quota, the Bash could fail if the data to be processsed by "eval" is big under PPC64le, decrease the data size to be suitable for different Arches. Test-Parameters: trivial testlist=sanity-quota env=SLOW=yes,ONLY=49,ONLY_REPEAT=10 clientdistro=el8.9 clientarch=ppc64le serverdistro=el8.8 Signed-off-by: Hongchao Zhang Change-Id: I6fef841211662c3518caf97835598dc26beaea1f Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56820 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index b7e72df..c374d4c 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -4029,15 +4029,15 @@ test_get_allquota() { qid_cnt=$((qid_cnt - end_qid + file_cnt)) [ $qid_cnt -le 0 ] && error "quota ID count is wrong" + cancel_lru_locks osc + sync; sync_all_data || true + sleep 5 + cnt=$($LFS quota -a -s $start_qid -e $end_qid -u $MOUNT | wc -l) [ $cnt -ge $((qid_cnt + 2)) ] || error "failed to get all usr quota" cnt=$($LFS quota -a -s $start_qid -e $end_qid -g $MOUNT | wc -l) [ $cnt -ge $((qid_cnt + 2)) ] || error "failed to get all grp quota" - cancel_lru_locks osc - sync; sync_all_data || true - sleep 5 - eval $($LFS quota -a -s $start_qid -e $end_qid -u $MOUNT | awk 'NR > 2 {printf("u_blimits[%d]=%d;u_ilimits[%d]=%d; \ u_busage[%d]=%d;u_iusage[%d]=%d;", \ @@ -4130,7 +4130,7 @@ test_49() local u_ilimit=10240 local g_blimit=204800 local g_ilimit=20480 - local count=10 + local step=1000 setup_quota_test || error "setup quota failed with $?" stack_trap cleanup_quota_test EXIT @@ -4143,7 +4143,7 @@ test_49() echo "setquota for users and groups" #define OBD_FAIL_QUOTA_NOSYNC 0xA09 do_facet mds1 $LCTL set_param fail_loc=0xa09 - for i in $(seq $total_file_cnt); do + for ((i = 1; i <= total_file_cnt; i++)); do $LFS setquota -u $i -B ${u_blimit} -I ${u_ilimit} $MOUNT || error "failed to setquota for usr $i" $LFS setquota -g $i -B ${g_blimit} -I ${g_ilimit} $MOUNT || @@ -4161,18 +4161,17 @@ test_49() $LFS quota -a -g $MOUNT | tail -n 100 echo "get all grp quota: $total_file_cnt / $((SECONDS - start)) seconds" - while true; do - test_get_allquota $total_file_cnt $count $((count + 5000)) \ + for ((count = 10; count < total_file_cnt; count += step)); do + test_get_allquota $total_file_cnt $count $((count + step)) \ $u_blimit $u_ilimit $g_blimit $g_ilimit - test_get_allquota $total_file_cnt $count $((count + 5000)) \ + test_get_allquota $total_file_cnt $count $((count + step)) \ $u_blimit $u_ilimit $g_blimit $g_ilimit - count=$((count + 5000)) - [ $count -gt $total_file_cnt ] && break + count=$((count + step)) done; do_facet mds1 $LCTL set_param fail_loc=0xa08 - for i in $(seq $total_file_cnt); do + for ((i = 1; i <= $total_file_cnt; i++)); do $LFS setquota -u $i --delete $MOUNT $LFS setquota -g $i --delete $MOUNT done -- 1.8.3.1