Whamcloud - gitweb
b=20953 sanity-quota test 30 fixes
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Mon, 19 Apr 2010 08:48:11 +0000 (12:48 +0400)
committerJohann Lombardi <johann@sun.com>
Fri, 30 Apr 2010 21:28:28 +0000 (23:28 +0200)
i=Yong Fan

lustre/tests/sanity-quota.sh

index ee4966a..5e36c62 100644 (file)
@@ -2122,20 +2122,35 @@ test_30()
         local TESTFILE="$DIR/$tdir/$tfile"
         local GRACE=10
 
+        set_blk_tunesz 512
+        set_blk_unitsz 1024
+
         mkdir -p $DIR/$tdir
         chmod 0777 $DIR/$tdir
 
+        $LFS setstripe $TESTFILE -i 0 -c 1
+        chown $TSTUSR.$TSTUSR $TESTFILE
+
         $LFS setquota -t -u --block-grace $GRACE --inode-grace $MAX_IQ_TIME $DIR
         $LFS setquota -u $TSTUSR -b $LIMIT -B 0 -i 0 -I 0 $DIR
         $RUNAS dd if=/dev/zero of=$TESTFILE bs=1024 count=$((LIMIT * 2)) || true
         cancel_lru_locks osc
         sleep $GRACE
         $LFS setquota -u $TSTUSR -B 0 $DIR
+        # over-quota flag has not yet settled since we do not trigger async events
+        # based on grace time period expiration
         $SHOW_QUOTA_USER
-        $RUNAS dd if=/dev/zero of=$TESTFILE oflag=append bs=1024 count=1 && error "grace times were reset"
+        $RUNAS dd if=/dev/zero of=$TESTFILE conv=notrunc oflag=append bs=1048576 count=1 || true
+        cancel_lru_locks osc
+        # now over-quota flag should be settled and further writes should fail
+        $SHOW_QUOTA_USER
+        $RUNAS dd if=/dev/zero of=$TESTFILE conv=notrunc oflag=append bs=1048576 count=1 && error "grace times were reset"
         rm -f $TESTFILE
         resetquota -u $TSTUSR
         $LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
+
+        set_blk_unitsz $((128 * 1024))
+        set_blk_tunesz $((128 * 1024 / 2))
 }
 run_test_with_stat 30 "hard limit updates should not reset grace times ================"