From 2582a0a1d240b4913d3c823b559c767cfbc6e086 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Mon, 19 Apr 2010 16:29:30 -0700 Subject: [PATCH] b=20953 sanity-quota test 30 fixes i=Yong Fan --- lustre/tests/sanity-quota.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 7d362c3..0c30d30 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -2099,21 +2099,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 5 + 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 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 - output=`$SHOW_QUOTA_USER | grep $MOUNT | awk '{ print $5 }' | tr -d s` - [ "$output" -le "$((GRACE - 5))" ] || error "grace times were reset or unexpectedly high latency" + $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 ================" -- 1.8.3.1