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

1840 Commits

Author SHA1 Message Date
Zdenek Kabelac
de3d054f78 tests: avoid using polling 2016-11-11 16:58:20 +01:00
Zdenek Kabelac
4a2250f9ce tests: update make targets
Add  new targets:

make check_lvmpolld
make check_cluster_lvmpolld
make check_lvmetad_lvmpolld
make check_all_lvmpolld

So check_lvmetad runs only base lvmetad test - to much
logic of remaining targets.

Previous behavior is available via  check_all_lvmpolld.
2016-11-11 16:58:20 +01:00
Zdenek Kabelac
c1862ea84c tests: for repair we need neewer version
Older cache targets were not able to report write failures.
2016-11-08 16:01:35 +01:00
Zdenek Kabelac
2ec3e7dca8 tests: test raid0_meta type
Enable testing of raid0_meta type.
Also slow down devices a bit more.
2016-11-08 16:01:35 +01:00
Alasdair G Kergon
6dce0e9489 tests: Disable 3-leg raid1 pre-sync repair attempt
Test fails as it doesn't ensure device isn't already in sync.
2016-11-04 00:23:08 +00:00
David Teigland
221d8ff2a4 tests: check that pvscan cannot activate exported VG 2016-11-03 11:43:37 -05:00
Heinz Mauelshagen
a9651adc84 test: add raid4 checks to respective tests
Add missing checks for valid raid4 mapping to tests.
2016-10-28 21:54:10 +02:00
Heinz Mauelshagen
61ae07966d lvconvert-raid-takeover.sh: fix test 2016-10-27 16:38:15 +02:00
Heinz Mauelshagen
ff05ed7afd lvchange/vgchange/lvconvert: prevent raid4 creation/activation/conversion on non-supporting raid targets
Check for dm-raid target version with non-standard raid4 mapping expecting the dedicated
parity device in the last rather than the first slot and prohibit to create, activate or
convert to such LVs from striped/raid0* or vice-versa in order to avoid data corruption.

Add related tests to lvconvert-raid-takeover.sh

Resolves: rhbz1388962
2016-10-27 11:42:07 +02:00
Heinz Mauelshagen
de78e8eae7 lvconvert: position dedicated parity device in raid4 conversions porperly
On conversions between striped/raid0* and raid4, the kernel expects
the dedicated raid4 parity SubLVs in the first segment area rather than
in the last it's been allocated to, thus the data mapping ain't proper.

Enhance lvconvert (lib/metadata/raid_manip.c) to shift the dedicated
parity SubLVs on conversions from striped/raid0* to raid4 and vice-versa.

In case of raid0_meta -> raid4 where the MD raid0 personality already has
stored RAID array device positions in the superblocks, the MetaLVs have to
be cleared so that the kernel doesn't fail validating the array positions
after lvm has shifted them up by one.

Add more tests to lvconvert-raid-takeover.sh including one to check for
mapping flaws by converting a created raid4 with filesystem -> striped
and fsck it.

Whilst on it:
- add missing direct striped -> raid4 conversion to the takeover array
  to avoid an intermim conversion from striped -> raid0*
- clean up the takeover array
- allow lvconvert to actually call lv_raid_convert() on all takeover requests
  in order to check parameters and display messages provided by takeover
  functions rather than just "...not supported" from within lvconvert
- fix a typo

Resolves: rhbz1386148
2016-10-21 19:00:31 +02:00
Tony Asleson
e57fd9d963 lvmdbustest.py: ws fixes 2016-10-11 13:16:57 -05:00
Tony Asleson
9c56902365 lvmdbustest.py: Add $PREFIX support
Use the env variable PREFIX for vg & lv names
2016-10-11 13:16:57 -05:00
Tony Asleson
595af62ebd lvmdbustest.py: Use more compatible syntax 2016-10-11 13:16:57 -05:00
Tony Asleson
2830f72288 lvmdbusd: Disable lvm abort on too much log output
The commit:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=34c55d98eefd88f85476c0f62f0649c706bde6f0

