# test basic quota performance b=21696
test_0() {
- local MB=100 # 100M
+ local MB=100 # MB
[ "$SLOW" = "no" ] && MB=10
local free_space=$(lfs_df | grep "summary" | awk '{print $4}')
# test block hardlimit
test_1a() {
- local limit=10 # 10M
+ local limit=10 # MB
local testfile="$DIR/$tdir/$tfile-0"
setup_quota_test || error "setup quota failed with $?"
run_test 1a "Block hard limit (normal use and out of quota)"
test_1b() {
- local limit=10 # 10M
- local global_limit=20 # 100M
+ local limit=10 # MB
+ local global_limit=20 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool="qpool1"
run_test 1b "Quota pools: Block hard limit (normal use and out of quota)"
test_1c() {
- local global_limit=20 # 100M
+ local global_limit=20 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool1="qpool1"
local qpool2="qpool2"
run_test 1c "Quota pools: check 3 pools with hardlimit only for global"
test_1d() {
- local limit1=10 # 10M
- local limit2=12 # 12M
- local global_limit=20 # 100M
+ local limit1=10 # MB
+ local limit2=12 # MB
+ local global_limit=20 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool1="qpool1"
local qpool2="qpool2"
run_test 1d "Quota pools: check block hardlimit on different pools"
test_1e() {
- local limit1=10 # 10M
- local global_limit=200 # 200M
+ local limit1=10 # MB
+ local global_limit=53000000 # MB
local testfile="$DIR/$tdir/$tfile-0"
local testfile2="$DIR/$tdir/$tfile-1"
local qpool1="qpool1"
run_test 1e "Quota pools: global pool high block limit vs quota pool with small"
test_1f() {
- local global_limit=200 # 200M
- local limit1=10 # 10M
+ local global_limit=200 # MB
+ local limit1=10 # MB
local TESTDIR="$DIR/$tdir/"
local testfile="$TESTDIR/$tfile-0"
local qpool1="qpool1"
run_test 1f "Quota pools: correct qunit after removing/adding OST"
test_1g() {
- local limit=20 # 20M
- local global_limit=40 # 40M
+ local limit=20 # MB
+ local global_limit=40 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool="qpool1"
local mdmb_param="osc.*.max_dirty_mb"
run_test 1g "Quota pools: Block hard limit with wide striping"
test_1h() {
- local limit=10 # 10M
+ local limit=10 # MB
local testfile="$DIR/$tdir/$tfile-0"
check_set_fallocate_or_skip
# block soft limit
test_3a() {
- local grace=20 # 20s
+ local grace=20 # seconds
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
grace=60
fi
run_test 3a "Block soft limit (start timer, timer goes off, stop timer)"
test_3b() {
- local grace=20 # 20s
+ local grace=20 # seconds
local qpool="qpool1"
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
grace=60
run_test 3b "Quota pools: Block soft limit (start timer, expires, stop timer)"
test_3c() {
- local grace=20 # 20s
+ local grace=20 # seconds
local qpool="qpool1"
local qpool2="qpool2"
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
# chown & chgrp (chown & chgrp successfully even out of block/file quota)
test_5() {
- local BLIMIT=10 # 10M
- local ILIMIT=10 # 10 inodes
+ local BLIMIT=10 # MB
+ local ILIMIT=10 # inodes
setup_quota_test || error "setup quota failed with $?"
trap cleanup_quota_test EXIT
# test dropping acquire request on master
test_6() {
- local LIMIT=3 # 3M
+ local LIMIT=3 # MB
# Clear dmesg so watchdog is not triggered by previous
# test output
# quota reintegration (global index)
test_7a() {
local TESTFILE=$DIR/$tdir/$tfile
- local LIMIT=20 # 20M
+ local LIMIT=20 # MB
[ "$SLOW" = "no" ] && LIMIT=5
# quota reintegration (slave index)
test_7b() {
- local LIMIT="100G"
+ local limit=100000 # MB
local TESTFILE=$DIR/$tdir/$tfile
setup_quota_test || error "setup quota failed with $?"
lustre_fail mds 0xa02
set_ost_qtype $QTYPE || error "enable ost quota failed"
- $LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR ||
+ $LFS setquota -u $TSTUSR -b 0 -B ${limit}M -i 0 -I 0 $DIR ||
error "set quota failed"
# ignore the write error
# quota reintegration (restart mds during reintegration)
test_7c() {
- local LIMIT=20 # 20M
+ local LIMIT=20 # MB
local TESTFILE=$DIR/$tdir/$tfile
[ "$SLOW" = "no" ] && LIMIT=5
test_7d(){
local TESTFILE=$DIR/$tdir/$tfile
local TESTFILE1="$DIR/$tdir/$tfile"-1
- local limit=20 #20M
+ local limit=20 # MB
setup_quota_test || error "setup quota failed with $?"
trap cleanup_quota_test EXIT
skip "requires zpool with active userobj_accounting"
}
- local ilimit=$((1024 * 2)) # 2k inodes
+ local ilimit=$((1024 * 2)) # inodes
local TESTFILE=$DIR/${tdir}-1/$tfile
setup_quota_test || error "setup quota failed with $?"
test_12a() {
[ "$OSTCOUNT" -lt "2" ] && skip "needs >= 2 OSTs"
- local blimit=22 # 22M
+ local blimit=22 # MB
local blk_cnt=$((blimit - 5))
local TESTFILE0="$DIR/$tdir/$tfile"-0
local TESTFILE1="$DIR/$tdir/$tfile"-1
set_ost_qtype "u" || error "enable ost quota failed"
quota_show_check b u $TSTUSR
- $LFS setquota -u $TSTUSR -b 0 -B "$blimit"M -i 0 -I 0 $DIR ||
+ $LFS setquota -u $TSTUSR -b 0 -B ${blimit}M -i 0 -I 0 $DIR ||
error "set quota failed"
$LFS setstripe $TESTFILE0 -c 1 -i 0 || error "setstripe $TESTFILE0 failed"
test_12b() {
[ "$MDSCOUNT" -lt "2" ] && skip "needs >= 2 MDTs"
- local ilimit=$((1024 * 2)) # 2k inodes
+ local ilimit=$((1024 * 2)) # inodes
local TESTFILE0=$DIR/$tdir/$tfile
local TESTFILE1=$DIR/${tdir}-1/$tfile
test_18_sub () {
local io_type=$1
- local blimit="200m" # 200M
+ local blimit=200 # MB
local TESTFILE="$DIR/$tdir/$tfile"
setup_quota_test || error "setup quota failed with $?"
set_ost_qtype "u" || error "enable ost quota failed"
log "User quota (limit: $blimit)"
- $LFS setquota -u $TSTUSR -b 0 -B $blimit -i 0 -I 0 $MOUNT ||
+ $LFS setquota -u $TSTUSR -b 0 -B ${blimit}M -i 0 -I 0 $MOUNT ||
error "set quota failed"
quota_show_check b u $TSTUSR
run_test 18 "MDS failover while writing, no watchdog triggered (b14840)"
test_19() {
- local blimit=5 # 5M
+ local blimit=5 # MB
local TESTFILE=$DIR/$tdir/$tfile
setup_quota_test || error "setup quota failed with $?"
chown $TSTUSR.$TSTUSR $TESTFILE || error "chown $TESTFILE failed"
echo "Set user quota (limit: ${blimit}M)"
- $LFS setquota -u $TSTUSR -b 0 -B "$blimit"M -i 0 -I 0 $MOUNT ||
+ $LFS setquota -u $TSTUSR -b 0 -B ${blimit}M -i 0 -I 0 $MOUNT ||
error "set user quota failed"
quota_show_check b u $TSTUSR
echo "Update quota limits"
- $LFS setquota -u $TSTUSR -b 0 -B "$blimit"M -i 0 -I 0 $MOUNT ||
+ $LFS setquota -u $TSTUSR -b 0 -B ${blimit}M -i 0 -I 0 $MOUNT ||
error "set group quota failed"
quota_show_check b u $TSTUSR
run_test 23 "Quota should be honored with directIO (b16125)"
test_24() {
- local blimit=5 # 5M
+ local blimit=5 # MB
local TESTFILE="$DIR/$tdir/$tfile"
setup_quota_test || error "setup quota failed with $?"
run_test 27d "lfs setquota should support fraction block limit"
test_30() {
- local LIMIT=4 # 4MB
+ local LIMIT=4 # MB
local TESTFILE="$DIR/$tdir/$tfile"
local GRACE=10
# basic usage tracking for user & group
test_33() {
- local INODES=10 # 10 files
- local BLK_CNT=2 # of 2M each
+ local INODES=10 # files
+ local BLK_CNT=2 # MB each
local TOTAL_BLKS=$((INODES * BLK_CNT * 1024))
setup_quota_test || error "setup quota failed with $?"
# usage transfer test for user & group & project
test_34() {
- local BLK_CNT=2 # 2MB
+ local BLK_CNT=2 # MB
local project_supported="no"
is_project_quota_supported && project_supported="yes"
# usage is still accessible across restart
test_35() {
- local BLK_CNT=2 # 2 MB
+ local BLK_CNT=2 # MB
setup_quota_test || error "setup quota failed with $?"
trap cleanup_quota_test EXIT
run_test 64 "lfs project on symlink files should fail"
test_65() {
- local SIZE=10 #10M
+ local SIZE=10 # MB
local TESTFILE="$DIR/$tdir/$tfile-0"
setup_quota_test || error "setup quota failed with $?"
}
test_67() {
- local limit=20 # 20M
+ local limit=20 # MB
local testfile="$DIR/$tdir/$tfile-0"
local testfile2="$DIR/$tdir/$tfile-1"
local testfile3="$DIR/$tdir/$tfile-2"
test_69()
{
- local global_limit=200 # 200M
- local limit=10 # 10M
+ local global_limit=200 # MB
+ local limit=10 # MB
local testfile="$DIR/$tdir/$tfile-0"
local dom0="$DIR/$tdir/dom0"
local qpool="qpool1"
test_70()
{
local qpool="qpool1"
- local limit=20
+ local limit=20 # MB
local err=0
local bhard
test_71a()
{
- local limit=10 # 10M
- local global_limit=100 # 100M
+ local limit=10 # MB
+ local global_limit=100 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool="qpool1"
local qpool2="qpool2"
test_71b()
{
- local global_limit=1000 # 1G
- local limit1=160 # 160M
- local limit2=10 # 10M
+ local global_limit=1000 # MB
+ local limit1=160 # MB
+ local limit2=10 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool="qpool1"
local qpool2="qpool2"
test_72()
{
- local limit=10 # 10M
- local global_limit=50 # 50M
+ local limit=10 # MB
+ local global_limit=50 # MB
local testfile="$DIR/$tdir/$tfile-0"
local qpool="qpool1"