1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

1353 Commits

Author SHA1 Message Date
Petr Rockai
fa46385164 test: Write a results/list at the end of a test run. 2015-02-05 13:47:17 +01:00
Petr Rockai
bf16937869 test: Clean up fds properly in the runner. 2015-02-05 13:47:16 +01:00
Petr Rockai
d2dbc65f00 test: Implement journalling and --continue. 2015-02-05 13:47:16 +01:00
Petr Rockai
9dfbce0aa7 test: Split up the new runner into multiple files. 2015-02-05 13:47:16 +01:00
Petr Rockai
b726d66882 test: Use the new runner in make check. 2015-02-05 13:47:16 +01:00
Petr Rockai
1ec2023cbf test: Build the new test runner. 2015-02-05 13:47:16 +01:00
Petr Rockai
f476655fee test: Import first draft of a new test runner. 2015-02-03 08:49:35 +01:00
Zdenek Kabelac
71e88f761d tests: add --force to sfdisk
Avoid udev sync troubles for now.
2015-01-30 16:46:06 +01:00
Zdenek Kabelac
d021284bcf tests: test stacked raid 2015-01-30 12:33:52 +01:00
Zdenek Kabelac
4f1309080a thin: preserve chunksize with lvconvert
When repairing thin pool or swapping thin pool metadata,
preserve  chunk_size property and avoid to be automatically changed
later in the code to better match thin pool metadata size.
2015-01-28 15:15:52 +01:00
Zdenek Kabelac
93b9015760 raid: fix raid image splitting
When raid leg is extracted, now the preload code handles this state
correctly and put proper new table entry into dm tree,
so the activation of extracted leg and removed metadata works
after commit.
2015-01-28 13:45:18 +01:00
Peter Rajnoha
8804023825 tests: pvscan --cache DevicePath does not fail if the device is just filtered
It's not an error if the device is filtered out and hence cleared from
lvmetad cache - "pvscan --cache DevPath" has now the same behaviour in
this case as "pvscan --cache major:minor" (which is more consistent).

Before, the tests expected failure return code for "pvscan --cache DevicePath"
if the device was filtered (which is a different situation if the device
is missing in the system completely!).
2015-01-12 15:16:57 +01:00
Peter Rajnoha
99d895014d dev-type: filter out partitioned device-mapper devices as unsuitable for use as PVs
Normally, if there are partitions defined on top of device-mapper
device, there should be a device-mapper device created for each
partiton on top of the old one and once the underlying DM device
is used by another devices (partition mappings in this case),
it can't be used as a PV anymore.

However, sometimes, it may happen the partition mappings are
missing - either the partitioning tool is not creating them if
it does not contain full support for device-mapper devices or
the mappings were removed.

Better safe than sorry - check for partition header on DM devs
and filter them out as unsuitable for PVs in case the check is
positive. Whatever the user is doing, let's do our best to prevent
unwanted corruption (...by running pvcreate on top of such device
that would corrupt the partition header).
2015-01-12 14:10:44 +01:00
Petr Rockai
e97023804a pvremove: Avoid metadata re-reads & related error messages. 2015-01-06 14:27:30 +01:00
Peter Rajnoha
57af48d734 report: fix segfault on NULL value hit in cache_settings field
We have to use empty list, not NULL if we want to denote that the list
has no items. Otherwise, the code further can segfault as it expects
there's always a sane value (= some list), including empty list,
but never NULL.
2014-12-18 17:26:12 +01:00
Petr Rockai
00ad13eb71 report: Add cache_policy and cache_settings (LV) segment fields. 2014-12-17 14:43:12 +01:00
Zdenek Kabelac
f3bd9a2797 raid: properly rename split image
When we split leg from raid - we take a proper new lock for a new LV.
However for now activation checks only 'existince' of device UUID,
but it's not validating device has a proper name.

As a quick fix call suspend()/resume() to rename after split mirror.
2014-12-05 13:39:42 +01:00
Petr Rockai
5b2726fc61 lvcreate: Implement --cachepolicy/--cachesettings. 2014-11-27 20:22:03 +01:00
Zdenek Kabelac
4bfdb01f78 toollib: fix regression in parsing /dev/mapper/vg-lv
Commit b0dde9e8f0 introduced regression in parsing
/dev/mapper prefix - and tried to check for '/' one char behind.
2014-11-26 17:29:35 +01:00
Zdenek Kabelac
2de11c9e9e thin: add missing 64KB rounding
When chunk size needs to be estimated, the code missed to round
to proper 64kb boundaries  (or power of 2 for older thin pool driver).
So for some data and metadata size (i.e. 10GB and 4MB) it resulted
in incorrect chunk size (not being a multiple of 64KB)

