btrfs-progs: tests: Introduce fsck-tests/018-leaf-crossing-stripes
authorZhao Lei <zhaolei@cn.fujitsu.com>
Wed, 23 Sep 2015 07:19:05 +0000 (15:19 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Oct 2015 09:48:24 +0000 (11:48 +0200)
To test if fsck can check detec "leaf crossing stripes".

This function was introduced from patch titled:
btrfs-progs: fsck: Check if a metadata tree block crossing stripe boundary

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
[renamed and other minor changes]
Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/018-leaf-crossing-stripes/default_case.raw.xz [new file with mode: 0644]
tests/fsck-tests/018-leaf-crossing-stripes/test.sh [new file with mode: 0755]

diff --git a/tests/fsck-tests/018-leaf-crossing-stripes/default_case.raw.xz b/tests/fsck-tests/018-leaf-crossing-stripes/default_case.raw.xz
new file mode 100644 (file)
index 0000000..60eb2f9
Binary files /dev/null and b/tests/fsck-tests/018-leaf-crossing-stripes/default_case.raw.xz differ
diff --git a/tests/fsck-tests/018-leaf-crossing-stripes/test.sh b/tests/fsck-tests/018-leaf-crossing-stripes/test.sh
new file mode 100755 (executable)
index 0000000..c453ab5
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+source $TOP/tests/common
+
+check_prereq btrfs
+
+image=$(extract_image "./default_case.raw.xz")
+run_check_stdout $TOP/btrfs check "$image" 2>&1 |
+       grep -q "crossing stripe boundary" ||
+       _fail "no expected error message in the output"
+
+rm -f "$image"