summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSu Yue <suy.fnst@cn.fujitsu.com>2017-07-14 15:47:46 +0800
committerDavid Sterba <dsterba@suse.com>2017-08-24 19:07:58 +0200
commit515ea7dc2f28794b03b64bc962da79935a29b457 (patch)
treecd451cbd62aa48b986e70c7067ef890043f34ab3 /tests
parent7f3ba48000997c5a11e5ab8d3438d2e10c319702 (diff)
btrfs-progs: fsck-test: case for corrupted dir item name
In this test case, all name in dir_item, dir_index, inode_ref are corrupted to another one. btrfs check should report errors about the corrupted dir_item but btrfs can't repair the case now. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/fsck-tests/026-bad-dir-item-name/default_case.img.xzbin0 -> 1924 bytes
-rwxr-xr-xtests/fsck-tests/026-bad-dir-item-name/test.sh13
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz b/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz
new file mode 100644
index 00000000..27e8553f
--- /dev/null
+++ b/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz
Binary files differ
diff --git a/tests/fsck-tests/026-bad-dir-item-name/test.sh b/tests/fsck-tests/026-bad-dir-item-name/test.sh
new file mode 100755
index 00000000..a1077a8d
--- /dev/null
+++ b/tests/fsck-tests/026-bad-dir-item-name/test.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# confirm whether check detects name and hash mismatch in dir_item
+
+source "$TOP/tests/common"
+
+check_prereq btrfs
+
+image=$(extract_image "./default_case.img.xz")
+
+run_mustfail "dir_item hash mismatch not found" "$TOP/btrfs" check "$image"
+
+rm -f "$image"