Whamcloud - gitweb
b=22546 fix errors in test_18c
authorLanden <zhiyong.tian@oracle.com>
Fri, 17 Dec 2010 06:46:29 +0000 (14:46 +0800)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Fri, 17 Dec 2010 11:47:40 +0000 (14:47 +0300)
i=johann
i=panda

lustre/tests/sanity-quota.sh

index 95e2cbc..6309ad5 100755 (executable)
@@ -1533,7 +1533,7 @@ run_test_with_stat 18a "run for fixing bug14840 ==========="
 test_18bc_sub() {
         type=$1
 
-        LIMIT=$((110 * 1024 )) # 110M
+        LIMIT=$(((100 + $OSTCOUNT * 3) * 1024))
         TESTFILE="$DIR/$tdir/$tfile"
         mkdir -p $DIR/$tdir
 
@@ -1570,8 +1570,8 @@ test_18bc_sub() {
         # check if quotaon successful
         $LFS quota -u $TSTUSR $MOUNT 2>&1 | grep -q "quotas are not enabled"
         if [ $? -eq 0 ]; then
-            error "quotaon failed!"
             rm -rf $TESTFILE
+            error "quotaon failed!"
             return
         fi
 
@@ -1592,17 +1592,17 @@ test_18bc_sub() {
         sync
         cancel_lru_locks mdc
         cancel_lru_locks osc
-
-        testfile_size=$(stat -c %s $TESTFILE)
-        [ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] && \
-            quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
         $SHOW_QUOTA_USER
-        rm -f $TESTFILE
-        sync
 
         resetquota -u $TSTUSR
         set_blk_unitsz $((128 * 1024))
         set_blk_tunesz $((128 * 1024 / 2))
+        testfile_size=$(stat -c %s $TESTFILE)
+        if [ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] ; then
+           rm -f $TESTFILE
+           quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
+        fi
+        rm -f $TESTFILE
 }
 
 # test when mds does failover, the ost still could work well