Commit Graph

68 Commits

Author SHA1 Message Date
mwilck@arcor.de 7d8a70bf23 test: allow LVM volumes or RAM disks as test devices
Allow other device types for testing; this allows to test on
a larger variety of devices.

Option --dev=[loop|lvm|ram] selects loop device (default), lvm,
and ram disk, respecively. To use RAM disks with DDF,
the kernel parameter ramdisk_size=65536 must be used.
For LVM, use --volgroup=<vg> to specify the name of the volume
group in which the test LVs will be created.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-06 09:56:21 +10:00
NeilBrown 9540cc244d test: ensure testing uses correct mdmon
When testing we want to run mdmon directly, not use
systemctl to get systemd to run it.

So allow an environment variable to make that choice.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-08-05 14:55:13 +10:00
mwilck@arcor.de 840ad583e0 test: increase number of devices to 13
extended DDF/RAID10 tests need 6 disks for DDF.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-22 16:56:32 +10:00
NeilBrown 6fd2a36f9b test: allow resync/reshape etc to go faster.
Whenever we "check wait" - make the resync process go at full speed.

Also allow script to adjust it manually.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-11 13:24:40 +10:00
NeilBrown aef14b9e49 tests: add a test for reverting reshapes
Only reverting reshapes that grow the array so far.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-04 17:10:36 +10:00
NeilBrown 855a353904 test: include any 'stderr' output in the log file.
Errors from mdadm go to 'stderr', so if there is an array,
copy those to the log file.

Signed-off-by: NeilBrown <neilb@suse.de>
2013-07-02 13:12:07 +10:00
NeilBrown 35698c6e91 tests: add test for converting levels to raid0 and back.
Now that I have this mostly working, I should make sure
it doesn't break...

Signed-off-by: NeilBrown <neilb@suse.de>
2013-06-24 15:57:58 +10:00
Gilles Espinasse 98a92cff5a Keep track on which kernel the test suite has run
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-11-20 12:12:03 +11:00
NeilBrown d5a221a525 test: remove unnecessary bash-ism.
Bash allows '-' in function names, but other shells don't.
So use '_' - always safe.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-11-20 12:08:51 +11: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 1dc837e4ed test: keep separate log file for each failed test.
If a test failed when --keep-going is selected, give the
log file a name based on the test name, so that all the logs
can be examined afterwards.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-23 09:21:32 +11:00
Gilles Espinasse 45e34015b6 test: redirect all output to log file to keep output clean
If a test sent anything to stdout, it would not get logged, and would
mess up the listing of test status.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-23 09:12:15 +11:00
Gilles Espinasse 4d3271732e Replace --no-error by --keep-going
Suggest to replace by the option name that 'make' use.
no error is only a developper hope.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-22 09:11:07 +11:00
Gilles Espinasse 4d5995c49f Allow escape by ctrl-c broken by --no-error change
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-22 09:09:55 +11:00
Robert Buchholz 23b7d3b927 Make test a bash script (as it is)
Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:22:43 +10:00
Jes Sorensen fc092254a1 Fix --no-error in test script
b8e91a32cd was applied incorrectly.
It changed the name of the variable set when specifying --no-error,
without changing the places checking it.

