linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] New btrfsck test framework
@ 2014-12-25  1:32 Qu Wenruo
  2014-12-25  1:32 ` [PATCH 1/5] btrfs-progs: New btrfsck test infrastructure Qu Wenruo
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Qu Wenruo @ 2014-12-25  1:32 UTC (permalink / raw)
  To: linux-btrfs

This patchset introduce the new btrfsck test framework.
The main changes are:
1) File layout change
The new file layout is based on dir.
Every corruption type has its own dir, and it can contain several
different images for different cases, like bad root items type, it has
the default case and the skinny metadata case.

2) Image format
The framework support 2 image format.
One is the original btrfs-image dump.
The other one is custom script.

Any other type will need a small script to extract the image and use the
framework routine or other codes to check it.

3) New test case for leaf-corruption recovery
Added a new type dir for leaf-corruption, and add verification codes to
check the recovered data.

Minor changes include:
1) fsck-test.sh can be called from anywhere
Now fsck-test.sh can determine the btrfs-progs top dir according to its
path, no need to be called from btrfs-progs dir.

2) default value and auto-detect for environment variant
Now fsck-test.sh can accept environment variants, no need to edit the
script anymore.
And if TEST_MNT is not set, it will use <btrfs-progs>/tests/mnt as
default mount point.

3) better prompt for needed environment variant/privilege
When some case is not run due to missing environment variant or
privilege, fsck-test.sh will prompt it.

Qu Wenruo (5):
  btrfs-progs: New btrfsck test infrastructure
  btrfs-progs: Move btrfs-image dump to corresponding dir
  btrfs-progs: Move bad root items test cases to its corresponding dir
  btrfs-progs: Move leaf-corruption no extent data case and add    
    verification script
  btrfs-progs: Move extent tree rebuild test to its dir

 tests/common                                       |  49 +++++++++
 tests/fsck-tests.sh                                | 122 +++++++--------------
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.tar.xz}                           | Bin
 .../skinny_case.tar.xz}                            | Bin
 tests/fsck-tests/006-bad-root-items/test.sh        |  15 +++
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../default_case.img}                              | Bin
 .../no_data_extent.tar.xz}                         | Bin
 tests/fsck-tests/012-leaf-corruption/test.sh       | 119 ++++++++++++++++++++
 tests/fsck-tests/013-extent-tree-rebuild/test.sh   |  47 ++++++++
 18 files changed, 272 insertions(+), 80 deletions(-)
 create mode 100644 tests/common
 mode change 100644 => 100755 tests/fsck-tests.sh
 rename tests/fsck-tests/{001-bad-file-extent-bytenr.img => 001-bad-file-extent-bytenr/default_case.img} (100%)
 rename tests/fsck-tests/{002-bad-transid.img => 002-bad-transid/default_case.img} (100%)
 rename tests/fsck-tests/{003-shift-offsets.img => 003-shift-offsets/default_case.img} (100%)
 rename tests/fsck-tests/{004-no-dir-index.img => 004-no-dir-index/default_case.img} (100%)
 rename tests/fsck-tests/{005-bad-item-offset.img => 005-bad-item-offset/default_case.img} (100%)
 rename tests/fsck-tests/{006-bad_root_items_fs.tar.xz => 006-bad-root-items/default_case.tar.xz} (100%)
 rename tests/fsck-tests/{007-bad_root_items_fs_skinny.tar.xz => 006-bad-root-items/skinny_case.tar.xz} (100%)
 create mode 100755 tests/fsck-tests/006-bad-root-items/test.sh
 rename tests/fsck-tests/{008-bad-offset-snapshots.img => 007-bad-offset-snapshots/default_case.img} (100%)
 rename tests/fsck-tests/{009-bad-dir-index-name.img => 008-bad-dir-index-name/default_case.img} (100%)
 rename tests/fsck-tests/{010-no-dir-item-or-index.img => 009-no-dir-item-or-index/default_case.img} (100%)
 rename tests/fsck-tests/{011-no-rootdir-inode-item.img => 010-no-rootdir-inode-item/default_case.img} (100%)
 rename tests/fsck-tests/{012-no-inode-item.img => 011-no-inode-item/default_case.img} (100%)
 rename tests/fsck-tests/{013-leaf-corruption-no-extent-data.tar.xz => 012-leaf-corruption/no_data_extent.tar.xz} (100%)
 create mode 100755 tests/fsck-tests/012-leaf-corruption/test.sh
 create mode 100755 tests/fsck-tests/013-extent-tree-rebuild/test.sh

-- 
2.2.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-01-19 18:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-25  1:32 [PATCH 0/5] New btrfsck test framework Qu Wenruo
2014-12-25  1:32 ` [PATCH 1/5] btrfs-progs: New btrfsck test infrastructure Qu Wenruo
2014-12-25  1:32 ` [PATCH 2/5] btrfs-progs: Move btrfs-image dump to corresponding dir Qu Wenruo
2014-12-25  1:32 ` [PATCH 3/5] btrfs-progs: Move bad root items test cases to its " Qu Wenruo
2014-12-25  1:32 ` [PATCH 4/5] btrfs-progs: Move leaf-corruption no extent data case and add verification script Qu Wenruo
2014-12-25  1:32 ` [PATCH 5/5] btrfs-progs: Move extent tree rebuild test to its dir Qu Wenruo
2015-01-14 17:25 ` [PATCH 1/2] btrfs-progs: tests, add support for running commands under root David Sterba
2015-01-15  0:33   ` Qu Wenruo
2015-01-19 18:07     ` David Sterba
2015-01-14 17:25 ` [PATCH 2/2] btrfs-progs: teests, use the root helper in 012 David Sterba
2015-01-14 17:43 ` [PATCH 0/5] New btrfsck test framework David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).