path: root/tests
diff options
authorTsutomu Itoh <>2016-12-15 13:33:05 +0900
committerDavid Sterba <>2017-01-27 12:20:42 +0100
commit55e3a601951302641c4fd5e148f46449acc449c2 (patch)
tree319d6226bc8e37a12950d0ec3e962f7cc0afa60a /tests
parent5c87a1b92c249da0406226e1e8540dc383165ced (diff)
btrfs-progs: tests: add test for --sync option of qgroup show
Simple test script for the following patch. btrfs-progs: qgroup: add sync option to 'qgroup show' Signed-off-by: Tsutomu Itoh <> Signed-off-by: David Sterba <>
Diffstat (limited to 'tests')
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/cli-tests/006-qgroup-show-sync/ b/tests/cli-tests/006-qgroup-show-sync/
new file mode 100755
index 00000000..30d0a9a1
--- /dev/null
+++ b/tests/cli-tests/006-qgroup-show-sync/
@@ -0,0 +1,30 @@
+# simple test of qgroup show --sync option
+source "$TOP/tests/common"
+check_prereq mkfs.btrfs
+check_prereq btrfs
+prepare_test_dev 1g
+run_check "$TOP/mkfs.btrfs" -f "$IMAGE"
+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"