Commit Graph

110 Commits

Author SHA1 Message Date
NeilBrown 1011e8344a Remove lots of unnecessary white space.
Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <neilb@suse.de>
2013-06-19 12:31:45 +10:00
NeilBrown 79b2ed4f24 tests: zero devices before --adding them.
Linux 3.10 will allow more "--add" to be handled as "--re-add".
To be sure the tests work correctly we sometimes need to zero
the device to ensure it really is an --add that happens.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-05-01 09:24:11 +10:00
mwilck@arcor.de a6592497cd tests/10ddf-create: omit log output check
The test script was counting output lines - its expectations
don't match the current code any more. Remove this pointless
test.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-04-23 14:55:32 +10:00
NeilBrown bde085f411 test: add --disable-integrity switch.
The integrity tests are very slow and aren't always needed.
So make them optional.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-11-20 12:08:03 +11:00
NeilBrown 156044805c Tests: adjust for recent changes.
commit cb19a251a5
    super1: reserve  at least 2 chunks for reshape headroom.

reserved more space in a RAID5, so we need to update to array
sizes when reshaping.
Also make sure reshape tests we change the shape:  raid5->raid1
was failing and we didn't notice.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-11-20 12:06:53 +11:00
Gilles Espinasse ef6e87a7b9 Fix tests sh too many arguments warnings
Signed-off-by: Gilles Espinasse <g.esp@free.fr>

Add quotes on if [ $sum != $sum1 ]
Fix 2 typo /sh1sum/sha1sum/ /matc /match /
Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-11 10:38:51 +11:00
Robert Buchholz 8a63c73123 raid6check: Auto-repair mode
When calling raid6check in regular scanning mode, specifiying
"autorepair" as the last positional parameter will cause it
to automatically repair any single slot failes it identifies.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-09-10 17:28:21 +10:00
Robert Buchholz 696e95a1df raid6check: Repair mode used geo_map incorrectly
In repair mode, the data block indices to be repaired were calculated
using geo_map() which returns the disk slot for a data block index
and not the reverse. Now we simply store the reverse of that calculation
when we do it anyway.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-09-10 17:25:27 +10:00
Jes Sorensen aa437afc1c 07reshape5intr: Set speed_limit_min to be able to reduce resync speed below 1000
We need to set speed_limit_min accordingly, otherwise setting
speed_limit_max below 1000 will have no effect.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-08-13 08:00:21 +10:00
NeilBrown e999152898 tests/03r5assemV1: reduce sync speed further.
This test is quite sensitive to resync speed - if the resync happens
to quickly it fails because it sees aan optimal array when it expects
a degraded array.
1000 is often slow enough but now always, so slow it down even more.
This requires reducing speed_limit_min also as kernel ignores 'max'
when speed is below 'min'.

Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-08-13 08:00:21 +10:00
Robert Buchholz f2e29ad691 Repair mode for raid6
In repair mode, raid6check will rewrite one single stripe
by regenerating the data (or parity) of two raid devices that
are specified via the command line.
If you need to rewrite just one slot, pick any other slot
at random.

Note that the repair option will change data on the disks
directly, so both the md layer above as well as any layers
above md (such as filesystems) may be accessing the stripe
data from cached buffers. Either instruct the kernels
to drop the caches or reassemble the raid after repair.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:22:45 +10:00
Jes Sorensen 5e311406c4 New tests testing removal of internal bitmaps
To match the add-bitmap tests, here is a set of tests checking the
removal of bitmaps.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-30 10:46:25 +10:00
Jes Sorensen 451e30b1e6 New tests testing the addition of bitmaps
This set of tests verifies that it is possible to add an internal
bitmap to an existing array, and that the device can be written to
after the bitmap is added. This should catch cases such as the one
fixed by 4474ca42e2577563a919fd3ed782e2ec55bf11a2

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-30 10:45:27 +10:00
Anton Blanchard ffec313014 Increase minimum chunk size in testsuite to 64kB
When running the mdadm testsuite on ppc64 with a 64kB page size I
see a couple of failures because the chunk size is smaller than a
page.

Bump the chunksize to 64kB to fix these failures.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-24 15:36:30 +10:00
Jes Sorensen 04c1ca5f29 Check for multipath module before running multipath tests
Some systems do not ship the md multipath module. If not available
simply skip any multipath tests.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-23 13:25:44 +10:00
NeilBrown 3c8b273984 Update some device sizes for self tests.
A recent change means that devices smaller than
1Gig no longer have 1Meg wasted at the start.
So we must adjust some sizes again.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-18 17:08:28 +10:00
NeilBrown c07d640009 Fix tests/05r1-re-add-nosupper
This shouldn't have been changed when we size of RAID1
arrays was changed, as this uses 'build', not 'create'

