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

1954 Commits

Author SHA1 Message Date
Heinz Mauelshagen
532388fad5 lvconvert: fix failing valid regionsize change
Reshape check failed when regionsize changed and current raid type
was provided with no other change requested (stripes or stripesize).

E.g. "lvconvert --type raid6 --regionsize 256K" on a raid6 LV
with != 256K regionsize.

Enable --type in test script.
2017-04-12 14:38:49 +02:00
Heinz Mauelshagen
0f65d7ec3a lvconvert: prompt on raid1 image changes
Don't change resilience of raid1 LVs without --yes.

Adjust respective tests.
2017-04-06 18:47:41 +02:00
Zdenek Kabelac
fb1f38a6f6 tests: fix LD_LIBRARY_PATH
Use only selected paths for finding .so in builddir.
So if builddir constains some embeded subdirs with some more
occurences of project (i.e.  'make rpm' build subdir)
those library paths will not get into list.
2017-03-31 17:12:00 +02:00
Zdenek Kabelac
df86ee8c21 tests: fix typo in makefile
Use properly $(SORT)
2017-03-30 00:38:41 +02:00
Zdenek Kabelac
88e408b8ed tests: update to better fit
Die is automatic on 'error' result
Cleanup everything on 'regular' code path.
2017-03-27 20:50:19 +02:00
Zdenek Kabelac
17b56a4aed tests: early detect leaking error dev
lvconvert should not leak 'error' device.

(This patch is not fix the problem, just makes it more easily visible
instead of more confusing 'clvmd' trace).
2017-03-20 14:18:50 +01:00
Zdenek Kabelac
07ea9887d3 tests: raise min dm cache version
Since we want to test different cache policies with profiles mq&smq
raise version to 1.8.

TODO: maybe split in more tests so older targets can test here as well.
N.B.: passthrough is also not supported with version 1.3
2017-03-17 14:22:33 +01:00
Heinz Mauelshagen
17bee733d1 raid: conditionally reject convert to striped/raid0*
If SubLVs to be removed still exist after an image removing
conversion (i.e. "lvconvert --yes --force --stripes N "
with N < total stripes) any request to convert to a different
striped/raid* level has to be rejected until after those freed
SubLVs got removed by running the aforementioned lvconvert again.

Add tests to check conversion to striped/raid* gets rejected.
Enhance a test comment.

Related: rhbz1191935
Related: rhbz1366296
2017-03-17 13:58:54 +01:00
Heinz Mauelshagen
b0336e8b3c lvconvert: ensure upconversion restrictions
Ensure minimum number of 3 data stripes on conversions to raid6.

Add test for it.

Resolves: rhbz1432675
2017-03-16 22:10:32 +01:00
Heinz Mauelshagen
76b843a4bf test: adjust to proper dm-raid target version
Adjust to final target version 1.10.1 supporting reshape
properly and to recently changed report field specifications
(e.g. rehape_len_le) to allow these tests to run.

Lower mirror region size to suite the tiny test VG.
2017-03-16 21:17:58 +01:00
Zdenek Kabelac
51b9de7249 tests: better disk delay
Delay only writable extents.
Skip zeroing for earlier lvcreate finish.
2017-03-16 08:49:52 +01:00
Zdenek Kabelac
7fa08ae4e8 tests: add missing --yes 2017-03-16 08:44:44 +01:00
Zdenek Kabelac
53f5cf0af0 tests: cache profile and metadata2
New tests trying to cover support syntax variants.
A lot it still missing...
2017-03-10 19:33:02 +01:00
Zdenek Kabelac
c717011f8e tests: use LVM_SYSTEM_DIR for etc
Instead of hardcoding etc/ dir  use $LVM_SYSTEM_DIR.
2017-03-10 19:33:01 +01:00
Tony Asleson
97b6486b27 lvmdbustest.py: Correct debug & assert order
If we do the assert first we won't get to the print statement.
2017-03-09 16:39:47 -06:00
Tony Asleson
ee7946ed82 lvmdbustest.py: Correct call_lvm doc 2017-03-09 16:39:47 -06:00
Tony Asleson
28754145d8 lvmdbustest.py: Add unit test for external PV create
Ensure a PV created outside of the dbus service is immediately found by
service user.
2017-03-09 16:39:47 -06:00
Tony Asleson
e06e4d9355 lvmdbustest.py: Add unit test for external LV create
Ensure a LV created outside of the dbus service is immediately found by
service user.
2017-03-09 16:39:47 -06:00
Tony Asleson
43d0fbeba2 lvmdbustest.py: Add unit test for external VG create
Ensure a VG created outside of the dbus service is immediately found by
service user.
2017-03-09 16:39:47 -06:00
Tony Asleson
92b7c329ee lvmdbustest.py: Remove un-used import time 2017-03-09 16:39:47 -06:00
David Teigland
716c345334 tests relative-sign-options: only skip thin part 2017-03-09 11:29:54 -06:00
David Teigland
43bcd7393c tests relative-sign-options.sh: skip without thin 2017-03-09 10:43:41 -06:00
Heinz Mauelshagen
6dfe1ce251 lvconvert: prompt when splitting off LV of a 2-legged raid1 LV
Splitting off an image LV of a 2-legged
raid1 LV causes loss of resilience.

