1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

773 Commits

Author SHA1 Message Date
Zdenek Kabelac
0dc6ba8309 tests: resume devices on background
Since some devices may need correct order of their resuming,
resume then all on background and wait for finish.
2012-12-02 17:55:49 +01:00
Zdenek Kabelac
2be940e549 tests: update thin testing 2012-11-27 14:10:46 +01:00
Zdenek Kabelac
0387e70d76 thin: fix property discard for lvm2api
Discards property is string and may have these values:
  ignore, nopassdown, passdown
2012-11-27 14:09:49 +01:00
Petr Rockai
60668f823e Automatically restore MISSING PVs with no MDAs. 2012-11-25 20:41:56 +01:00
Zdenek Kabelac
400f644286 lv_manip: fix regresion from bf2741376d
Commit bf2741376d started to use
lv_is_active() instead of call for lv_info & info.exists so
we cover also cluster activated devices.
For snapshost the conversion was not correct and introduced
regression by blocking creation of snapshot of inactive LV.

Fix it by assigning lv_is_active() directly.
Note: we still have minor issue to fix - to make
lv_is_???? function able to return error states since
lv_info() may fail.
2012-11-21 12:15:09 +01:00
Zdenek Kabelac
a7893ae858 test: testing lvconvert 2012-11-19 14:38:17 +01:00
Tony Asleson
7a34db0cfd python-lvm: Initial check-in of python-lvm unit test case.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2012-11-14 13:18:37 -06:00
Tony Asleson
fefb2f03c3 test: set LD_LIBRARY_PATH to all dirs with *.so
Instead of manually editing entries, add all the
directories which contain shared objects.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2012-11-14 13:05:55 -06:00
Petr Rockai
09d77d0c94 test: Check that overriding use_lvmetad with --config works. 2012-10-30 09:16:15 +01:00
Petr Rockai
2fdd0840d5 lvmetad: Disable and warn when locking_type is 3. 2012-10-25 14:31:08 +02:00
Zdenek Kabelac
c7c53ad41d pvcreate: fix leak on error path
Missing vg release on error path.
Add tests for few more error cases.
2012-10-19 15:32:21 +02:00
Jonathan Brassow
831ce3cda9 TEST: Re-add testing of lvconvert-raid for kernels < 3.2
I'm not sure what 'BUG's were being encountered when the restriction
to limit lvconvert-raid.sh tests to kernels > 3.2 was added.  I do know
that there were BUG's that could be triggered when testing snapshots and
some of the earliest DM RAID available in the kernel.  I've taken out
the 3.2 kernel restriction and added a dm-raid >= 1.2 restriction instead.
This will allow the test to run on patched production kernels.
2012-10-15 15:43:15 -05:00
Zdenek Kabelac
d864c6eacd test: resync is for mirror devices 2012-10-15 14:31:41 +02:00
Zdenek Kabelac
faa9a52085 test: detect compilation with readline
check lvm shell functionality only if compiled with readline.
2012-10-15 14:07:06 +02:00
Alasdair G Kergon
78dafcba99 lvmetad: use -l for logging level not -d 2012-10-15 10:44:43 +01:00
Zdenek Kabelac
3972bd98fb thin: add support to unmount volumes
Reset counter after thin pool resize failure.

If the pool goes above threshold, support unmounting
of all thin volumes if the lvextend fails to avoid
overfilling of the pool.
2012-10-14 23:19:20 +02:00
Zdenek Kabelac
c6f2821b9f test: speedup a bit
Do not wait full 10s if the invalid snapshot is already dropped.
2012-10-14 23:17:33 +02:00
Zdenek Kabelac
a6f53b5c0d test: coverage
Improve a bit code coverage.
Use lvm shell to reduce a bit CPU time.
2012-10-14 23:14:48 +02:00
Zdenek Kabelac
98124361ae test: update global_filter
use simplier filter for test suite
2012-10-12 17:59:11 +02:00
Zdenek Kabelac
bb867abe11 test: typo fix from last commit 2012-10-12 17:35:44 +02:00
Zdenek Kabelac
45b1fcdb4e test: move global_filter only to mdata_string test
Tries to help with lvmetad test and pvdisplay and unknown device.
2012-10-12 17:27:29 +02:00
Zdenek Kabelac
d9cc3f3acb test: use global_filter with initial content 2012-10-12 17:02:30 +02:00
Zdenek Kabelac
31d8c3ee85 debug: do not play with fds with valgring
When valgrind usage is desired by user (--enable-valgrind-pool)
skip playing/closing/reopenning with descriptors - it makes
valgridng useless.