Signed-off-by: NeilBrown <neilb@suse.de>
2012-03-22 17:30:07 +11:00
NeilBrown ae6c05ad83 Create: round off size for RAID1 arrays.
RAID1 arrays don't have a chunk size, but if you ever convert
one to RAID5 you will need at least a small one >= 4K.
So round of size to a multiple of 64K.

This only affect Create, not "--grow --size=max".  The latter
is too hard and with smaller returns.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-03-22 16:53:51 +11:00
NeilBrown 0b50d3359a tests/03r5assemV1 - slow down recovery a bit more.
In this test we stop and restart an array that is being recovered,
and we do that several times.  Sometimes it completes the recovery
before we expect and test results are wrong.

So slow it down a bit more.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-12-23 06:41:52 +11:00
NeilBrown 4ccc2562ac More fixes for tests.
Some more fixes to help some tests run properly.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-16 14:18:18 +10:00
NeilBrown af538d59c1 test/ddf add a udevadm settle
We need to settle udev before assuming the devices exist.

Signed-off-by: NeilBrown <neilb@suse.de
2011-06-15 16:30:12 +10:00
NeilBrown 67480d7593 Remove more duplicated code
Code from env-imsm-template is also in 09imsm-create-fail-rebuild,
so remove it from there.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-15 16:30:09 +10:00
NeilBrown d338d8a8e0 tests/08imsm-overlap - remove duplicated code
This test contains a lot of code that is also in env-imsm-template.
So remove it and simple source the other.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-15 16:06:57 +10:00
NeilBrown 17f7da2f42 Fix imsm-overlap test.
Now that we reserve space for migration buffer devices are a little
bit smaller so we need to allow for that in the test suite.

Also add a 'udevadm settle' - it seems to help

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-15 14:39:28 +10:00
Adam Kwolek 6820c9ab02 imsm: Unit Tests - remove backup-file during grow command
Update reshape/migration unit tests to not to use backup file.
Imsm native check-pointing has to be used (internally) instead.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-08 17:15:04 +10:00
NeilBrown 76ae482075 test: Don't use dev6 and dev7 together in a non-multipath test
dev6 and dev7 refer to the same storage and are used for
multipath testing.  So using them both in any other test will
be confusing.  So change 11spare-migration test 5 to use
dev10 rather than dev7

Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-28 13:24:04 +11:00
NeilBrown ab65d72387 tests: Make sure config file is empty when required.
We need to have no config at all for this test so
make sure it is empty.

Reported-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-28 10:41:09 +11:00
Czarnowska, Anna ed02d9cc04 tests: use $config to store test config path
We also need to tell Monitor where to look for Policy in 11spare-migration tests

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-28 10:34:17 +11:00
NeilBrown 972728bb1b tests: use /tmp/mdadm.conf rather than /etc/mdadm.conf.
Modifying /etc/mdadm.conf for testing is just wrong.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-24 12:45:23 +11:00
Krzysztof Wojcik e53d022c72 FIX: Tests: raid0->raid10 without degradation
raid0->raid10 transition needs at least 2 spare devices.
After level changing to raid10 recovery is triggered on
failed (missing) disks. At the end of recovery process
we have fully operational (not degraded) raid10 array.

Initialy there was possibility to migrate raid0->raid10
without recovery triggering (it results degraded raid10).
Now it is not possible.
This patch adapt tests to new mdadm's behavior.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-24 10:11:58 +11:00
Adam Kwolek e26c926209 imsm: FIX: existing backup file fails unit tests
During normal test execution, backup file is deleted after test execution.
If test is interrupted/broken, backup file can remain for next run.
When backup file exists before unit test run, suits 12 and 13 fails.

To avoid this remove backup file before grow is executed.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-15 08:46:54 +11:00
Krzysztof Wojcik 3600f9c168 imsm: Test for raid1 -> raid0 takeover added
Patch introduces test for raid1 to raid0 takeover operation
verification for imsm metadata format.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-14 09:18:48 +11:00
Adam Kwolek d5312ebf68 UT FIX: Pass all UT in suit 13
Parameters in UT suit 13 were wrongly chosen. This causes that
computed number of backup blocks was too big comparing to loop devices
size used in test. Changes in test parameters (chunk, array size)
causes that backup blocks passes mdadm condition for very small
loop devices.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-09 20:51:24 +11:00
Adam Kwolek 8200f09e8f UT FIX: imsm container can have different blocks number
When imsm container is created it have different blocks number
in /proc/mdstat depending on containing array raid level (raid0/raid5).
raid5 case:
md127 : inactive sdd[3](S) sde[2](S) sdc[1](S) sdb[0](S)
      2884 blocks super external:imsm

raid0 case:
md127 : inactive sdd[3](S) sde[2](S) sdc[1](S) sdb[0](S)
      836 blocks super external:imsm

Due to this, it cannot be compared to one value for both cases.

