]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfstests: add a test for btrfs device replace operation
authorStefan Behrens <sbehrens@giantdisaster.de>
Fri, 23 Aug 2013 13:07:11 +0000 (13:07 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 28 Aug 2013 14:05:25 +0000 (09:05 -0500)
commit53b73199db79dcd58622aaac2e9b0f31073bfc44
tree6bbaf1c7f4621ed545ba4de01854a81d98afc4d4
parent0d3bbd18942bfac464d18f88c0a3c100c67a24f2
xfstests: add a test for btrfs device replace operation

This test performs btrfs device replace tests with all possible profiles
(single/dup/mixed/raid0/raid1/raid10), one round with the '-r' option
to 'btrfs replace start' and one round without this option. The
cancelation is tested only once and with the dup/single profile for
metadata/data.

This test takes 181 seconds on my SSD equiped test box and 237s on
spinning disks. Almost all the time is spent when the filesystem is
populated with test data. The replace operation itself takes less than
a second for all the tests, except for the test that is marked as
'thorough' which will run for about 8 seconds on my test box.

The amount of tests done depends on the number of devices in the
SCRATCH_DEV_POOL. For full test coverage, at least 5 devices should
be available (e.g. 5 partitions). With less than 2 entries in
SCRATCH_DEV_POOL, the test is not executed.

The source and target devices for the replace operation are arbitrarily
chosen out of SCRATCH_DEV_POOl. Since the target device mustn't be
smaller than the source device, the requirement for this test is that
all devices have _exactly_ the same size. If this is not the case, the
test terminates with _notrun.

To check the filesystems after replacing a device, a scrub run is
performed, a btrfsck run, and finally the filesystem is remounted.

This commit depends on my other commit:
"xfstest: don't remove the two first devices from SCRATCH_DEV_POOL"

[rjohnston: renumbered to btrfs/011]

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reviewed-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/config
tests/btrfs/011 [new file with mode: 0755]
tests/btrfs/011.out [new file with mode: 0644]
tests/btrfs/group