Set it back as it was to make --no-error work correctly again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-30 10:44:10 +10:00
Jes Sorensen 572d7091f7 Move setup code to a function and introduce matching cleanup argument
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-28 10:52:27 +10:00
Jes Sorensen 0aaecb4330 Improve --help message from test
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-28 10:51:57 +10:00
Jes Sorensen b8e91a32cd Add --no-error argument to 'test'
This allows the test suite to run to completion even if one test
fails.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-28 10:51:43 +10:00
Jes Sorensen 6038155520 Add support for saving log files in test script
--logdir= specifies where to save, if different from default, and
--save-logs tells test to save all log files.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-28 10:50:38 +10:00
Jes Sorensen 4e5ce543f0 Add command line argument parsing to 'test' sript
This adds more generic command line argument parsing to the test
script. It also introduces a couple of new options, while preserving
the old '<prefix>' and 'setup' arguments. The new options are
--disable-multipath and --tests=<test1>,<test2>,...

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-23 13:36:52 +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 974e0395ee test: don't worry too much about array size.
With different amounts of space being reserved for metadata
it is hard for the script to know how big the array should be.
So allow a bit of slack.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-05-03 15:29:04 +10: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 019ca1e1da test: call "udevadm settle" after stopping array.
If we don't do this, then the unlink from /dev might happen
after the next step in the test creates something in /dev,
and device names seem to go missing.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-03-22 10:09:30 +11:00
NeilBrown d11128690b test: remind where the log file is.
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
NeilBrown 0d711ba4d3 Allow test to detect 'resync=DELAYED' state
There is no space around the '=' when resync is delayed,
so allow for that in pattern matching.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-01-31 16:59:40 +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
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 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 7d5c3964cc Change default metadata from 0.90 to 1.1
1.1 is more flexible in a number of ways and is safer.
0.90 is still fully supported.
1.0 should possibly be used for RAID1 arrays that you
want to boot off, depending on your boot loader.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:32 +11:00
NeilBrown 6636f0efb3 tests/imsm: allow for rounding of array size.
IMSM rounds array size to a multiple of 1024K, so our tests must
assume this.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-16 17:57:28 +11:00
NeilBrown ba6241244b Test different r5/r6 layouts.
Make sure kernel and restripe agree on all different layouts.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-16 17:50:07 +11:00
NeilBrown 487e48afab Test level changes and related reshaping.
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-12 16:57:18 +11:00
NeilBrown 7f15ccce53 test: minor fixes
- allow core files to be dumped.
 - modprobe md_mod if needed to write to
        /sys/module/md_mod/parameters/....

Signed-off-by: NeilBrown <neilb@suse.de>
2009-04-07 17:50:34 +10:00
NeilBrown d50683f903 test: support testing DDF
DDF requires larger devices as 32Meg is reserved.

So allocated larger loop devices for DDF tests.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-04-06 15:52:13 +10:00
NeilBrown dd4ae23ad0 test: return correct error status for mdadm
mdadm's return status is being hidden by the 'test' script so
individual tests cannot see it.
2009-04-01 13:50:19 +11:00
Dan Williams ddaf4ce2da test: fix a call to udevsettle
udevsettle is deprecated, use udevadm settle

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2009-02-23 23:06:24 -07:00
Dan Williams 2952742d32 workaround a hald interaction and quiet cleanup
The 'udevadm settle' call appears to resolve:

mdadm: failed to stop array /dev/md127: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
Dan Williams 4b7a9ee3a1 test: enable per-test custom environment setup/teardown
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
NeilBrown 2ce7c39bfa test: always start with a clean slate.
To avoid confusion with old array, also zero superblocks
before starting a test.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 21:06:00 +11:00
NeilBrown 045495a394 test: make sure udev isn't opening a device before closing it.
As we open and close so quickly, udev might still have the device
open.  so call udevsettle before stopping an array during testing.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:51:12 +11:00
NeilBrown 7801ac2092 Factor out add-disk code
The variety of approaches to 'add_disk' are factored out into
a separate function, and Incremental mode benefits by being
closer to supporting the assembly of containers.

Also remove the adding-to-array-data-structure out of sysfs_add_disk
and into add_disk.

And add some tests for --incremental mode to make sure we don't break it.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-09-18 15:13:32 +10:00
NeilBrown 37ea3936a6 Merge branch 'master' into from-stable
Conflicts:

	Create.c
	Manage.c
2008-08-07 14:12:25 +10:00
Neil Brown 908ef18519 Stop all arrays before running each test in regression test driver.
Sometimes I forget to stop arrays at the end of scripts, and
that shows errors in the next script, which is confusing.
2008-07-12 20:27:42 +10:00
Neil Brown 0aa389dc62 Add test for stoping and restarting a raid5 reshape.
There was a kernel bug with stopping and restarting
raid5 recently.  So add a test to check for it.
2008-06-27 16:07:52 +10:00
Neil Brown 1c203a4b5a Fix autoassemble for stack arrays.
If you have stacked arrays, then
  mdadm -As --homehost=fred
should work but doesn't.  It gets into an infinite loop!

So write some tests, and fix the bugs.
2008-05-20 16:28:48 +10:00
Neil Brown 1f48664b8e Add --auto-detect for in-kernel autodetect.
This is equivalent to raidautorun that some distros provide.
2007-05-21 14:25:44 +10:00