path: root/tests/misc-tests
diff options
authorDavid Sterba <>2015-10-23 11:43:41 +0200
committerDavid Sterba <>2015-11-02 09:35:06 +0100
commit11f7a8c8deb53a75af8c030563e2b770c190734e (patch)
treeab044c3708b6d446c3a5e71a14d66d0d247c1683 /tests/misc-tests
parenta1126f3673f60814609491d16c863a3a91ec078f (diff)
btrfs-progs: tests: add 010-convert-delete-ext2-subvol
Testcase for "Btrfs-progs: fix btrfs-convert rollback to check ROOT_BACKREF", make sure we don't try a rollback if the ext2_subvol is half-deleted. Signed-off-by: David Sterba <>
Diffstat (limited to 'tests/misc-tests')
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/misc-tests/010-convert-delete-ext2-subvol/ b/tests/misc-tests/010-convert-delete-ext2-subvol/
new file mode 100755
index 00000000..48936479
--- /dev/null
+++ b/tests/misc-tests/010-convert-delete-ext2-subvol/
@@ -0,0 +1,24 @@
+# verify that convert rollback finds the ext2_subvolume intact and fails if it
+# was partially deleted
+source $TOP/tests/common
+check_prereq btrfs-convert
+check_prereq btrfs
+run_check truncate -s 2G "$TEST_DEV"
+run_check mkfs.ext4 -F "$TEST_DEV"
+run_check $TOP/btrfs-convert "$TEST_DEV"
+run_check $TOP/btrfs-debug-tree "$TEST_DEV"
+run_check $SUDO_HELPER $TOP/btrfs subvolume delete -c "$TEST_MNT/ext2_saved"
+run_check $TOP/btrfs-debug-tree "$TEST_DEV"
+run_check_stdout $TOP/btrfs-convert --rollback "$TEST_DEV" |
+ grep -q 'is it deleted' || _fail "unexpected rollback"
+exit 0