diff mbox series

[3/3] btrfs-progs: misc-tests: add test case to verify btrfstune --convert-to-free-space-tree option

Message ID b97e23c9f3e40480e48d3547fd3d365d43f81208.1682988988.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: add the ability to enable fst for btrfstune | expand

Commit Message

Qu Wenruo May 2, 2023, 1:01 a.m. UTC
The new test case would create a fs without free space tree, then
popluate it, convert to free-space-tree feature, and make sure
everything is fine.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 .../057-btrfstune-free-space-tree/test.sh     | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100755 tests/misc-tests/057-btrfstune-free-space-tree/test.sh
diff mbox series

Patch

diff --git a/tests/misc-tests/057-btrfstune-free-space-tree/test.sh b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh
new file mode 100755
index 000000000000..c69f99cfbd38
--- /dev/null
+++ b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh
@@ -0,0 +1,21 @@ 
+#!/bin/bash
+# test btrfstune --convert-to-free-space-tree option
+
+source "$TEST_TOP/common" || exit
+source "$TEST_TOP/common.convert" || exit
+
+check_prereq mkfs.btrfs
+check_prereq btrfstune
+check_prereq btrfs
+
+setup_root_helper
+prepare_test_dev
+
+run_check_mkfs_test_dev -O ^free-space-tree
+run_check_mount_test_dev
+populate_fs
+run_check_umount_test_dev
+
+run_check $SUDO_HELPER "$TOP/btrfstune" --convert-to-free-space-tree $TEST_DEV
+
+run_check "$TOP/btrfs" check "$TEST_DEV"