Fix it by adding proper rounding and also use 1 routine for 2 places
where the same calculation is made.

Fix also incorrect printed warning that has used 'ffs()'
(which returns first 'least significant' bit in word)
and it was not really giving any useful size info and replace it
with properly estimated chunk size.
2014-11-26 09:29:25 +01:00
Zdenek Kabelac
74e6135c4f tests: use proper LVMTEST prefix for VG name
Cleaner needs prefix to do its jobs and clean any left VG from python
test as well.
2014-11-24 14:39:04 +01:00
Zdenek Kabelac
1e80265c36 lvconvert: earlier detection of conflicting names
Detect same LV names for lvconvert prior opening VG.
i.e. lvconvert --thinpool vg/lvol0  -T lvol0
2014-11-24 14:39:04 +01:00
Zdenek Kabelac
8eb111dfb8 pool: prevent pool conversion with same name
When same name is given for converted volume and pool volume,
stop further command processing.
2014-11-23 00:49:04 +01:00
Zdenek Kabelac
0782309713 tests: reduce thin test 2014-11-22 18:51:02 +01:00
Zdenek Kabelac
4607cbcb0d tests: use old virt snaps in the test
Don't use thin with its thin requirements for the test.
2014-11-22 18:51:02 +01:00
Petr Rockai
71271cf905 test: Also test repeated --cachesettings in lvchange-cache. 2014-11-20 16:51:07 +01:00
Petr Rockai
c75ae0846e cache: Implement 'default' as a policy settings value to clear the record. 2014-11-20 16:51:07 +01:00
Petr Rockai
4b9b8e1282 toollib: Split --cachesettings from --cachepolicy. 2014-11-20 16:51:07 +01:00
Petr Rockai
310beb73a8 test: Add a test for lvchange --cachepolicy. 2014-11-20 16:51:07 +01:00
Zdenek Kabelac
8d8c1b6624 tests: use snapshot targets 2014-11-19 23:24:18 +01:00
Zdenek Kabelac
c75548300d tests: prepare control node before clvmd
Make sure there is 'control' node before clvmd is started.
Somehow  'clvmd' is not allowed by selinux to create one.

TODO: Check is selinux policy is right here...
2014-11-19 23:22:52 +01:00
Zdenek Kabelac
542b03ee00 tests: deactivate repaired before swap 2014-11-17 08:44:53 +01:00
Zdenek Kabelac
740fcdae7d tests: thin repair testing
More checks for thin related tools.
Add same functionality for cache related tools.
2014-11-17 00:41:33 +01:00
Zdenek Kabelac
3a1c609ac4 tests: reduce number of sync waiting
Lets assume faster systems, if we have too big raid arrays,
reduce them.
2014-11-17 00:34:44 +01:00
Zdenek Kabelac
776934aa08 tests: skip another older kernel from raid456 2014-11-17 00:32:49 +01:00
Zdenek Kabelac
27182e1ddb tests: explicit raid sync 2014-11-14 18:12:44 +01:00
Zdenek Kabelac
8cb79dad0b pool: fix removal of pool metadata spare
Since we support device stack of pools over pool
(thin-pool with cache data volume) the existing code
is no longer able to detect orphan _pmspare.

