summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-05-07 15:46:28 +0800
committerDavid Sterba <dsterba@suse.com>2018-06-07 16:37:32 +0200
commit0ef679720532fe97588c9d77f5a5f981b0150fe3 (patch)
treed1b3e59c29064f74dd3bcd762906db3f1ada547a /tests
parent9e061cae1971ed1933f171378e46a5e52134afbd (diff)
btrfs-progs: tests: Add test case for dump-tree on heavily corrupted leaf
Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xzbin0 -> 21964 bytes
-rwxr-xr-xtests/misc-tests/032-bad-item-ptr/test.sh17
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz b/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz
new file mode 100644
index 00000000..7cf2e89f
--- /dev/null
+++ b/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz
Binary files differ
diff --git a/tests/misc-tests/032-bad-item-ptr/test.sh b/tests/misc-tests/032-bad-item-ptr/test.sh
new file mode 100755
index 00000000..cfbfe1a5
--- /dev/null
+++ b/tests/misc-tests/032-bad-item-ptr/test.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Verify that btrfs inspect dump-tree won't segfault on heavily corrupted
+# tree leaf
+# Issue: #128
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+
+check_image() {
+ run_check "$TOP/btrfs" inspect-internal dump-tree "$1"
+ run_mustfail "btrfs check failed to detect such corruption" \
+ "$TOP/btrfs" check "$1"
+}
+
+check_all_images