summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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