So instead do a _pmspare check after volume removal,
and remove spare afterwards.
2014-11-13 13:09:07 +01:00
Zdenek Kabelac
094596cfd2 tests: reach cache params 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
10ebabdd2a tests: cache snapshot 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
cebbda0931 tests: duplicate update of config 2014-11-04 15:29:22 +01:00
Zdenek Kabelac
847b2aa5b4 tests: thin 2014-11-03 14:19:34 +01:00
Zdenek Kabelac
e4e96f6b19 tests: usage of -m0 -Mn
Test -m0 passed with types.
Check --readahead and thins.
2014-11-03 14:19:34 +01:00
Zdenek Kabelac
e09ee21fd4 tests: update raid sync 2014-10-31 00:37:35 +01:00
Zdenek Kabelac
47d50a8f27 tests: wait for raid sync 2014-10-31 00:31:54 +01:00
Zdenek Kabelac
e7c130430a tests: explicitely use old snapshots 2014-10-31 00:28:25 +01:00
Zdenek Kabelac
8926230f6e tests: lvcreate snapshot usage update 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
b58a0f5cd3 tests: use aux func to disable device 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
da61e6355e tests: raid syncaction test
Add sync wait for syncaction of raid1 test.
--syncaction requires raid to be in sync first.
2014-10-30 23:58:49 +01:00
Peter Rajnoha
7049eeeb83 test: for issue fixed in previous commit 2f7f6932dc 2014-10-27 11:53:01 +01:00
Zdenek Kabelac
e223c801fc pools: workaround hints
Missing code for stacked hint estimation
2014-10-26 19:45:17 +01:00
Zdenek Kabelac
c28a7706ed tests: update cache creation tests 2014-10-26 18:37:13 +01:00
Zdenek Kabelac
7bbf3cf306 tests: lvcreate-update
Test with old mirror type.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
70616187b3 tests: pytest update 2014-10-26 18:37:13 +01:00
Zdenek Kabelac
c3bb9629a8 tests: syncaction needs kernel fix
Add 'should' as we currently cannot pass this test.

FIXME:
Add properly wrapper to not use 'should' with fixed kernel.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
e1dede6f6b tests: new lvcreate functionality
Fixed syntax parsing means that some commands that used to work are now
failing. Particullary this case:

$ invalid lvcreate -l1 --type thin vg/pool
> Needs to fail becase thin type LV needs  --virtualsize

$ invalid lvcreate --type snapshot vg/lv1
> Needs to fail because old-snapshot segment type needs --size

Some reported error messages have been also updated.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
9642f013a1 tests: lvcreate usage 2014-10-24 16:39:32 +02:00
Petr Rockai
22a6b0e40b lvchange: Allow appropriate actions on cache (in addition to thin) pools. 2014-10-13 16:21:41 +02:00
Petr Rockai
d623034e62 test: Fix lvconvert-raid-allocation's use of lvconvert --repair. 2014-10-07 16:12:04 +02:00
Zdenek Kabelac
62802ddae0 tests: typos 2014-10-07 10:19:33 +02:00
Zdenek Kabelac
236db9fc0d tests: put devs into "" 2014-10-07 10:19:33 +02:00
Zdenek Kabelac
75c4d268e9 tests: check for cache and raid
Skip some tests on systems without cache or raid.
2014-10-07 10:19:33 +02:00
Zdenek Kabelac
c59ef73206 tests: move cache raid to separate file 2014-10-07 10:19:33 +02:00
Petr Rockai
b836525d9c test: Creating a cache on top of active RAID works now. 2014-10-07 09:32:24 +02:00
Petr Rockai
b66f16fd63 lvconvert: Allow --repair and --splitmirrors on reserved-name LVs. 2014-10-07 08:58:24 +02:00
David Teigland
86dad329be test: Add process-each toollib tests. 2014-10-07 01:15:43 +01:00
Zdenek Kabelac
fa517221a1 tests: lvconvert cache usage of thin pool
Checked stacking usage of thin pool data volume being cached.
2014-10-06 15:31:44 +02:00
Zdenek Kabelac
742d250cc5 tests: lvconvert thin pool
More tests.
2014-10-06 15:31:44 +02:00
Zdenek Kabelac
c243cf6581 tests: lvconvert cache
Many new tests
2014-10-06 15:31:44 +02:00
Zdenek Kabelac
52821572d5 tests: lvcreate external origin
Fix unsupportable case.
We cannot create thinpool and snapshot at the same time.
(-L could not have 2 meanings).
2014-10-06 15:31:33 +02:00
Zdenek Kabelac
de0e6029f1 tests: lvcreate thin-pool support --name 2014-10-06 15:23:08 +02:00
Zdenek Kabelac
4baf4b8cf9 tests: lvcreate cache interface updates 2014-10-06 15:23:08 +02:00
Petr Rockai
072e25a965 test: Show an activation bug in lvcreate of a cache over raid. 2014-10-06 08:11:42 +02:00
Petr Rockai
d2f901f04f lvconvert: Forward --splitmirror to a cache origin when applicable. 2014-10-06 08:11:06 +02:00
Peter Rajnoha
d3fb69c3f3 cleanup: remove symlink to profile in test dir for CLEAN target 2014-10-02 09:30:38 +02:00
Zdenek Kabelac
21aa850b43 tests: add helper funcionality for using gdb
When there is need for using gdb within test suite
just prefix command with LVM_DBG and run test in
standard shell (for stdin).
2014-09-24 10:54:48 +02:00
Zdenek Kabelac
9acbb0695f tests: drop * from dmsetup
We cannot use shell expansion for dmsetup here.
2014-09-24 10:54:48 +02:00
Zdenek Kabelac
98414ca7dd vgchange: support clustered conversion for active lv
If we want to support conversion of VG to clustered type,
we currently need to relock active LV to get proper DLM lock.

