[btrfs-progs] Btrfs quotas testing
Hemanth Kumar
hemanthkumar51 at gmail.com
Fri Feb 15 06:45:24 CST 2013
Signed-off-by: Hemanth Kumar <hemanthkumar51 at gmail.com>
---
quotas.sh | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 quotas.sh
diff --git a/quotas.sh b/quotas.sh
new file mode 100644
index 0000000..7e64578
--- /dev/null
+++ b/quotas.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+# Btrfs quotas test case
+# Hi all,
+# This is shell script to test the quotas feature of Btrfs
+# I created Btrfs filesystem on a new
+# partition, then activated quota management ('btrfs quota enable'), and
+# created a few subvolumes.
+# I have lmited the quota to 2mb and tried filling it
+# its working as expected
+
+
+cleanup()
+{
+ btrfs subvolume delete $TEST_DIR/vol1
+ btrfs subvolume disable $TEST_DIR
+}
+
+#trap "_cleanup ; exit \$status" 0 1 2 3 15
+
+btrfs quota enable $TEST_DIR
+echo "quota enabled on $TEST_DEV"
+btrfs subvolume create $TEST_DIR/vol1
+echo "vol1 created"
+btrfs qgroup show $TEST_DIR
+btrfs qgroup limit 2m $TEST_DIR/vol1
+echo "qgroup limited to 2mb"
+dd if=$TEST_DEV of=$TEST_DIR/vol1/file1 bs=3M count=1
+echo "tried to write 3m worth data"
+cleanup
+exit
--
1.8.1.2
More information about the xfs
mailing list