echo "Wait for unlink objects finished..."
wait_delete_completed
sync_all_data || true
+ reset_quota_settings
}
quota_show_check() {
test_quota_performance $MB
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 0 "Test basic quota performance"
cleanup_quota_test
USED=$(getquota -p $TSTPRJID global curspace)
- [ $USED -ne 0 ] && quota_error p $TSTPRJID \
+ [ $USED -eq 0 ] || quota_error p $TSTPRJID \
"project quota isn't released after deletion"
-
- resetquota -p $TSTPRJID
}
run_test 1 "Block hard limit (normal use and out of quota)"
cleanup_quota_test
USED=$(getquota -p $TSTPRJID global curinodes)
- [ $USED -ne 0 ] && quota_error p $TSTPRJID \
+ [ $USED -eq 0 ] || quota_error p $TSTPRJID \
"project quota isn't released after deletion"
- resetquota -p $TSTPRJID
-
}
run_test 2 "File hard limit (normal use and out of quota)"
error "set user quota failed"
test_block_soft $TESTFILE $GRACE $LIMIT "u"
- resetquota -u $TSTUSR
echo "Group quota (soft limit:$LIMIT MB grace:$GRACE seconds)"
TESTFILE=$DIR/$tdir/$tfile-1
error "set group quota failed"
test_block_soft $TESTFILE $GRACE $LIMIT "g"
- resetquota -g $TSTUSR
if is_project_quota_supported; then
echo "Project quota (soft limit:$LIMIT MB grace:$GRACE sec)"
[ $(facet_fstype $SINGLEMDS) = "zfs" ] && GRACE=20
test_file_soft $TESTFILE $LIMIT $GRACE
- resetquota -u $TSTUSR
echo "Group quota (soft limit:$LIMIT files grace:$GRACE seconds)"
# make sure the system is clean
TESTFILE=$DIR/$tdir/$tfile-1
test_file_soft $TESTFILE $LIMIT $GRACE
- resetquota -g $TSTUSR
if is_project_quota_supported; then
echo "Project quota (soft limit:$LIMIT files grace:$GRACE sec)"
unlinkmany $DIR/$tdir/$tfile-0_ $((ILIMIT + 1)) ||
error "unlinkmany $DIR/$tdir/$tfile-0_ failed"
cleanup_quota_test
-
- resetquota -u $TSTUSR
- resetquota -g $TSTUSR
- resetquota -p $TSTPRJID
}
run_test 5 "Chown & chgrp successfully even out of block/file quota"
done
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 6 "Test dropping acquire request on master"
quota_error u $TSTUSR "write error, but expect success"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 7a "Quota reintegration (global index)"
[ $USED -gt $old_used ] || error "limit on $OSTUUID $USED <= $old_used"
cleanup_quota_test
- resetquota -u $TSTUSR
$SHOW_QUOTA_USER
}
run_test 7b "Quota reintegration (slave index)"
quota_error u $TSTUSR "write success, but expect EDQUOT"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 7c "Quota reintegration (restart mds during reintegration)"
quota_error u $TSTUSR2 "$TSTUSR2 write success, expect EDQUOT"
cleanup_quota_test
- resetquota -u $TSTUSR
- resetquota -u $TSTUSR2
}
run_test 7d "Quota reintegration (Transfer index in multiple bulks)"
rmdir $DIR/${tdir}-1 || error "unlink remote dir failed"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 7e "Quota reintegration (inode limits)"
is_project_quota_supported && change_project -C $DIR/$tdir
cleanup_quota_test
- resetquota -u $TSTUSR
- resetquota -g $TSTUSR
- resetquota -p $TSTPRJID
}
run_test 8 "Run dbench with quota enabled"
$SHOW_QUOTA_GROUP
cleanup_quota_test
- resetquota -u $TSTUSR
- resetquota -g $TSTUSR
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
error "write failure, expect success"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 10 "Test quota for root user"
[ $USED -ge 2 ] || error "Used inodes($USED) is less than 2"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 11 "Chown/chgrp ignores quota"
quota_error a $TSTUSR "rebalancing failed"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 12a "Block quota rebalancing"
rmdir $DIR/${tdir}-1 || error "unlink remote dir failed"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 12b "Inode quota rebalancing"
"Used space(${USED}K) is less than ${BLKS}M"
cleanup_quota_test
- resetquota -u $TSTUSR
}
# DQACQ return recoverable error
"got ${testfile_size}. Verifying file failed!"
fi
cleanup_quota_test
- resetquota -u $TSTUSR
}
# test when mds does failover, the ost still could work well
$SHOW_QUOTA_USER
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 19 "Updating admin limits doesn't zero operational limits(b14790)"
echo "(dd_pid=$DDPID2, time=$count)successful"
cleanup_quota_test
- resetquota -u $TSTUSR
- resetquota -g $TSTUSR
- resetquota -p $TSTPRJID
}
run_test 21 "Setquota while writing & deleting (b16053)"
($SHOW_QUOTA_USER; \
quota_error u $TSTUSR "quota isn't released")
$SHOW_QUOTA_USER
- resetquota -u $TSTUSR
}
test_23() {
$SHOW_QUOTA_USER | grep '*' || error "no matching *"
cleanup_quota_test
- resetquota -u $TSTUSR
}
run_test 24 "lfs draws an asterix when limit is reached (b16646)"
error "grace times were reset"
# cleanup
cleanup_quota_test
- resetquota -u $TSTUSR
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore grace time failed"
}
$LFS quota -v -g $TSTUSR2 $DIR
- resetquota -g $TSTUSR2
cleanup_quota_test
}
run_test 55 "Chgrp should be affected by group quota"
error "root user should succeed"
cleanup_quota_test
- resetquota -g $TSTUSR
}
run_test 60 "Test quota for root with setgid"