Make sleep delay for clvmd start longer.
2012-10-12 17:02:30 +02:00
Zdenek Kabelac
3058f662cf thin: prohibit lvcreate --thinpool with mirrors
Disable --thinpool to be used with mirror on lvcreate.
2012-10-12 12:21:45 +02:00
Zdenek Kabelac
be291e1064 thin: lvm2api return origin property for thin LV 2012-10-12 12:20:55 +02:00
Petr Rockai
d6d207006a lvmetad: Fix the fix for 813766 (lvmetad connection warning). 2012-10-12 11:22:47 +02:00
Petr Rockai
413d91dc29 test: Add lvmetad-dump.sh. 2012-10-11 20:32:25 +02:00
Petr Rockai
b165e9f3f8 test: Skip lvconvert-raid on kernels < 3.2 since they BUG out. 2012-10-11 18:13:37 +02:00
Zdenek Kabelac
316ce655a3 thin: raise required version to 1.4
Stay safe and require 1.4 (kernel 3.6) for non-power-of-2
support for thin pool chunk_size.
2012-10-11 14:09:07 +02:00
Petr Rockai
57460fe5a8 test: Skip the topology test if setting up scsi_debug fails. 2012-10-11 11:51:04 +02:00
Petr Rockai
deea86c7f4 pvscan --cache: Also read metadata from LVM1 PVs (BZ 863401). 2012-10-10 21:55:24 +02:00
Zdenek Kabelac
14283662b9 test: use exclusive activation for created mirrors 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
9db5217a31 test: thin support for non power of 2 chunk size 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
876514eb34 test: drop clustered flag control from thin tests 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
d4eded9fd6 test: move common code for thin init 2012-10-10 21:22:11 +02:00
Jonathan Brassow
b296e30f98 TEST: Add lvchange-partial.sh and vgchange-partial.sh to the test suite
Commit 3501f17fd0 enables a limited set
of metadata updates for partial LV/VGs when issuing lvchange or vgchange.
These tests verify those changes operate as intended.
2012-10-10 11:47:04 -05:00
Petr Rockai
f65754e6fc test: Check that lvmetad is refreshed correctly on restart. 2012-10-10 13:54:36 +02:00
Petr Rockai
71d718a4a4 lvmetad: Warn if lvmetad is running but disabled. 2012-10-10 13:54:29 +02:00
Petr Rockai
6e523f01d0 test: Skip thin tests if thin support is configured out. 2012-10-10 00:20:22 +02:00
Petr Rockai
ff752c60df TEST: Avoid building unit tests with --disable-testing. 2012-10-09 20:37:34 +02:00
Zdenek Kabelac
439989adab test: more thin tests 2012-10-09 16:38:42 +02:00
Zdenek Kabelac
d7b3179669 test: move raid10 test into separate test files
New features tested in new files.
2012-10-09 16:38:12 +02:00
Zdenek Kabelac
93d7d3ed2c test: split raid tests
Separate original raid test and new raid10 test,
so the old could be tested on platforms without raid10 support.

