mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 14:13:04 +00:00
btrfs-progs: tests: simple test for subvol show output
Test the recent changes in 'subvol show' that prints quota information. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f0aab17fc0
commit
604ffe8876
36
tests/cli-tests/010-subvol-show-qgroup/test.sh
Executable file
36
tests/cli-tests/010-subvol-show-qgroup/test.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# simple test for 'subvol show' output
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
check_prereq mkfs.btrfs
|
||||
check_prereq btrfs
|
||||
|
||||
setup_root_helper
|
||||
prepare_test_dev
|
||||
|
||||
run_check_mkfs_test_dev
|
||||
run_check_mount_test_dev
|
||||
|
||||
# quotas not enabled, no qgroup associated to subv2
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume create "$TEST_MNT"/subv2
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume show "$TEST_MNT"/subv2
|
||||
|
||||
# enable
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs quota enable "$TEST_MNT"
|
||||
|
||||
# autocreated qgroup
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume create "$TEST_MNT"/subv1
|
||||
rootid=$(run_check_stdout $SUDO_HELPER "$TOP"/btrfs inspect rootid "$TEST_MNT"/subv1)
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs qgroup limit -e 1G "0/$rootid" "$TEST_MNT"
|
||||
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs qgroup show "$TEST_MNT"
|
||||
|
||||
# no limits
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume show "$TEST_MNT"
|
||||
# 1G limit for exclusive
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume show "$TEST_MNT"/subv1
|
||||
# no limits
|
||||
run_check $SUDO_HELPER "$TOP"/btrfs subvolume show "$TEST_MNT"/subv2
|
||||
|
||||
run_check_umount_test_dev
|
Loading…
Reference in New Issue
Block a user