summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2017-11-10 09:34:17 +0800
committerDavid Sterba <dsterba@suse.com>2018-01-03 17:09:42 +0100
commit4e4c5d354912b2e8adaf4c64bfee00b1bdc420af (patch)
tree0112379bb01b7492100bf70d716ec4a8c6c3e522 /tests
parent5ee1956b892a27bc347df3c84ea3fa241567f0cb (diff)
btrfs-progs: test/fsck: Introduce test images containing tree reloc tree
Reloc tree is a special tree with very short life span. It acts as a special snapshot for any tree, with related nodes/leaves or EXTENT_DATA modified to point to new position. Considering the short life span and its special purpose, it should be quite reasonable to keep them as both corner case for fsck and educational dump for anyone interested in relocation. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/fsck-tests/027-tree-reloc-tree/test.sh19
-rw-r--r--tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_data_reloc.img.xzbin0 -> 2112 bytes
-rw-r--r--tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_fs_tree.img.xzbin0 -> 2424 bytes
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/fsck-tests/027-tree-reloc-tree/test.sh b/tests/fsck-tests/027-tree-reloc-tree/test.sh
new file mode 100755
index 00000000..afad1e8d
--- /dev/null
+++ b/tests/fsck-tests/027-tree-reloc-tree/test.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Make sure btrfs check won't report any false alerts for valid image with
+# reloc tree.
+#
+# Also due to the short life span of reloc tree, save the as dump example for
+# later usage.
+
+source "$TOP/tests/common"
+
+check_prereq btrfs
+
+check_image() {
+ local image
+
+ image=$1
+ run_check "$TOP/btrfs" check "$image"
+}
+
+check_all_images
diff --git a/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_data_reloc.img.xz b/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_data_reloc.img.xz
new file mode 100644
index 00000000..66d8bde6
--- /dev/null
+++ b/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_data_reloc.img.xz
Binary files differ
diff --git a/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_fs_tree.img.xz b/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_fs_tree.img.xz
new file mode 100644
index 00000000..22af324b
--- /dev/null
+++ b/tests/fsck-tests/027-tree-reloc-tree/tree_reloc_for_fs_tree.img.xz
Binary files differ