introduced an abort if lvm logs too much.  In the case of utilizing
lvm shell this is a pretty normal occurance, so we will disable
when we use lvm shell.
2016-10-11 13:16:57 -05:00
Zdenek Kabelac
fe437a6e7d tests: notify dbus only for dbus test 2016-10-11 13:37:44 +02:00
Tony Asleson
20e74313cd lvmdbustest.py: Add profile and path for lvm binary 2016-10-10 16:33:42 -05:00
Tony Asleson
be06fa695e lvmdbustest.py: Skip test_job_handling_timer on loopback
This test never passes on loop back, so we will skip unless the
pv devices are real devices which contain `/dev/sd`.

We always fail because we need lvm to run slow to get a timer to
pop, and loopback are too fast.
2016-10-10 16:31:00 -05:00
Tony Asleson
3e45285b40 lvmdbustest.py: Denote failure if set_execution fails 2016-10-10 16:31:00 -05:00
Tony Asleson
0c51f369a4 lvmdbustest.py: Print to stderr
It's easier to follow if we print to stderr, so that our print messages
are in the lvm error log in the correct position to other printed
messages.
2016-10-10 16:31:00 -05:00
Tony Asleson
cb4e26dcb3 lvmdbustest.py: Ensure we exit non-zero on fail
If you run multiple runs of unittest.main, unless you don't pass exit=true
the test case always ends with a 0 exit code.  Add ability to store the
result of each invocation of the test and exit with a non-zero exit code
if anyone of them fail.
2016-10-10 16:31:00 -05:00
Zdenek Kabelac
9e33781d95 tests: proper wait usage
Fix missing wait so we have paired waiting.
Also 'wait' for precise PID to get 'exit' code.

Test for 'error' replacing only with newer snapshot targets.
The old one will wait for resume.

Note: 'wait -n' is not always available so can't be used..
2016-10-03 17:49:56 +02:00
Tony Asleson
d906fd5201 lvmdbustest.py: Make sure to test for hidden lookups
Test both vgname/[hidden] and vgname/hidden forms
2016-09-27 13:28:54 -05:00
Tony Asleson
ec076b1df2 lvmdbustest.py: Make env variable work 2016-09-27 13:28:45 -05:00
Heinz Mauelshagen
f2efd04052 tests: fix raid rebuild tests to work with older target versions
Pre 1.9 dm-raid targets status output was racy, which caused
the device status chars to be unreliable _during_ synchronization.
This shows paritcularly with tiny test devices used.

Enhance lvchange-rebuild-raid.sh to not check status
chars _during_ synchronization. Just check afterwards.
2016-09-22 23:35:37 +02:00
Zdenek Kabelac
38a6a39daa tests: raid repair needs devices in-sync
Though I'm not quite sure why we push this limit on user,
current --repair logic requires user to wait outside of command.

TODO: I'm not quite sure this repair logic is 'the most wanted'.
2016-09-22 15:46:18 +02:00
Zdenek Kabelac
eb6b2a11e3 tests: check for TRIM support
passdown can really work only on discardable device.
Skip 'status' test when PV does no support discard.
2016-09-22 15:37:52 +02:00
Heinz Mauelshagen
5d455b28fc lvconvert: fix (automatic) raid repair regression
The dm-raid target now rejects device rebuild requests during ongoing
resynchronization thus causing 'lvconvert --repair ...' to fail with
a kernel error message. This regresses with respect to failing automatic
repair via the dmeventd RAID plugin in case raid_fault_policy="allocate"
is configured in lvm.conf as well.

Previously allowing such repair request required cancelling the
resynchronization of any still accessible DataLVs, hence reasoning
potential data loss.

Patch allows the resynchronization of still accessible DataLVs to
finish up by rejecting any 'lvconvert --repair ...'.

It enhances the dmeventd RAID plugin to be able to automatically repair
by postponing the repair after synchronization ended.

More tests are added to lvconvert-rebuild-raid.sh to cover single
and multiple DataLV failure cases for the different RAID levels.

