Whamcloud - gitweb
LU-2836 quota: improve test_3 & test_6 of s-q
[fs/lustre-release.git] / lustre / tests / sanity-quota.sh
index 7fdeedb..af980c8 100644 (file)
@@ -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