Replace test-unfriendly `ls /dev/mapper`   with  dmsetup ls
2012-10-09 12:22:26 +02:00
Zdenek Kabelac
f0d34f383d test: ignore modprobe failure
If the system doesn't have modprobe but happens to have modules
loaded, allow version testing.
2012-10-09 10:37:37 +02:00
Petr Rockai
9ff2f1a3db TEST: Check that LVM1 VGs work when using lvmetad (BZ 863401). 2012-10-09 07:59:53 +02:00
Petr Rockai
556d2c920a TEST: Give lvmetad a chance to exit gracefully upon teardown. 2012-10-08 20:35:29 +02:00
Petr Rockai
39468b73a3 TEST: Wait for lvmetad socket to appear in "aux prepare_lvmetad". 2012-10-08 20:35:29 +02:00
Petr Rockai
d5f2e6223f TEST: When INTERACTIVE=1, allow scripts to control a TTY. 2012-10-08 20:35:29 +02:00
Zdenek Kabelac
3877ccfe1b test: move raid test to separate tests
Revert changes to origin lvcreate-large test and use separate
test scripts for raid  - so they can be properly skipped when
kernel doesn't support raid targets.
2012-10-08 14:49:21 +02:00
Zdenek Kabelac
40182cbd82 test: check snap_percent returns invalid
For thin_volumes snap_percent is meaningless.
2012-10-08 12:16:54 +02:00
Petr Rockai
0dfafd77d4 TEST: Only run the pvscan --cache test with lvmetad active. 2012-10-08 07:23:13 +02:00
Petr Rockai
e702073235 TEST: Add lvmetad-pvscan-cache to check that pvscan --cache works. 2012-10-07 22:32:32 +02:00
Zdenek Kabelac
7f4f7f70ce test: lvm2api thin data_percent 2012-10-05 10:37:41 +02:00
Zdenek Kabelac
39f3c9de0b test: check data_percent is equal to snap_percent 2012-10-05 10:37:41 +02:00
Jonathan Brassow
886656e4ac RAID: Fix problems with creating, extending and converting large RAID LVs
MD's bitmaps can handle 2^21 regions at most.  The RAID code has always
used a region_size of 1024 sectors.  That means the size of a RAID LV was
limited to 1TiB.  (The user can adjust the region_size when creating a
RAID LV, which can affect the maximum size.)  Thus, creating, extending or
converting to a RAID LV greater than 1TiB would result in a failure to
load the new device-mapper table.

Again, the size of the RAID LV is not limited by how much space is allocated
for the metadata area, but by the limitations of the MD bitmap.  Therefore,
we must adjust the 'region_size' to ensure that the number of regions does
not exceed the limit.  I've added code to do this when extending a RAID LV
(which covers 'create' and 'extend' operations) and when up-converting -
specifically from linear to RAID1.
2012-09-27 16:51:22 -05:00
Petr Rockai
f8e287cca2 TEST: Workaround for lvmetad vs inconsistent metadata. 2012-09-26 17:26:23 +02:00
Petr Rockai
2d7a8b4531 TEST: Add LVM_VALGRIND_LVMETAD to testing options. 2012-09-26 17:26:23 +02:00
Petr Rockai
c7b17836ea Implement devices/global_filter.
The global filter is applied first, and is also applied in pvscan --cache (which
is called from udev rules to keep lvmetad updated). Cf. example.conf.
2012-09-26 14:49:15 +02:00
Petr Rockai
376cb3fe64 TEST: Kill lvmetad early in teardown. 2012-09-26 12:23:34 +02:00
Marian Csontos
9d0dc63c8b Fix tests to accept extended attribute
attr field had a character (p)artial appended.
2012-09-20 07:30:24 +02:00
Jonathan Brassow
2e04681248 mirror: 'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirror
When reformatting the 'lvchange_resync' code in commit
05131f5853, a '!' should have been removed
from the condition that checks for the LV_NOTSYNCED flag on a corelog
mirror LV.  The presence of this '!' caused the LV_NOTSYNCED flag to be
cleared when it wasn't present and left when it was present.

It is not allowed to add images to a 'mirror' or 'raid1' LV if the
LV_NOTSYNCED flag is set.  We add some up-convert tests to ensure this
behavior is being enforced and that the LV_NOTSYNCED flag is being
properly cleared by 'lvchange --resync'.

(Not updating WHATS_NEW because this is intrarelease.)
2012-09-19 11:16:45 -05:00
Jonathan Brassow
5cdd7848f4 TEST: Add missing test for RAID module version
RAID10 was added to dm-raid module version 1.3.0.  Omitted test for
this version is causing test suite to fail.
2012-09-12 06:27:37 -05:00
Jonathan Brassow
1b01a2f65a TEST (lvresize-raid): Also test resizing of RAID10 2012-09-05 11:33:07 -05:00
Peter Rajnoha
2a70e98b05 test: snapshot_extend_threshold -> snapshot_autoextend_threshold
Missing the "auto" prefix in the config key name. The unknown
setting is silently ignored otherwise.
2012-08-27 14:04:21 +02:00
Zdenek Kabelac
5a3c597fd5 tests: testing lvm_lv_rename
Test stacking of rename operation within one udev transaction.
2012-08-27 13:03:15 +02:00
Jonathan Brassow
4047e4dfb1 RAID: Add support for RAID10
This patch adds support for RAID10.  It is not the default at this
stage.  The user needs to specify '--type raid10' if they would like
RAID10 instead of stacked mirror over stripe.
2012-08-24 15:34:19 -05:00
Petr Rockai
b61be64370 libdaemon: Draft logging infrastructure.
- logging is not controlled by "levels" but by "types"; types are
  independent of each other... implementation of the usual "log level"
  user-level semantics can be simply done on top; the immediate
  application is enabling/disabling wire traffic logging independently
  of other debug data, since the former is rather bulky and can easily
  obscure almost everything else
