Commit Graph

189 Commits

Author SHA1 Message Date
Mateusz Grzonka 2b2c5668fd tests: Avoid passing chunk size when creating RAID 1
Tests fail because passing chunk size for RAID 1 is now forbidden.
Failing tests:
- 14imsm-r1_2d-grow-r1_3d
- 14imsm-r1_2d-takeover-r0_2d
- 18imsm-1d-takeover-r1_2d
- 18imsm-r1_2d-takeover-r0_1d

Correct tests to not pass chunk size when RAID level is 1.

Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2021-08-02 10:04:35 -04:00
Gioh Kim 76b906d240 mdadm/tests: add one test case for failfast of raid1
This creates raid1 device with the failfast option and check all
slaves have the failfast flag. And it does assembling and growing
the raid1 device and check the failfast works fine.

Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2019-02-14 15:07:18 -05:00
Michal Zylowski cf42a1c707 tests, imsm: Calculate expected array_size in proper way
Tests should calucalte expected array_size accordingly to raid level. Also
tests should take care about runding to neares MB introduced from b53bfba6
"imsm: use rounded size for metadata initialization".

Expect proper size in tests. Simplify 09imsm-overlap test by creating array
with size which has not been rounded. Main purpose of this test is checking
something else.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:17:29 -04:00
Michal Zylowski f49f083e2c tests, imsm: Migration from RAID5 to RAID0 is not supported for IMSM metadata
When test tries to change RAID level from RAID5 to RAID0 mdadm respond with
error about unsporrted operation.

Make 16imsm-r5_3d-migrate-r0_3d and 16imsm-r5_5d-migrate-r0_5d test
negative.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:17:12 -04:00
Michal Zylowski 1a90fd8458 tests, imsm: Test shouldn't call grow with chunk and level in one command
Since a3b831c9 "Grow.c: Block any level migration with chunk size change"
there is no possibility to perform migration between level and chunk in
one operation. When any test tries to do this error message is printed
and tests finishes with fail.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:16:48 -04:00
Michal Zylowski 2b2ccdc04b tests, imsm: Set new_num_disks value corectly to perform expected size calculations
In some migration tests, variable new_num_disks should be set to expected
number of disks after migration. This is required for proper expected size
calculation.

Pass new_num_disks variable during test execution for:
- 16imsm-r0_3d-migrate-r5_4d
- 18imsm-r1_2d-takeover-r0_1d
- 16imsm-r0_5d-migrate-r5_6d

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:16:24 -04:00
Michal Zylowski b202e322c1 tests, imsm: Fix unit inconsistency in tests error messages
Chunk size copied from sysfs should be divied by 1024 to compare with
expected chunk size.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:16:02 -04:00
Michal Zylowski 6adfeaa7a2 tests, imsm: Set correct expected offset between volumes
Since 611d9529 (imsm: change reserved space to 4MB) gap between RAID
volumes has changed. Tests should expect correct offset in size
calulations.

Fix expected offset for tests.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-07-11 13:15:37 -04:00
Zhilong Liu 7d4815f84c mdadm/test: correct tests/testdev as testdev in 02r5grow
Fixes: a6994ccc23 ("mdadm/test: get rid of the tests/testdev")

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-06-01 12:49:42 -04:00
Michal Zylowski 5a5b3a6725 imsm: Do not require MDADM_EXPERIMENTAL flag anymore
Grow feature for IMSM metadata is currently fully supported and tested.
Reshape operation is not in experimental state anymore, so usage of this
flag is unnecessary.

Do not require MDADM_EXPERIMENTAL flag and remove obsolete information
from manual.

Signed-off-by: Michal Zylowski <michal.zylowski@intel.com>
Acked-by: Mariusz Dabrowski <mariusz.dabrowski@intel.com>
Acked-by: Roman Sobanski <roman.sobanski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-05-31 11:30:36 -04:00
Jes Sorensen 59416da78f tests/func.sh: Fix some total breakage in the test scripts
We will never mandate an obsolete file system such as ext[2-4] for
running the test suite, nor should the test version of mdadm be
installed on the system for the tests to be run.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Fixes: 20d10b4be8 ("mdadm/test: Refactor and revamp 'test' script")
2018-04-11 17:27:28 -04:00
Zhilong Liu 064bd3f5ca mdadm/test: add do_clean to ensure each case only catch its own testlog
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-03-08 14:29:50 -05:00
Zhilong Liu 7d81135e8a mdadm/test: add disk metadata infos in save_log
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-03-08 14:28:39 -05:00
Xiao Ni 9c816fe2ad Add one sanity check for missing device
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-02-23 11:10:00 -05:00
Zhilong Liu cbb8d34a81 mdadm/test: move some functions to new source file
To make 'test' file concise, move some functions to new file
tests/func.sh, and leave core functions in 'test' file.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2018-01-21 16:36:08 -05:00
Xiao Ni 62e2991ff9 mdadm/test: Add one test case for raid5 reshape
This case tries to allow raid5 reshape to use backwards direction.
It changes chunksize after reshape and stops the raid. Then starts
the raid again.

Signed-off-by: Xiao Ni <xni@redhat.com>
Suggested-by:  Jes Sorensen <jes.sorensen@gmail.com>
Suggested-by:  Zhilong Liu <zlliu@suse.com>
Suggested-by:  Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-10-10 16:23:14 -04:00
Zhilong Liu f12b31813e mdadm/test: add new testcase for testing readonly/readwrite
This is a test case for testing --readonly and
--readwrite feature, it covers common metadata
versions and raid levels.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-09-01 11:28:34 -04:00
Zhilong Liu d3fba6633e mdadm/test: get rid of tests/check
The tests/check can be removed due to check()
in new 'test' has covered various checking.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-09-01 11:26:15 -04:00
Zhilong Liu a6994ccc23 mdadm/test: get rid of the tests/testdev
It's time to get rid of the tests/testdev due
to it has covered by testdev() in new 'test'.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-09-01 11:25:07 -04:00
Song Liu 6df5d1833f mdadm: add test case for raid5 write back cache
This test cases checks data integrity of raid5 write back cache
under various scenarios:

degraded mode, non-overwrite, raid-5/6.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
2016-12-19 10:06:26 -05:00
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