Test imsm container existence before unit test run only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-09 13:47:55 +11:00
Czarnowska, Anna f6539edf2e Spare migration tests updated
Added tests for cases when:
0  - there is no config file at all
0a - config file has no domains defined
9a - spare is in global domain
15 - spare is in global domain for $platform metadata

Test 4 pass condition changed for imsm metadata.

disk_policy only adds controller domain for imsm
when config_rules_has_path=1.
If there are any domains in config then every disk will have also
a controller domain.
As a result the array needing spares has at least
one controller domain even when it doesn't have any other
domains specified explicitly. In this case any spare in the same
controller domain matches when it has no other domains from config.
(This behaviour is different from the case when there is no paths
in config at all as array domain then is null and no spare matches)

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-08 11:44:50 +11:00
NeilBrown 152b223157 tests: add IMSM_NO_PLATFORM to some places that were missing it.
Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-01 14:44:02 +11:00
NeilBrown 3cdcfda4b0 test: remove all the environment handling.
Instead, just include the environ explicitly in the test file
or, where shared, source the shared file.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-02-01 14:43:59 +11:00
Labun, Marcin c7cb34136a 11spare-migration: pass conditions for tests 9 and 12 should be reversed
Test 9: We do not block spare migration between different metadatas.
test 13: Migrated spare must belong the same domain as destination -
there is no additional condition for action.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-01-31 11:36:25 +11:00
Labun, Marcin 61a31627c6 env-11spare-migration: imsm requires IMSM_NO_PLATFORM set with loop devices
By default IMSM checks if member device belongs to AHCI or ISCI controller.
When using loop devices one must disable these checks by setting
IMSM_NO_PLATFORM.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-01-31 11:35:25 +11:00
Krzysztof Wojcik 4f8a3e5baf Enable tests for OLCE, takeover, migrations for imsm metadata
Patch provides set of tests for On-line Capacity Expansion,
takeover, migrations operations for imsm metadata type.
Tests are grouped by operation type:
12 - On-line Capacity Expansion on one volume
13 - On-line Capacity Expansion on two volumes
14 - Negative tests for takeover, migrations
15 - Chunk size migrations
16 - raid0 -> raid5, raid5 -> raid0 migrations
18 - takeover operations
To run particular test group, following command should be executed:
(from mdadm's source code root directory)
./test <group number>
Example:
To run On-line Capacity Expansion on one volume tests:
./test 12
Tests execution results:
- In case of test pass, "succeeded" word is printed on console
- If test is failed, "FAILED" word is printed on console
and logs are stored in <mdadm-root-dir>/tests/log/ directory

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-12-26 21:59:14 +11:00
NeilBrown 4c8214543f Create: report failure if array cannot be started.
We weren't checking the result of writing 'active' to array_state

Signed-off-by: NeilBrown <neilb@suse.de>
2010-12-01 11:03:28 +11:00
NeilBrown 97c9c10014 ddf: fail creation of new subarray with same name as old.
Signed-off-by: NeilBrown <neilb@suse.de>
2010-12-01 09:55:35 +11:00
Anna Czarnowska 976915080e Spare migration tests
This is a series of tests checking if mdadm Monitor migrates spares
according to rules in /etc/mdadm.conf defined by POLICY lines.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29 09:43:29 +11:00
NeilBrown 8453e70430 Manage: be more careful about --add attempts.
If an --add is requested and a re-add looks promising but fails or
cannot possibly succeed, then don't try the add.  This avoids
inadvertently turning devices into spares when an array is failed but
the devices seem to actually work.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-22 19:35:25 +11:00
NeilBrown 7204495377 Fix writing of second backup superblock during grow
There 'rv' tests were confused and sometimes wrong.
This resulted in not writing the second bsb.

Also fix the test script so the the critical section is long enough
that we have some hope of interrupting it.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-05 21:39:17 +10:00
NeilBrown 8d848be1ed udevadm settle in autodetect test
some udev activity was interfering with the partitioning.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-05 16:50:03 +10:00
NeilBrown c61c4dd01d Fix test for imsm prodigal member scenario
The 'container_enough' changes fliped the default from assembling
an array as soon as we possibly could, to assembling only when all
expected devices are present.
This broken 09imsm-assemble which expects the original default.
So change from "-I" to "-IR" to restore the expected behaviour.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-05 11:44:26 +10:00
NeilBrown 69a3f12e6e Fix tests/layouts
some attributes files now return "new (old)", so allow for that when
reading the attr file.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-07-29 14:20:35 +10:00
NeilBrown ebe6ea0c4c tests: adjust sizes for new defaults
Default metadata type is now 1.2, and we sometimes
add extra alignment before the data section,
so adjust tests for these changes.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-03-10 15:56:01 +11:00
NeilBrown b8ab2a50ab Set default bitmap-chunksize for internal bitmaps to at least 64Meg
A small bitmap-chunksize hurts performance without helping
resync speed much - particularly on internal bitmaps.

So set the default to at least 64Meg.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:34 +11:00