- all logs go to "outlets", of which we currently have 2: syslog and
  stderr; which "types" go to which "outlets" is entirely configurable
2012-08-08 09:44:19 +02:00
Petr Rockai
20ca6d6545 TEST: Add lvmetad-test; checks --test with lvmetad. 2012-07-30 11:21:55 +02:00
Jonathan Brassow
599f18db8a TEST: Conditionalize RAID tests on whether the dm-raid module exists 2012-07-25 09:43:28 -05:00
Jonathan Brassow
5555d2a000 RAID: Fix segfault when attempting to replace RAID 4/5/6 device
Commit 8767435ef8 allowed RAID 4/5/6
LV to be extended properly, but introduced a regression in device
replacement - a critical component of fault tolerance.

When only 1 or 2 drives are being replaced, the 'area_count' needed
can be equal to the parity_count.  The 'area_multiple' for RAID 4/5/6
was computed as 'area_count - parity_devs', which could result in
'area_multiple' being 0.  This would ultimately lead to a division by
zero error.  Therefore, in calc_area_multiple, it is important to take
into account the number of areas that are being requested - just as
we already do in _alloc_init.
2012-07-24 19:02:06 -05:00
Jonathan Brassow
407198e17d TEST: Replace old sync test/wait functions with new library functions
Generic sync test/wait functions have replaced the old mirror/raid functions.
2012-07-24 14:20:30 -05:00
Jonathan Brassow
753cb9204d TEST: Add library functions for checking and waiting for sync
Add 'in_sync' and 'wait_for_sync' to test and wait for synchronization
of a mirror or RAID logical volume.
2012-07-24 14:17:54 -05:00
Jonathan Brassow
00d9bf8107 TEST (lvresize-raid): Don't run test when RAID module doesn't exist
Check for RAID module and skip test if not there.
2012-07-17 10:50:21 -05:00
Jonathan Brassow
8767435ef8 RAID: Fix extending size of RAID 4/5/6 logical volumes.
Reducing a RAID 4/5/6 LV or extending it with a different number of
stripes is still not implemented.  This patch covers the "simple" case
where the LV is extended with the same number of stripes as the orginal.
2012-06-26 09:44:54 -05:00
Jonathan Brassow
bf81d5607a TEST (lvconvert-raid): Turn on RAID conversion testing under snapshots 2012-06-26 06:45:45 -05:00
Jonathan Brassow
7168880caa TEST (lvconvert-raid): localize a function variable
Function was overwriting a global variable because it used a variable
of the same name without first declaring it with 'local'.
2012-06-25 22:25:46 -05:00
Jonathan Brassow
149ab6921e TEST (lvcreate-raid): Allow more time for RAID arrays to sync
My machines can run very slow sometimes causing this test to fail
when it would otherwise have succeeded given more time.
2012-06-25 22:20:24 -05:00
Alasdair G Kergon
dd5b2974c0 gitignore: Remove redundant test dir entry 2012-06-08 23:34:15 +01:00
Peter Rajnoha
9bb148ff4e Partial activation working, expect success in tests. 2012-05-17 12:03:30 +00:00
Peter Rajnoha
1dffc9bcb0 Re-enable tests for snapshots of mirrors. 2012-05-17 08:04:11 +00:00
Zdenek Kabelac
313a71048e snaps of mirrors are enabled 2012-05-16 15:01:06 +00:00
Petr Rockai
12a15f939c Add a (currently failing) test for RHBZ 816672. 2012-05-16 10:44:36 +00:00
Petr Rockai
03885b6863 Add provisions to flag tests that we know will fail, without flagging the build
(i.e. an expected failure).
2012-05-16 10:43:41 +00:00
Peter Rajnoha
ec808a033b Remove VG/PV used in the test. 2012-05-09 14:44:59 +00:00
Peter Rajnoha
9c17acdfe8 Fix division by zero if PV with zero PE count is used during vgcfgrestore. 2012-05-09 12:30:56 +00:00
Jonathan Earl Brassow
eb2d70293d Fix up-convert when mirror activation is controled by volume_list and tags.
When mirrors are up-converted, a transient mirror layer is put in so that
only the new devices are sync'ed.  That transient layer must carry the tags
of the original mirror LV, otherwise it will fail to activate when activation
is regulated by lvm.conf:activation/volume_list.  The conversion would then
fail.

