Whamcloud - gitweb
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.
Don't run the random corruption test during RPM builds to avoid
random test failures during package building.
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>