- resolves: rhbz1371717
2016-09-21 00:39:29 +02:00
Zdenek Kabelac
78e0fdb618 tests: correcting kernel version test
Debug force leaked in.
2016-09-20 22:50:43 +02:00
Zdenek Kabelac
9f6b006272 tests: show some more device info
When passdown is not there, look for possible reason.
2016-09-20 22:47:14 +02:00
Zdenek Kabelac
994df22b60 tests: read messages instead of syslog
Since on those older system there is rather 'fight' over
syslog reading buffer - lets read output from /var/log/messages
intead.
2016-09-20 22:36:29 +02:00
Zdenek Kabelac
a9c2a62939 tests: kernel message for <3.5 kernels
Since /dev/kmsg is useless on kernel <3.5 user there automatically
syslog to obtain traces from kernel log buffer during test.
2016-09-20 17:09:46 +02:00
Zdenek Kabelac
67d4b3b7f2 cache: restore reported origin field
Commit 199697accf rerouted funtion
for priting cache volume origin to lvm2app app function - which
however had a bug.  So restore the original functionality
and print correct LV as cache origin LV.
2016-09-20 14:26:11 +02:00
Tony Asleson
d18ea3f2cb lvmdbustest: Remove pyudev deprecated warnings 2016-09-19 15:32:47 -05:00
Tony Asleson
c23d5f63fd lvmdbustest: ws fix-ups 2016-09-19 15:32:47 -05:00
Tony Asleson
cb2b261510 lvmdbustest.py: Test with/without timeout values
Because of the different code paths we need to test job handling with
all operations.  Test now runs virtually everything with timeout == 0
and timeout == 15 so that we test both use cases.

Note:  If a client passes -1 for the timeout value they need to make
sure that their connection time out is also infinite.  Otherwise, if the client
times out the service side hangs any new dbus calls until the job
that is in progress completes.  Not sure why this behavior is occuring
at this time, but it appears a limitation/bug of the dbus-python library.
2016-09-19 15:32:27 -05:00
Tony Asleson
65f59184c8 lvmdbustest.py: Make methods static
Changed methods to be static that should be.
2016-09-19 15:31:04 -05:00
Tony Asleson
ac2fc7a366 lvmdbusd: Vg.LvCreate* methods, correct return type
The methods were returning an instance of the object instead of the
object path which was causing an exception when the result was returned
with the job object as we are explicity trying to return an object path.

Unit test added which re-creates the issue and verifies the fix.
2016-09-19 15:31:04 -05:00
Zdenek Kabelac
b3b8834724 tests: enhance lvchange of thin pool tests
Validate also content of dmtable.
Check operations with unused thin-pool as well.
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
1a30adc062 tests: check for metadata test working properly
Add more tests to check they guard minimum free space in metadata
for new thin volume creation.
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
561f773bb4 tests: add check grep_dmsetup
Add simple helper/wrapper check function to check result
of dmsetup call i.e.:

check grep_dmsetup table vg-lv  "grep_expected"
check grep_dmsetup status vg-lv -v "grep_unexpected"
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
629059ee84 tests: Revert "tests: not redirect strderr to stdout"
This reverts commit 5314d36f3d.

Ok - some tests do look for 'stderr' output of 'not' commands.
So let's keep existing functionality.
2016-09-13 13:23:47 +02:00
Zdenek Kabelac
cebcc8a604 tests: slightly bigger raid arrays
Just to ensure we catch devices in sync.
2016-09-13 12:25:36 +02:00
Zdenek Kabelac
08c94de798 tests: more permissive on test percent value
Just check there is some output.
Values may slightly differ per policy target version.
2016-09-13 12:25:36 +02:00
Zdenek Kabelac
d34e315b8d tests: use just single raid_leg_status
Simplify 'check' test actualy and correct printed tracing output
2016-09-13 12:25:36 +02:00
Zdenek Kabelac
5314d36f3d tests: not redirect strderr to stdout
Errors are 'wanted' and expected in this case.
2016-09-13 12:25:06 +02:00
Zdenek Kabelac
4ddcbe22b7 tests: slow down disks more 2016-09-12 16:51:53 +02:00
Zdenek Kabelac
5b55f9616d tests: add check function for raid leg status
2 new check test functions:

raid_leg_status    - to just compare
raid_leg_status_is - to compare and die when different
2016-09-12 16:51:53 +02:00
Zdenek Kabelac
44f1f45e16 tests: use exclusive activation
Slightly better for clvmd - thought test is still crashing
as table is broken.
2016-09-12 16:51:53 +02:00
Zdenek Kabelac
a4363fbcb5 tests: move cache test to separate file
Don't mix plain raid test with  'raid+cache' test.
2016-09-12 16:49:51 +02:00
Zdenek Kabelac
75a42845c1 tests: rename test _ -> -
Change '_' in the test name.
2016-09-09 20:59:21 +02:00