Commit Graph

169 Commits

Author SHA1 Message Date
Song Liu 356e69de79 mdadm: add test script for raid456 journal
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: NeilBrown <neilb@suse.com>
2015-10-22 12:20:08 +11:00
NeilBrown 4a3a795a8b tests: raid6 repair is now tested on every different layout.
Signed-off-by: NeilBrown <neilb@suse.de>
2015-08-05 14:57:08 +10:00
NeilBrown 4108d695e3 tests: flushbufs after writing zeros
sometimes the removed device is re-added before the writes
get all the way to the md device - so the array doesn't need
any recovery and the test fails.
So flush first to be safe.

Signed-off-by: NeilBrown <neilb@suse.com>
2015-07-23 11:09:19 +10:00
NeilBrown d51e39c0a4 test: add -F flag to mkfs
newer versions of mkfs.extX ask before creating a filesystem
on a device which appears to already have a filesystem.
We don't want that, so add the -F flag.
Also be explicit about fs type as one shouldn't depend on defaults.

Signed-off-by: NeilBrown <neilb@suse.com>
2015-07-22 09:58:41 +10:00
NeilBrown 0832fb09d9 tests: slow down --stop a bit to allow revert-inplace to work.
revert-inplace would sometimes find that the original reshape had
finished.
So slow down the reshaping during --stop (which needs to be a little
bit fast so that stop doesn't timeout waiting) and don't wait quite
so long before stopping.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-07-16 10:50:40 +10:00
NeilBrown 7cb2815a15 tests: add 19raid6check
This checks that raid6check finds no errors in newly created array
with all different layouts.
(it doesn't...)

Signed-off-by: NeilBrown <neilb@suse.de>
2015-07-16 08:02:52 +10:00
NeilBrown 439c196491 tests: do not try to 'flushbufs' after stopping a array
If the array is stopped, there is nothing to flush, and
blockdev can signal an error.

Signed-off-by: NeilBrown <neilb@suse.com>
2015-07-10 14:42:20 +10:00
NeilBrown bcbb92d4ee Remove some trailing white space
It looks ugly in my editor.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-07-02 08:26:30 +10:00
NeilBrown 7d1dda2c55 tests/imsm-grow-template change 'wait' to 'check wait'
'wait' is a shell builtin that isn't doing anything useful.
It should be calling 'check wait' I think.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-28 16:51:23 +10:00
NeilBrown 20c993e2e5 tests: wait a bit long for reshape to complete.
As the kernel now does less locking, 'check wait' doesn't
always wait long enough.  Add some pauses.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-25 16:59:19 +10:00
NeilBrown 2c3e39ebf9 tests/07reshape5intr : retry if writing 'check' fails.
It can sometimes.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 15:09:08 +10:00
NeilBrown df995e3af3 tests/19raid6repair: don't flushbufs on non-existent array.
..that triggers an error.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 12:34:27 +10:00
NeilBrown e2a8e9dcf6 tests: wait for complete rebuild in integrity checks
'check wait' seems a bit racy now.
Wait for the array to be fully optimal before proceeding.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 11:07:27 +10:00
NeilBrown 670fe20aa0 tests/05r6tor0: minor adjustments
1/ use correct data-offset for cmp - that has changed.
2/ flushbufs on the block device before reading to avoid cache issues

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 11:07:25 +10:00
NeilBrown f7f6c9f161 tests: 05r6tor0 - add some more waiting.
I don't really know why this is needed, but there is a delay
between the reshape finishing and the level/etc changing.
So add some sleeps.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 11:07:25 +10:00
NeilBrown 18d5cb9ee5 tests/imsm-grow-template: sleep a bit more.
The current sleep/wait doesn't seem long enough,
particularly when two arrays are being reshaped in the one
container.

So wait a bit more...

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-15 11:07:25 +10:00
NeilBrown b638e7d440 tests: don't "dd" indefinitely.
This will trigger an error.  And now that errors are fatal....

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-13 13:24:33 +10:00
NeilBrown 7d63efc8d8 tests: ignore failure status from mdadm -IRs
This can report non-zero if there was nothing to do,
and that isn't really an error.
If the array doesn't get started, something else
will complain.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-13 13:11:02 +10:00
NeilBrown 3c899cab4d tests: never fail if --wait fails.
"--wait" will return non-zero status if it didn't need to wait.
This is no a reason to fail a test.

So ignore the return status from those commands.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-05-07 17:00:57 +10:00
NeilBrown a34c8836f0 tests: handle change to DDF assembly.
When a DDF array is assembled with missing devices, those devices
are now alway marked as 'missing' and cannot just re-appear in the array
and be working again.

test must be changed to acknowledge this.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21 11:54:48 +10:00
NeilBrown 1c2cdb9072 tests: handle new raid10/ddf geometries.
Recent changes to support more ddf geometries using raid1e
requires updates to tests.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21 11:54:48 +10:00
NeilBrown 303a263544 ddf-sudden-degraded test fix.
Change how sudden-degraded devices should appear.
We don't record failure, we record that the device isn't there.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-26 14:30:21 +11:00
NeilBrown fdcd157a80 tests: add test that DDF marks missing devices as failed on assembly.
If we assemble a newly-degraded array, the missing devices must be marked
as 'failed' so we don't expect them in future.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-11 17:11:08 +11:00
NeilBrown 06f3dae93a New test: 03r5assem-failed
This test currently fails, confirming a bug which was recently
reported.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-02-25 14:52:14 +11:00
NeilBrown be4a3188f6 ddf tests: fix get_rootdev
Getting the major number from the hex device number should take
all-but-the-last-two digits, rather than just the first two digits.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-11-19 16:40:09 +11:00
mwilck@arcor.de 21529ab377 tests/10ddf-incremental-wrong-order: new unit test
This is a test simulating two temporary missing disks. These will
have less recent meta data than the other disks in the container.
When the array is reassembled, we expect mdadm to detect that
and react to it by using the meta data of the more recent disks
as reference.

This test FAILS with mdadm 3.3 for DDF.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:31:30 +11:00
mwilck@arcor.de c17d3b5cfd tests/10ddf-assemble-missing: new unit test
This is a test case for handling incremental
assembly correctly after disks had been missing once.

This test is the basis for other similar but more tricky
test cases involving inconsitent meta data.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:31:30 +11:00
mwilck@arcor.de e00d9c10c1 tests/env-ddf-template: add helper function for checksums
Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:31:30 +11:00
mwilck@arcor.de d5b8e34061 tests/10ddf-fail-readd-readonly: new unit test.
A test for my recent patch "Monitor: write meta data in readonly state,
sometimes". Test that a faulty disk is recorded in the meta data.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:31:30 +11:00
mwilck@arcor.de ab77d284a6 tests/env-ddf-template: fix container name
/dev/md/ddf0 works also with assembly. /dev/md/ddf doesn't.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:31:30 +11:00
mwilck@arcor.de f502b11c74 tests/10ddf-fail-stop-readd: New DDF unit test
This is similar to 10ddf-fail-readd. The difference is that the
array is stopped and incrementally assembled before the disk is
re-added.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:29:43 +11:00
mwilck@arcor.de 58c96b6b1e tests/10ddf-fail-readd: New DDF unit test
This unit test is for a simple fail/remove/readd scenario.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:29:43 +11:00
mwilck@arcor.de aa0faa10b2 DDF test: make sure mdmon isn't started by systemd
For testing we usually want the locally built mdmon, not the
one systemd prefers.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:29:42 +11:00
mwilck@arcor.de 1a2872fe9a DDF tests: allow to run on systems without /dev/sda
Some ddf tests scripts assume that /dev/sda is always present.
That's wrong e.g. on VMs. Use a more general approach.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-10-16 15:29:42 +11:00
mwilck@arcor.de 82c8e664cc tests/10ddf-fail-create-race: test handling of fail/create race
If a disk fails and simulaneously a new array is created, a race
condition may arise because the meta data on disk doesn't reflect
the disk failure yet. This is a test for that case.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-08 09:56:13 +10:00
mwilck@arcor.de 2bcf1873d0 tests/10ddf-fail-spare: more sophisticated result checks
This test can succeed two ways, depending on timing.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-08 09:55:33 +10:00
mwilck@arcor.de e7f9c72024 tests/10ddf-fail-two-spares: new unit test
This is one more unit test for failure/recovery, this time with
double redundancy, which isn't covered by the other tests.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-08 09:37:12 +10:00
mwilck@arcor.de 6b924b1e9f tests/10ddf-fail-spare: new unit test
This is Albert Pauw's latest test. Note that this FAILS.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-06 09:54:42 +10:00
mwilck@arcor.de 635ac286c3 tests/10ddf-fail-twice: remove hard-coded assumptions
This test has some randomness because it is not always deterministic
which of the two arrays gets the spare and which remains degraded.
Handle it.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-06 09:52:58 +10:00
mwilck@arcor.de ee7d0c09cd tests/env-ddf-template: some helper functions
helper functions to determine the list of devices in an array,
etc.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-06 09:52:58 +10:00
mwilck@arcor.de 57631ca2ff tests/10ddf-fail-twice: New unit test
This is the test by Albert Pauw. Fail 2 disks, and add one.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-05 12:04:56 +10:00
Martin Wilck d81cc6a72e tests/env-ddf-template: helper for new unit test
I forgot to check in this helper script, similar to the one for IMSM.
It is needed by tests/10ddf-create-fail-rebuild.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-31 16:48:57 +10:00
Martin Wilck 08b0ef8e50 tests/10ddf-create-fail-rebuild: new unit test for DDF
This test adds a new unit test similar to 009imsm-create-fail-rebuild.
With the previous patches, it actually succeeds on my system.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-31 13:04:07 +10:00
NeilBrown 482383022d Add test for --replace handling.
Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-24 15:32:31 +10:00
NeilBrown 7d7092ec6c Improve revert tests
1/ perform revert-grow on more metadata versions
2/ add revert-inplace.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-24 12:23:04 +10:00
mwilck@arcor.de 5c41684539 tests/10ddf-geometry: new unit test
Test various RAID geometries, creation and deletion of subarrays

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-22 16:56:32 +10:00
mwilck@arcor.de abbc450fc2 tests/10ddf-create: create RAID5 first
Let the first created array be RAID5 rather than RAID0. This makes
the test harder than before, because everything after the first
Create has do be done indirectly through mdmon.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-22 16:56:32 +10:00
mwilck@arcor.de d242493523 test/10-ddf-create: fix comments
Comments should reflect the changes in the script.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-09 14:41:04 +10:00
mwilck@arcor.de cf43d473a0 tests/10ddf-create: add RAID 10 array
This patch adds RAID10 support to the DDF test script.
It actually passes!

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-08 16:50:53 +10:00
NeilBrown 8f0ac9d793 tests: add test to revert shrinking reshapes.
Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-04 17:18:24 +10:00