So add extra loop after change of VG clustered attribute
to exlusively activate all active top level LVs.

When doing change -cy -> -cn  we should validate LVs are not
active on other cluster nodes - we could be sure about this only
when with local exclusive activation - for other types
we require user to deactivate volumes first.

As a workaround for this limitation there is always
locking_type = 0 which amongs other skip the detection
of active LVs.

FIXME:
 clvmd should handle looks for cluster locking type all the time.
2014-09-17 14:41:42 +02:00
Zdenek Kabelac
4a853361b0 vgchange: disable cluster convert for active LVs
While we could probably reacquire some type of lock when
going from non-clustered to clustered vg, we don't have any
single road back to drop the lock and keep LV active.

For now keep it safe and prohibit conversion when LV
is active in the VG.
2014-09-16 11:42:41 +02:00
Zdenek Kabelac
10a448eb2f tests: update lv_no_exists
On successful exit path remove debug.log file.
2014-09-15 13:51:19 +02:00
Zdenek Kabelac
f435bef957 test: test there is no leak of LV on error path 2014-09-15 13:51:19 +02:00
Zdenek Kabelac
4748f4a9e4 tests: test for rename of snapshot 2014-09-10 22:59:13 +01:00
Petr Rockai
671d0ea1b1 lvmetad: Differentiate between filtered and truly missing devices.
We used to print an error message whenever we tried to deal with devices that
lvmetad knew about but were rejected by a client-side filter. Instead, we now
check whether the device is actually absent or only filtered out and only print
a warning in the latter case.
2014-09-10 22:58:22 +01:00
Petr Rockai
5f9b30d178 test: Add a test for MD component detection in pvscan --cache. 2014-09-10 22:58:12 +01:00
Zdenek Kabelac
55aa3cc813 tests: test for rename of snapshot 2014-09-09 20:17:47 +02:00
Zdenek Kabelac
70e998754e tests: thin and volume_list testing 2014-08-26 14:13:07 +02:00
Zdenek Kabelac
c37ca279e3 tests: fix volume list test
Proper use of \" escaping and shell vars.
2014-08-26 14:13:07 +02:00
Zdenek Kabelac
473a4a6548 tests: proper /dev access
Commit 5ebff6cc9f seemed to introduce
new 'for' loop but the mode is not yet used.
But the access to /dev dir needs to go through $DM_DEV_DIR
and whole path needs to be in "".
2014-08-20 14:37:41 +02:00
Peter Rajnoha
20503ff067 tests: update report-select test for latest changes 2014-08-13 17:20:09 +02:00
Petr Rockai
03a88da868 test: Add a test for lvscan --cache. 2014-08-04 17:03:17 +02:00
Marian Csontos
0dc3684b87 test: Skip lvextend-thin when thin not available 2014-07-31 22:56:19 +02:00
Petr Rockai
c4484d9050 test: Add a test for lvextend -l+100%FREE of a striped thin pool. 2014-07-30 16:17:29 +02:00
Zdenek Kabelac
8d63d94d85 tests: still unusable kernel 2014-07-23 00:29:32 +02:00
Zdenek Kabelac
22be7c4417 tests: support cluster run
needs exclusive activation
2014-07-23 00:25:49 +02:00
Zdenek Kabelac
3a8bb8d3a4 tests: use exclusive activation 2014-07-22 23:44:06 +02:00
Zdenek Kabelac
653fd7bee3 tests: new lvconvert features 2014-07-22 22:41:41 +02:00
Zdenek Kabelac
ee11bb8416 tests: use full option name
Don't overuse shortcut support -
since poolmetadatasize was the only allowed option
it's been equivalent to poolmetadata
2014-07-22 22:41:41 +02:00
Zdenek Kabelac
27574d0e41 tests: use bigger metadata
Until resolved - use bigger then 4MB cache pool metadata.
2014-07-17 16:27:39 +02:00
Zdenek Kabelac
d7065f154e tests: updates for new lvconvert 2014-07-11 13:32:52 +02:00
Zdenek Kabelac
56c5ad7b19 lvconvert: snapshot prompts to confirm conversion
Since the type passed LV is changed and content of data detroyed,
query user with prompt to confirm this operation.
Also add a proper wiping of header.

