2016-12-15 04:33:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# simple test of qgroup show --sync option
|
|
|
|
|
2018-02-08 06:34:19 +00:00
|
|
|
source "$TEST_TOP/common"
|
2016-12-15 04:33:05 +00:00
|
|
|
|
|
|
|
check_prereq mkfs.btrfs
|
|
|
|
check_prereq btrfs
|
|
|
|
|
|
|
|
setup_root_helper
|
|
|
|
prepare_test_dev 1g
|
|
|
|
|
2019-06-05 17:09:38 +00:00
|
|
|
run_check_mkfs_test_dev
|
2016-12-15 04:33:05 +00:00
|
|
|
run_check_mount_test_dev
|
|
|
|
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/Sub"
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" quota enable "$TEST_MNT/Sub"
|
|
|
|
|
|
|
|
for opt in '' '--' '--sync'; do
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" qgroup limit 300M "$TEST_MNT/Sub"
|
|
|
|
run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/Sub/file" bs=1M count=200
|
|
|
|
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" qgroup show -re $opt "$TEST_MNT/Sub"
|
|
|
|
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" qgroup limit none "$TEST_MNT/Sub"
|
|
|
|
run_check $SUDO_HELPER rm -f "$TEST_MNT/Sub/file"
|
|
|
|
run_check "$TOP/btrfs" filesystem sync "$TEST_MNT/Sub"
|
|
|
|
done
|
|
|
|
|
|
|
|
run_check_umount_test_dev
|