Whamcloud - gitweb
tests: create random filesystem, corrupt, e2fsck
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 13 Apr 2012 07:53:39 +0000 (01:53 -0600)
committerAndreas Dilger <andreas.dilger@intel.com>
Fri, 12 Sep 2014 09:13:43 +0000 (03:13 -0600)
commit1854ba8acb57980885f8040c4799cc10ebcad19c
tree11ac82338162b6b0ff5b23c531e2d5a547e57133
parent6a3a1240c731e89b5427b97a3ed7f81db89d675a
tests: create random filesystem, corrupt, e2fsck

The f_random_corruption test enables a random subset of filesystem
features, picks one of the valid filesystem block and inode sizes,
and a random device size and creates a new filesystem with those
parameters.

It is possible to disable the running of the test by setting the
environment variable F_RANDOM_CORRUPTION=skip.  By default the test
script is run only one time, but setting the LOOP_COUNT variable
allows the test to run multiple times.

The resulting filesystem is corrupted with both random data and
by shifting data from one part of the device to another and then
repaired by e2fsck.  In some rare cases the random corruption is
severe enough that the filesystem is not recoverable (e.g. small
filesystem with no backup superblock has bad superblock corruption)
but in most cases "e2fsck -fy" should be able to fix all errors
in some way.

A second e2fsck run is done to verify that all of the errors are
fixed in the first pass, and that the filesystem is free of errors.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
tests/f_random_corruption/name [new file with mode: 0644]
tests/f_random_corruption/script [new file with mode: 0644]