diff mbox series

[4/4] btrfs-progs: tests/fsck: enhance invalid extent item geneartion test cases

Message ID 20200810072747.64439-5-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: check: add the ability to repair extent item generation corruption | expand

Commit Message

Qu Wenruo Aug. 10, 2020, 7:27 a.m. UTC
This patch will:
- Add a new test image for fsck/044
  This new image has a corrupted extent item generation for tree block.
  This image can expose a bug in original mode, which can't detect the
  problem.
  This image also utilize the tree block generation detection code,
  which the existing image doesn't.

- Rename the existing image
  To reflect the fact that the existing one is only for data extent.

- Remove the test.sh
  So that the generic path will test both detection and repair.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 ...xz => bad_extent_item_gen_for_data.img.xz} | Bin
 .../bad_extent_item_gen_for_tree_block.img.xz | Bin 0 -> 1804 bytes
 .../test.sh                                   |  19 ------------------
 3 files changed, 19 deletions(-)
 rename tests/fsck-tests/044-invalid-extent-item-generation/{bad_extent_item_gen.img.xz => bad_extent_item_gen_for_data.img.xz} (100%)
 create mode 100644 tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz
 delete mode 100755 tests/fsck-tests/044-invalid-extent-item-generation/test.sh
diff mbox series

Patch

diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_data.img.xz
similarity index 100%
rename from tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz
rename to tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_data.img.xz
diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz
new file mode 100644
index 0000000000000000000000000000000000000000..8bc4688dea9c952282b7124fc53175fe1ebd9c4f
GIT binary patch
literal 1804
zcmV+n2lM#-H+ooF000E$*0e?f03iVu0001VFXf})3;zbpT>wR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$rg^ITK>E%rs0Lex0A+Ds>_@JV(TACAG0
z_VjGm_3w$?DW}C3Q|VKr3rTxPet5RXXEe4wTC<wn1+7)xX0l#~c7%Jf8=kb->Vm7z
zgbT<c;GBap===Tc^#-NK^V9jn3zJ;m;Y4HTe~Ch(LFlaWrsNt1dHB+%6?@K(`iWk{
uRmzh^`2FUoKmY(Kp+~(ct|%q|0q6~Y7ytlp&AvXd#Ao{g000001X)_>_JX7U

literal 0
HcmV?d00001

diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/test.sh b/tests/fsck-tests/044-invalid-extent-item-generation/test.sh
deleted file mode 100755
index 2b88a3c7b3bb..000000000000
--- a/tests/fsck-tests/044-invalid-extent-item-generation/test.sh
+++ /dev/null
@@ -1,19 +0,0 @@ 
-#!/bin/bash
-#
-# Due to a bug in --init-extent-tree option, we may create bad generation
-# number for data extents.
-#
-# This test case will ensure btrfs check can at least detect such problem,
-# just like kernel tree-checker.
-
-source "$TEST_TOP/common"
-
-check_prereq btrfs
-
-check_image() {
-	run_mustfail \
-		"btrfs check failed to detect invalid extent item generation" \
-		"$TOP/btrfs" check "$1"
-}
-
-check_all_images