btrfs: Add new test for setting the chunk size. master
authorStefan Roesch <shr@fb.com>
Fri, 3 Dec 2021 21:55:56 +0000 (13:55 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 5 Dec 2021 14:53:54 +0000 (22:53 +0800)
commitd489644a5ad825e65da0812e8ea7da3a36a708f1
tree61d5b7ad614694fc30d4e21672a987672823f903
parent25cc5bac2f97a7fbdb5f27b02eba4d9e9f44a5c7
btrfs: Add new test for setting the chunk size.

Add new testcase for testing the new btrfs sysfs knob to change the
chunk size. The new knob uses /sys/fs/btrfs/<UUID>/allocation/<block
type>/chunk_size.

The test case implements three different cases:
- Test allocation with the default chunk size
- Test allocation after increasing the chunk size
- Test allocation when the free space is smaller than the chunk size.

Note: this test needs to force the allocation of space. It uses the
/sys/fs/btrfs/<UUID>/allocation/<block type>/force_chunk_alloc knob.

Testing:
The test has been run with volumes of different sizes.

Signed-off-by: Stefan Roesch <shr@fb.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/btrfs/253 [new file with mode: 0755]
tests/btrfs/253.out [new file with mode: 0644]