The fix is to do exactly the same thing that is being done for linear ->
mirror converting (lib/metadata/mirror.c:_init_mirror_log()).  We copy the
tags temporarily for the new LV and remove them after the activation.
2012-05-05 02:08:46 +00:00
Jonathan Earl Brassow
1e4e9548b1 Disallow snapshots of mirror segment types.
Snapshots of RAID logical volumes are allowed (including "raid1").  However,
snapshots of "mirror" logical volumes has been disallowed due to unsolvable
issues inherent to the design.  The fact that mirroring (dm-raid1.c) must
stop all I/O as the result of a failure and wait for userspace intervention
can lead to a circular dependency if userspace is simultaneously waiting for
snapshots (on mirrors) to make an I/O update before proceeding.

Various snapshot on mirror tests have been removed as a result.
2012-05-01 19:21:24 +00:00
Zdenek Kabelac
dd11efb673 Expect failure if the reduction doesn't really happen 2012-04-24 12:17:49 +00:00
Zdenek Kabelac
83eeeb59ed Update test 2012-04-11 12:53:46 +00:00
Zdenek Kabelac
a59c3731c3 Improve test suite
Add make help target.
Add LVM_TEST_PARALLEL to support parallel runs of tests
Work around the problem the dmsetup table/info may return error
by using dmtable and dminfo function that will use 'should'.
(Error happens when some concurently running process removes table
entry while dmsetup command resolves table entries inside the loop.)
2012-03-28 11:10:08 +00:00
Peter Rajnoha
9e072e7072 Fix tests to work with vgscan --cache fixing inconsistent metadata. 2012-03-28 07:46:35 +00:00
Zdenek Kabelac
86bdfb3722 Improve teardown_devs
Try to avoid start of dmeventd during vgremove if the code has any bug
inside.
2012-03-23 09:41:20 +00:00
Zdenek Kabelac
8100989dbb Sleep longer in the test so it really dies properly
and check for right exit code from pgrep
2012-03-20 13:35:46 +00:00
Zdenek Kabelac
ef199faeda Update testing scripts
Make the teardown really usable - it will try down to remove all the left
devices even from previous test runs
(the only missing piece is probably proper mdadm teardown)
Add few more local vars
Try to setup PATH and LD_LIBRARY_PATH just once.
Try shorter sleeps.
2012-03-20 10:51:57 +00:00
Zdenek Kabelac
758f674240 Update test for dmevent restart
Actually restart was failing for different reason - so pass in proper
location of dmeventd for restart from lvm command and avoid using
the one from /sbin location.

Update pv create test with "" around path.
2012-03-20 10:48:59 +00:00
Zdenek Kabelac
fad6a65f3c Add comment about slow startup of dmeventd
Separat lvm dumpconfig on extra line, so the shell trace output
is not mixed with dump.
2012-03-16 19:13:09 +00:00
Zdenek Kabelac
171d7d5793 Skip dmeventd restart test
If dmevendt is not in /sbin, do not try to run restarting test.
FIXME: add some workaround for testing.
2012-03-16 19:11:29 +00:00
Zdenek Kabelac
e79d64b52b Regression fix kernel version check
got changed improperly with large update patch.
2012-03-16 19:09:49 +00:00
Zdenek Kabelac
358b3ce26b Longer sleep after clvmd start 2012-03-16 19:08:09 +00:00
Zdenek Kabelac
6bf324c4fd Switch condition for dmeventd check 2012-03-16 13:44:51 +00:00