Whamcloud - gitweb
LU-2836 quota: improve test_3 & test_6 of s-q
authorNiu Yawei <yawei.niu@intel.com>
Sun, 4 Nov 2012 02:42:06 +0000 (10:42 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 18 Mar 2013 05:18:46 +0000 (01:18 -0400)
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 <yawei.niu@intel.com>
Change-Id: Ib14a905344eb78cdbd0cd79e3bfd8e50ab21a4d8
Reviewed-on: http://review.whamcloud.com/5539
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
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
 # 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"
        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
 
        # 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
        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))
                        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
 
                sleep 1
        done