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, 21 Mar 2014 09:54:46 +0000 (03:54 -0600)
commit46b25370df3c2e070987ba1147ed5d17b5960391
treec2ab79e7f1545a27fd1edf0a1fa535a915b27a03
parente0e67c6b03c7a4bee33921f5d3ae00a53597f0fe
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]