Ask user to avoid uninformed loss of all resilience.

Don't ask for N > 2 legged raid1 LVs.

Adjust tests.
2017-03-09 13:59:47 +01:00
Heinz Mauelshagen
6b1b66c266 test: raid1 down convert to linear
Missed one test in last commit.
2017-03-09 13:21:21 +01:00
Heinz Mauelshagen
4b0ae266c2 test: raid1 down convert to linear
Add/adjust more tests for commit 7fbe6ef16b.
2017-03-09 13:16:08 +01:00
Heinz Mauelshagen
3d1df10af3 test: raid1 down convert to linear / split and track tests
Add/adjust tests for commits d250aa7208 and 7fbe6ef16b.
2017-03-09 04:01:47 +01:00
Heinz Mauelshagen
8daad11666 test: "lvconvert --repair" after vgreduce
Add test for commit 921b496fff.
2017-03-09 02:35:57 +01:00
Heinz Mauelshagen
00b8c2bebc test: Copyright 2017-03-09 00:10:55 +01:00
David Teigland
14c7912f45 tests: add test for relative option values
Combinations of: lvcreate/lvresize/lvextend/lvreduce,
--size/--extents/--poolmetadatasize, +/-/nosign.
2017-03-08 13:51:33 -06:00
Heinz Mauelshagen
43fb4aa69b test: add delay to lvchange-raid1-writemostly.sh
Commit 8ab0725077 introduced this new test.

Add a read delay to the PVs to avoid a race
in the script causing the test to fail.

Correct comment.
2017-03-07 15:18:13 +01:00
Heinz Mauelshagen
17838e6439 test: fix typo 2017-03-03 23:22:29 +01:00
Tony Asleson
26ca308ba9 lvmdbustest.py: Remove un-used variable
Not needed with new validation function.
2017-03-01 17:47:04 -06:00
Tony Asleson
7b0371e74e lvmdbustest.py: Validate LV lookups
Ensure that the LV lookups work as expected for newly created LVs.
2017-03-01 17:47:04 -06:00
Tony Asleson
83249f3327 lvmdbustest.py: Validate PV device
Validate device lookup after PV creation.
2017-03-01 17:47:04 -06:00
Tony Asleson
4c89d3794c lvmdbustest.py: Re-name validation function
Make this name generic as we can use for different types.
2017-03-01 17:47:04 -06:00
Tony Asleson
10c3d94159 lvmdbustest.py: Verify lookups work immediately after vg create 2017-03-01 17:47:04 -06:00
Tony Asleson
157948b5a5 lvmdbustest.py: Use _lookup function
Be consistent in using this helper function for dbus object lookups.
2017-03-01 17:47:04 -06:00
Heinz Mauelshagen
48778bc503 lvconvert: add new reporting fields for reshaping
During an ongoing reshape, the MD kernel runtime reads stripes relative
to data_offset and starts storing the reshaped stripes (with new raid
layout and/or new stripesize  and/or new number of stripes) relative
to new_data_offset.  This is to avoid writing over any data in place
which is non-atomic by nature and thus be recoverable without data loss
in the transition.  MD uses the term out-of-place reshaping for it.

There's 2 other areas we don't have report capability for:
- number of data stripes vs. total stripes
  (e.g. raid6 with 7 stripes toal has 5 data stripes)
- number of (rotating) parity/syndrome chunks
  (e.g. raid6 with 7 stripes toal has 2 parity chunks; one
   per stripe for P-Syndrome and another one for Q-Syndrome)

