summaryrefslogtreecommitdiff
path: root/tests/btrfs/022
blob: dc88329cb3be53dd80008014ac591182198fa207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2013 Fusion IO.  All Rights Reserved.
#
# FS QA Test No. 022
#
# Test the basic qgroup exceed case
#
. ./common/preamble
_begin_fstest auto qgroup limit

. ./common/filter

_supported_fs btrfs
_require_scratch
_require_qgroup_rescan
_require_btrfs_qgroup_report

# This test requires specific data usage, skip if we have compression enabled
_require_no_compress

#basic exceed limit testing
_limit_test_exceed()
{
	echo "=== limit exceed test ===" >> $seqres.full
	_btrfs subvolume create $SCRATCH_MNT/a
	_btrfs quota enable $SCRATCH_MNT
	subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
	_btrfs qgroup limit 5M 0/$subvolid $SCRATCH_MNT
	_ddt of=$SCRATCH_MNT/a/file bs=10M count=1 >> $seqres.full 2>&1
	[ $? -ne 0 ] || _fail "quota should have limited us"
}
units=`_btrfs_qgroup_units`

_scratch_mkfs > /dev/null 2>&1
_scratch_mount
_limit_test_exceed
_scratch_unmount
_check_scratch_fs

# success, all done
echo "Silence is golden"
status=0
exit