From: Niu Yawei Date: Sun, 4 Nov 2012 02:42:06 +0000 (+0800) Subject: LU-2836 quota: improve test_3 & test_6 of s-q X-Git-Tag: 2.3.63~51 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e2f467190ec7bc3c0102f699d22b4891fa7217f1 LU-2836 quota: improve test_3 & test_6 of s-q When approaching quota limit, client turns to sync write, then the tests which assume io can be finished quickly could fail, we need to enlarge the time margin to make sure those tests can pass on slow system. Signed-off-by: Niu Yawei Change-Id: Ib14a905344eb78cdbd0cd79e3bfd8e50ab21a4d8 Reviewed-on: http://review.whamcloud.com/5539 Tested-by: Hudson Reviewed-by: Johann Lombardi Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 7fdeedb..af980c8 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -630,7 +630,7 @@ test_block_soft() { # block soft limit test_3() { local LIMIT=1 # 1MB - local GRACE=10 # 10s + local GRACE=20 # 20s local TESTFILE=$DIR/$tdir/$tfile-0 set_ost_qtype "ug" || error "enable ost quota failed" @@ -924,13 +924,24 @@ test_6() { # write should continue & succeed local count=0 + local o_size=$(stat -c %s $TESTFILE) + local c_size while [ true ]; do if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi - if [ $count -ge 120 ]; then + if [ $count -ge 240 ]; then quota_error u $TSTUSR "dd not finished in $count secs" fi count=$((count + 1)) - [ $((count % 10)) -eq 0 ] && echo "Waiting $count secs" + if [ $((count % 30)) -eq 0 ]; then + c_size=$(stat -c %s $TESTFILE) + if [ $c_size -eq $o_size ]; then + quota_error u $TSTUSR "file not growed" \ + "in 30 seconds $o_size/$c_size" + else + echo "Waiting $count secs. $o_size/$c_size" + o_size=$c_size + fi + fi sleep 1 done