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>
Tue, 10 May 2016 05:11:54 +0000 (23:11 -0600)
commit05d87e87d1b9f3ecdc50794cc95cbeeee2ed57e4
treea1dde0a8b4904d8c9161921616a3280df88b63a9
parent8d7cc84a5654705638ed827df02d6cf646e677a7
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>
tests/f_random_corruption/name [new file with mode: 0644]
tests/f_random_corruption/script [new file with mode: 0644]