Using '--yes' will skip this prompt:

lvconvert -s --yes vg/lv vg/lvcow
2014-07-11 12:49:55 +02:00
Jonathan Brassow
f33d75e2e5 test: Test failing due to too few PVs
Commit 33d69162e4 reduced the number of
PVs to a level where the test could not function.  (It is impossible
to replace 3 PVs of a 4-way RAID1 LV if there are only 5 PVs.)
2014-07-10 18:53:46 -05:00
Peter Rajnoha
1e5ec893c7 tests: LV's zero field now reported as binary field 2014-07-10 15:30:28 +02:00
Peter Rajnoha
6dc7b783c8 metadata: fix regression causing PVs not in VGs to be marked as allocatable
If the PV is not yet in a VG, it's not allocatable.
A regression introduced by commit 0283c439ec
(_pv_create) and later commit a7ca101517
(pv_read).
2014-07-07 14:07:21 +02:00
Zdenek Kabelac
c6811dd512 tests: ensure data hits cow 2014-07-02 15:10:10 +02:00
Zdenek Kabelac
d1094ec4c6 tests: replace cat with $(<
Use shell built-in $(<
Print lvm.conf in use for test.
2014-07-02 10:45:44 +02:00
Zdenek Kabelac
b22ab4dab0 tests: avoid hiding results in local
There is a difference between:

local a=$(shell)

and

local a
a=$(shell)

The first return exit code from shells' local command.
2014-07-02 10:45:43 +02:00
Jonathan Brassow
ed3c2537b8 raid: Allow repair to reuse PVs from same image that suffered a PV failure
When repairing RAID LVs that have multiple PVs per image, allow
replacement images to be reallocated from the PVs that have not
failed in the image if there is sufficient space.

This allows for scenarios where a 2-way RAID1 is spread across 4 PVs,
where each image lives on two PVs but doesn't use the entire space
on any of them.  If one PV fails and there is sufficient space on the
remaining PV in the image, the image can be reallocated on just the
remaining PV.
2014-06-25 22:26:06 -05:00
Jonathan Brassow
b35fb0b15a raid/misc: Allow creation of parallel areas by LV vs segment
I've changed build_parallel_areas_from_lv to take a new parameter
that allows the caller to build parallel areas by LV vs by segment.
Previously, the function created a list of parallel areas for each
segment in the given LV.  When it came time for allocation, the
parallel areas were honored on a segment basis.  This was problematic
for RAID because any new RAID image must avoid being placed on any
PVs used by other images in the RAID.  For example, if we have a
linear LV that has half its space on one PV and half on another, we
do not want an up-convert to use either of those PVs.  It should
especially not wind up with the following, where the first portion
of one LV is paired up with the second portion of the other:
------PV1-------  ------PV2-------
[ 2of2 image_1 ]  [ 1of2 image_1 ]
[ 1of2 image_0 ]  [ 2of2 image_0 ]
----------------  ----------------
Previously, it was possible for this to happen.  The change makes
it so that the returned parallel areas list contains one "super"
segment (seg_pvs) with a list of all the PVs from every actual
segment in the given LV and covering the entire logical extent range.

This change allows RAID conversions to function properly when there
are existing images that contain multiple segments that span more
than one PV.
2014-06-25 21:20:41 -05:00
Jonathan Brassow
1f1675b059 test: Test addition to show incorrect allocator behavior
If a RAID LV has images that are spread across more than one PV
and you allocate a new image that requires more than one PV,
parallel_areas is only honored for one segment.  This commit
adds a test for this condition.
2014-06-21 15:33:52 -05:00
Zdenek Kabelac
93597bcbdc tests: add udev sync point
Missed synchronization with udev may lead to error on vgcreate,
if previous vgremove was not handled fast enough by udev.
2014-06-20 11:14:29 +02:00
Zdenek Kabelac
bc0a1ca83d tests: remove dmeventd usage
This test is testing --use-policies on cmdline.
So monitoring must not be used.
2014-06-19 12:48:21 +02:00
Jonathan Brassow
57faf97e6f test: Clean-up pvmove-basic for atomic pvmove test
The way I was testing for the existence of pvmove mimages was
incorrect for rhel5.  This patch makes it more generic/universal.
2014-06-18 15:40:06 -05:00
Peter Rajnoha
0548a82e63 cleanup: gcc warnings and report-select test vs snap_percent 0%
Fix gcc warnings:
libdm-report.c:1952:5: warning: "end_op_flag_hit" may be used uninitialized in this function [-Wmaybe-uninitialized]
libdm-report.c:2232:28: warning: "custom" may be used uninitialized in this function [-Wmaybe-uninitialized]

And snap_percent is not 0% in dm < 1.10.0 so
don't test comparison with 0% here.
2014-06-18 13:26:47 +02:00
Jonathan Brassow
5ebff6cc9f pvmove: Enable all-or-nothing (atomic) pvmoves
pvmove can be used to move single LVs by name or multiple LVs that
lie within the specified PV range (e.g. /dev/sdb1:0-1000).  When
moving more than one LV, the portions of those LVs that are in the
range to be moved are added to a new temporary pvmove LV.  The LVs
then point to the range in the pvmove LV, rather than the PV
range.

Example 1:
	We have two LVs in this example.  After they were
	created, the first LV was grown, yeilding two segments
	in LV1.  So, there are two LVs with a total of three
	segments.

	Before pvmove:
	      ---------  ---------   ---------
	      | LV1s0 |  | LV2s0 |   | LV1s1 |
	      ---------  ---------   ---------
	         |           |           |
	   -------------------------------------
	PV | 000 - 255 | 256 - 511 | 512 - 767 |
	   -------------------------------------

	After pvmove inserts the temporary pvmove LV:
	          ---------   ---------   ---------
	          | LV1s0 |   | LV2s0 |   | LV1s1 |
	          ---------   ---------   ---------
	              |           |           |
	        -------------------------------------
	pvmove0 |   seg 0   |   seg 1   |   seg 2   |
	        -------------------------------------
	              |           |           |
	        -------------------------------------
	PV      | 000 - 255 | 256 - 511 | 512 - 767 |
	        -------------------------------------

	Each of the affected LV segments now point to a
	range of blocks in the pvmove LV, which purposefully
	corresponds to the segments moved from the original
	LVs into the temporary pvmove LV.

The current implementation goes on from here to mirror the temporary
pvmove LV by segment.  Further, as the pvmove LV is activated, only
one of its segments is actually mirrored (i.e. "moving") at a time.
The rest are either complete or not addressed yet.  If the pvmove
is aborted, those segments that are completed will remain on the
destination and those that are not yet addressed or in the process
of moving will stay on the source PV.  Thus, it is possible to have
a partially completed move - some LVs (or certain segments of LVs)
on the source PV and some on the destination.

Example 2:
	What 'example 1' might look if it was half-way
	through the move.
	             ---------   ---------   ---------
	             | LV1s0 |   | LV2s0 |   | LV1s1 |
	             ---------   ---------   ---------
	                 |           |           |
	           -------------------------------------
	pvmove0    |   seg 0   |   seg 1   |   seg 2   |
	           -------------------------------------
	                 |           |           |
	                 |     -------------------------
	source PV        |     | 256 - 511 | 512 - 767 |
	                 |     -------------------------
	                 |           ||
	           -------------------------
	dest PV    | 000 - 255 | 256 - 511 |
	           -------------------------

This update allows the user to specify that they would like the
pvmove mirror created "by LV" rather than "by segment".  That is,
the pvmove LV becomes an image in an encapsulating mirror along
with the allocated copy image.

Example 3:
	A pvmove that is performed "by LV" rather than "by segment".

	                   ---------   ---------
	                   | LV1s0 |   | LV2s0 |
	                   ---------   ---------
	                       |           |
	                 -------------------------
	        pvmove0  |  * LV-level mirror *  |
	                 -------------------------
                             /                \
	   pvmove_mimage0   /          pvmove_mimage1
	   -------------------------   -------------------------
	   |   seg 0   |   seg 1   |   |   seg 0   |   seg 1   |
	   -------------------------   -------------------------
	        |            |               |           |
	   -------------------------   -------------------------
	   | 000 - 255 | 256 - 511 |   | 000 - 255 | 256 - 511 |
	   -------------------------   -------------------------
	           source PV                    dest PV

The thing that differentiates a pvmove done in this way and a simple
"up-convert" from linear to mirror is the preservation of the
distinct segments.  A normal up-convert would simply allocate the
necessary space with no regard for segment boundaries.  The pvmove
operation must preserve the segments because they are the critical
boundary between the segments of the LVs being moved.  So, when the
pvmove copy image is allocated, all corresponding segments must be
allocated.  The code that merges ajoining segments that are part of
the same LV when the metadata is written must also be avoided in
this case.  This method of mirroring is unique enough to warrant its
own definitional macro, MIRROR_BY_SEGMENTED_LV.  This joins the two
existing macros: MIRROR_BY_SEG (for original pvmove) and MIRROR_BY_LV
(for user created mirrors).

The advantages of performing pvmove in this way is that all of the
LVs affected can be moved together.  It is an all-or-nothing approach
that leaves all LV segments on the source PV if the move is aborted.
Additionally, a mirror log can be used (in the future) to provide tracking
of progress; allowing the copy to continue where it left off in the event
there is a deactivation.
2014-06-17 22:59:36 -05:00
Peter Rajnoha
b16f5633ab test: fix report_select test to work in cluster
The snapshot LV is used to check selection of percent values.
The orig volume must be activated exclusively in cluster.
2014-06-17 18:34:46 +02:00
Peter Rajnoha
ef43a50926 tests: update lvcreate-thin for latest changes
With recent changes introduced with the report selection support,
the content of lv_modules field is of string list type (before
it was just string type).

String list elements are always ordered now so update lvcreate-thin
test to expect the elements to be ordered.
2014-06-17 18:20:08 +02:00
Peter Rajnoha
0d8e94ce2e tests: select: add test for report selection feature 2014-06-17 16:27:21 +02:00
Peter Rajnoha
cfed0d09e8 report: select: refactor: move percent handling code to libdm for reuse 2014-06-17 16:27:21 +02:00
Zdenek Kabelac
378fa9d158 tests: check new snapshot skills 2014-06-17 13:43:05 +02:00
Zdenek Kabelac
8403bbd4ad tests: detect version of thin_restore command
Skip test when missing.
2014-06-17 13:43:05 +02:00
Zdenek Kabelac
6fb19f37fe tests: wait for udev
Before test exits, wait for udev.
2014-06-17 13:43:04 +02:00
Jonathan Brassow
962a40b981 cache: Properly rename origin LV tree when adding "_corig"
When creating a cache LV with a RAID origin, we need to ensure that
the sub-LVs of that origin properly change their names to include
the "_corig" extention of the top-level LV.  We do this by first
performing a 'lv_rename_update' before making the call to
'insert_layer_for_lv'.
2014-06-16 18:15:39 -05:00
Zdenek Kabelac
cf4d5ead02 test: pvs bz1108394 2014-06-12 11:56:06 +02:00
Zdenek Kabelac
c230ae95ab tests: change to inittest 2014-06-11 17:46:55 +02:00
Zdenek Kabelac
3f81b7c55c tests: update vgchange -c
Vgchange now detects runnig clvmd - so update test to reflect this.
2014-06-11 11:11:10 +02:00
Peter Rajnoha
6766cdc8a1 tests: some more renames lib/test -> lib/inittest 2014-06-11 11:07:32 +02:00
Zdenek Kabelac
5c5177c37c tests: rename test to inittest
We are getting into problem when we use 'test' for commands like
should/not/...

So avoid overloading test name and change it to inittest.
2014-06-10 10:51:27 +02:00
Zdenek Kabelac
9f68aadb74 tests: make timeouts longer
Add more time for tests, since debug kernels are getting slower...
and we add more and more tests.

However many test should be shortened to avoid testing disk-perfomance
and focus on lvm functionality...
(Often we should probably test with inactive volumes when we check
metadata operation of lvm2)

We may need to support option for 'DEEP' longer testing.

Also something like LVM_TEST_TIMEOUT_FACTOR might be useful
though it would be much better if test suite could approximete
from system perfomance test lenght...
2014-06-10 10:51:26 +02:00
Petr Rockai
4bb1efe2fb test: Reflect that --sysinit only treats lvmetad specially with -aay (not -ay). 2014-06-08 23:37:08 +02:00
Petr Rockai
ee200ddfc3 pvremove: Update lvmcache => avoid spurious error messages. 2014-06-08 22:57:04 +02:00
Petr Rockai
150165591f test: Try harder to vgremove in lvmetad-lvm1.sh. 2014-06-08 22:01:02 +02:00
Petr Rockai
b3bdd41092 lvm1: Fail vg_write graciously when devices are missing. 2014-06-08 21:57:18 +02:00
Petr Rockai
60443d6a5d test: Fix the vgck test after vg_write change. 2014-06-08 21:10:47 +02:00
Petr Rockai
f58a7f305b test: Fail devices silently in lvconvert-repair-transient.sh. 2014-06-08 21:10:47 +02:00
Petr Rockai
eda4c3a41d test: Make it possible to enable/disable devices silently. 2014-06-08 21:10:47 +02:00
Peter Rajnoha
14f482077d cleanup: default.profile is not used (and it was split in two and renamed anyway) 2014-06-06 10:24:50 +02:00
Zdenek Kabelac
de12310c45 tests: disable python failing test
Aborts and needs fixes...
2014-06-05 23:07:23 +02:00
Zdenek Kabelac
7b8133e0b2 tests: fix test compare
Comparing 64T can't use -eq
2014-06-05 23:06:45 +02:00
Zdenek Kabelac
eb7ca96b59 tests: adapt test for newline delimit
content of DEVICES is now delimited by newlines
2014-06-05 23:05:52 +02:00
Zdenek Kabelac
c4e0c61272 tests: typo 2014-06-05 17:49:35 +02:00
Zdenek Kabelac
54da0ea61a tests: use get_devs
Check how get_devs is usable with shell array DEVICES
2014-06-05 17:49:35 +02:00
Zdenek Kabelac
77d4e317a4 tests: use manglename none for dmsetup 2014-06-05 17:49:34 +02:00
Zdenek Kabelac
9196942312 tests: add get_devs function
Instead of rereading device list via cat - keep
the list in bash array. (Also solves problem
with spaces in device path)

Move usage of  "$path" out of lvm shell usage,
since we don't support such thing there...
2014-06-05 17:49:34 +02:00
Zdenek Kabelac
223bdc5eb2 tests: use shell arrays to keep device names
Better preserving spaces in device path name,
though admitely rest of test suite need
more repairs...
2014-06-05 17:49:34 +02:00
Zdenek Kabelac
21db25b3c4 tests: fix use of double apostrophes in get
Need to put "" around parameters.
2014-06-05 17:49:34 +02:00
Jonathan Brassow
4454a580df test: use direct I/O when injecting bad data into RAID images
When directly corrupting RAID images for the purpose of testing,
we must use direct I/O (or a 'sync' after the 'dd') to ensure that
the writes are not caught in the buffer cache in a way that is not
reachable by the top-level RAID device.
2014-05-30 17:26:10 -05:00
Zdenek Kabelac
8212dac849 tests: rename test 2014-05-28 15:41:06 +02:00
Zdenek Kabelac
171a668e81 tests: dd needs to hit disk
Unsure if this is feature or bug of syncaction,
but it needs to be present physically on the media
and it ignores content of buffer cache...

(maybe lvchange should implicitely fsync all disks
that are members of raid array before starting test??)
2014-05-28 15:33:41 +02:00
Zdenek Kabelac
ba3e6e7c32 tests: raid syncaction activation race
Demonstrace problem of syncaction being called right after activation.
2014-05-28 15:33:41 +02:00
Zdenek Kabelac
a67774c1fa tests: detect same uuid on PV
Check we know how to handle same UUID
Test  currently does NOT work on lvmetad
(or it's unclear it even should - thus test error
is currently lowered to 'test warning')

TODO: replace lib/test with a better shell script name
2014-05-27 17:09:05 +02:00
Zdenek Kabelac
b3539907f5 tests: support thin_restore configurable
Currently this tool is used only in tests.
2014-05-26 23:30:09 +02:00