Thus, add the following reportable keys:

- reshape_len      (in current units)
- reshape_len_le   (in logical extents)
- data_offset      (in sectors)
- new_data_offset  (     "    )
- data_stripes
- parity_chunks

Enhance lvchange-raid.sh, lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh, lvconvert-raid-reshape.sh
and lvconvert-raid-takeover.sh to make use of new keys.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-03-01 18:50:35 +01:00
Heinz Mauelshagen
76f60cc430 lvconvert: add missed new test scripts for reshaping
Add aforementioned but forgotten new test scripts
lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh and
lvconvert-raid-reshape.sh

Those presume dm-raid target version 1.10.2
provided by a following kernel patch.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-02-24 05:20:59 +01:00
Heinz Mauelshagen
34caf83172 lvconvert: add infrastructure for RaidLV reshaping support
In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces the changes to call the reshaping infratructure
from lv_raid_convert().

Changes:
- add reshaping calls from lv_raid_convert()
- add command definitons for reshaping to tools/command-lines.in
- fix raid_rimage_extents()
- add 2 new test scripts lvconvert-raid-reshape-linear_to_striped.sh
  and lvconvert-raid-reshape-striped_to_linear.sh to test
  the linear <-> striped multi-step conversions
- add lvconvert-raid-reshape.sh reshaping tests
- enhance lvconvert-raid-takeover.sh with new raid10 tests

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-02-24 05:20:58 +01:00
Heinz Mauelshagen
8ab0725077 lvchange: reject writemostly/writebehind on raid1 during resync
The MD kernel raid1 personality does no use any writemostly leg as the primary.

In case a previous linear LV holding data gets upconverted to
raid1 it becomes the primary leg of the new raid1 LV and a full
resynchronization is started to update the new legs.

No writemostly and/or writebehind setting may be allowed during
this initial, full synchronization period of this new raid1 LV
(using the lvchange(8) command), because that would change the
primary (i.e the previous linear LV) thus causing data loss.

lvchange has a bug not preventing this scenario.

Fix rejects setting writemostly and/or writebehind on resychronizing raid1 LVs.

Once we have status in the lvm2 metadata about the linear -> raid upconversion,
we may relax this constraint for other types of resynchronization
(e.g. for user requested "lvchange --resync ").

New lvchange-raid1-writemostly.sh test is added to the test suite.

Resolves: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855895
2017-02-23 15:09:29 +01:00
Zdenek Kabelac
aa72caca5a tests: support zero_dev
When the test would need to try to write some large amount of data
we can give it 'zero' segments - for obvious reason such written data
can't be verified but in some test cases it doesn't really matter.

Usage follows  'error_dev' style.

For now test suite is not supporting any combination of
error/delay/zero segments so only 1 type could be used per PV.
2017-02-22 15:40:59 +01:00
Zdenek Kabelac
f44e69f9fc tests: not slowing work with metadata
Slows only data extents on a PV.
2017-02-22 15:40:28 +01:00
Zdenek Kabelac
1c1ce2739e tests: some debug code
Checking if --deferred would make it any faster - but it's as slow
as without this new optional flag anyway (4.10).
2017-02-21 09:40:21 +01:00
Zdenek Kabelac
2a65e2d49e tests: ensure first call is version test
Check 'dmsetup version'  is called before starting any more
advanced logic in $DM_DEV_DIR.

Call also replaces mkdir as it creates needed path with control node.
2017-02-21 09:38:49 +01:00
Zdenek Kabelac
7c14004f69 tests: make sure which PV is used for allocation 2017-02-21 09:38:04 +01:00
Zdenek Kabelac
d409fec079 tests: paralelize creation and teardown
To speedup initial construction and destruction of test devices
(mainly in case more then 1 is needed)  call dmsetup
in parallel.
2017-02-21 00:52:05 +01:00
Zdenek Kabelac
921d5972e8 tests: use exclusive activation for mirror
Test suite does not support clustered mirroring.
2017-02-21 00:52:05 +01:00
Zdenek Kabelac
5f2639d01d tests: update lvresize testing
Add missing tests for some lvresize acceptable options.
2017-02-20 00:44:12 +01:00
Zdenek Kabelac
fc0e49297d makefiles: use configure vars
Use binaries found in configure.
2017-02-14 10:24:56 +01:00