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

760 Commits

Author SHA1 Message Date
Zdenek Kabelac
20868482dd tests: clear write to /tmp 2013-06-02 00:50:09 +02:00
Petr Rockai
8c6f3006e7 tests: do not expose duplicate PVs in vgimportclone.sh 2013-06-02 00:50:09 +02:00
Petr Rockai
65a0650135 tests: collect all test results in files
Use files  for later processing with suffix .txt
to avoid mime type confusion.
2013-06-02 00:50:09 +02:00
Petr Rockai
7c89cbf03a tests: run all the test flavours in a single batch
This means that a test failure in one flavour no longer prevents all the
subsequent flavours from running. We also get an aggregate summary at
the end of the entire batch, instead of summaries interspersed with
progress output. Do not fail when flavour overrides are empty
2013-06-02 00:50:09 +02:00
Petr Rockai
53fbf2bea3 tests: make filter extension more robust 2013-06-02 00:50:09 +02:00
Petr Rockai
28160cb04a tests: set up global_filter instead of just filter
For testing setup global_filter.
2013-06-02 00:50:09 +02:00
Petr Rockai
e4cb88009a tests: skip the double log failure test on 2.6
On 2.6 kernels this deadlocks.
2013-06-02 00:50:09 +02:00
Petr Rockai
249ea4c34c tests: add hide_dev/unhide_dev to aux
Add helper func for easy filter adjustment.
2013-06-02 00:50:08 +02:00
Zdenek Kabelac
c5f7d401e5 tests: missed skip in test 2013-05-31 21:58:51 +02:00
Zdenek Kabelac
db2b65704c tests: test mirrors in clustered way
Make the clustered testing using cluster locking for most of the tests.
Use exclusive activation for mirrors and snapshot origins.
2013-05-31 21:42:32 +02:00
Zdenek Kabelac
e9e7421c8e tests: move raid test to separate file 2013-05-31 21:42:32 +02:00
Zdenek Kabelac
274eae592f tests: skip if the system already uses tested minor 2013-05-31 21:42:32 +02:00
Zdenek Kabelac
1c83c15963 tests: min snap chunk count is 3 2013-05-31 21:42:31 +02:00
Zdenek Kabelac
09cc5f65db tests: snapshot needs 3 chunks 2013-05-30 17:56:47 +02:00
Zdenek Kabelac
a766ea16b8 tests: snapshot testing 2013-05-30 17:35:23 +02:00
Zdenek Kabelac
cd9350198e tests: drop testing of raids in cluster
Since raid is not clustered yet - drop it from testing in cluster phase.
(saving running some time)
2013-05-30 17:35:23 +02:00
Mike Snitzer
8ad7865b42 Fix alignment of PV data area if detected alignment less than 1 MB
This fixes a long standing regression since LVM2 2.02.74 (commit 4efb1d9c,
"Update heuristic used for default and detected data alignment.")

The default PE alignment could be used (via MAX()) even if it was
determined that the device's MD stripe width, or minimal_io_size or
optimal_io_size were not factors of the default PE alignment (either 64K
or the newer default of 1MB, etc).  This bug would manifest if the
default PE alignment was larger than the overriding hint that the
device provided (e.g. default of 1MB vs optimal_io_size of 768K).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2013-05-13 15:56:47 -04:00
Zdenek Kabelac
4741e449e6 test: wait for pid removal 2013-05-03 15:44:15 +02:00
Zdenek Kabelac
f84f12a6a3 snapshot: rework cluster creation and removal
Support for exclusive activation of snapshots revealed some problems.

When snapshot is created, COW LV is activated first (for clearing) and
then it's transformed into snapshot's COW LV, but it has left the lock
for such LV active in cluster and this lock could not have been removed
from dlm, unless snapshot has been removed within same dlm session.

If the user tried to remove snapshot after rebooting node, the lock was
missing, and COW LV could not have been detached.

Patch modifes the approach in this way:

Always deactivate COW LV for clustered vg  after clearing (so it's
activated again via imlicit snapshot activation rule when snapshot is activated).

When snapshot is removed, activate COW LV as independend LV, so the lock
will exist for such LV, but only when the snapshot is active.

Also add test case for testing snapshot removal after cluster reboot.
2013-04-25 17:33:24 +02:00
Zdenek Kabelac
320d7f3596 test: correct order
Call notify after resume (like in enable_dev()).
2013-04-23 17:05:19 +02:00
Zdenek Kabelac
23775c8fe8 test: do not break test if there is no .cache
When running test on read /dev, we obtain devices from udev,
and there is no .cache file, so do not stop test if the file
is missing.
2013-04-23 14:36:27 +02:00
Zdenek Kabelac
67fc56f5ca test: fix filter
Fix filter for use with real /dev
2013-04-23 14:28:27 +02:00
Zdenek Kabelac
c7c5a840c1 test: new test new fail
Do not hide new features into old test files.
2013-04-23 14:15:04 +02:00
Jonathan Brassow
2e0740f7ef RAID: Add writemostly/writebehind support for RAID1
'lvchange' is used to alter a RAID 1 logical volume's write-mostly and
write-behind characteristics.  The '--writemostly' parameter takes a
PV as an argument with an optional trailing character to specify whether
to set ('y'), unset ('n'), or toggle ('t') the value.  If no trailing
character is given, it will set the flag.
Synopsis:
        lvchange [--writemostly <PV>:{t|y|n}] [--writebehind <count>] vg/lv
Example:
        lvchange --writemostly /dev/sdb1:y --writebehind 512 vg/raid1_lv

The last character in the 'lv_attr' field is used to show whether a device
has the WriteMostly flag set.  It is signified with a 'w'.  If the device
has failed, the 'p'artial flag has priority.

Example ("nosync" raid1 with mismatch_cnt and writemostly):
[~]# lvs -a --segment vg
  LV                VG   Attr      #Str Type   SSize
  raid1             vg   Rwi---r-m    2 raid1  500.00m
  [raid1_rimage_0]  vg   Iwi---r--    1 linear 500.00m
  [raid1_rimage_1]  vg   Iwi---r-w    1 linear 500.00m
  [raid1_rmeta_0]   vg   ewi---r--    1 linear   4.00m
  [raid1_rmeta_1]   vg   ewi---r--    1 linear   4.00m

Example (raid1 with mismatch_cnt, writemostly - but failed drive):
[~]# lvs -a --segment vg
  LV                VG   Attr      #Str Type   SSize
  raid1             vg   rwi---r-p    2 raid1  500.00m
  [raid1_rimage_0]  vg   Iwi---r--    1 linear 500.00m
  [raid1_rimage_1]  vg   Iwi---r-p    1 linear 500.00m
  [raid1_rmeta_0]   vg   ewi---r--    1 linear   4.00m
  [raid1_rmeta_1]   vg   ewi---r-p    1 linear   4.00m

A new reportable field has been added for writebehind as well.  If
write-behind has not been set or the LV is not RAID1, the field will
be blank.
Example (writebehind is set):
[~]# lvs -a -o name,attr,writebehind vg
  LV            Attr      WBehind
  lv            rwi-a-r--     512
  [lv_rimage_0] iwi-aor-w
  [lv_rimage_1] iwi-aor--
  [lv_rmeta_0]  ewi-aor--
  [lv_rmeta_1]  ewi-aor--

Example (writebehind is not set):
[~]# lvs -a -o name,attr,writebehind vg
  LV            Attr      WBehind
  lv            rwi-a-r--
  [lv_rimage_0] iwi-aor-w
  [lv_rimage_1] iwi-aor--
  [lv_rmeta_0]  ewi-aor--
  [lv_rmeta_1]  ewi-aor--
2013-04-15 13:59:46 -05:00
Jonathan Brassow
ff64e3500f RAID: Add scrubbing support for RAID LVs
New options to 'lvchange' allow users to scrub their RAID LVs.
Synopsis:
	lvchange --syncaction {check|repair} vg/raid_lv

RAID scrubbing is the process of reading all the data and parity blocks in
an array and checking to see whether they are coherent.  'lvchange' can
now initaite the two scrubbing operations: "check" and "repair".  "check"
will go over the array and recored the number of discrepancies but not
repair them.  "repair" will correct the discrepancies as it finds them.

'lvchange --syncaction repair vg/raid_lv' is not to be confused with
'lvconvert --repair vg/raid_lv'.  The former initiates a background
synchronization operation on the array, while the latter is designed to
repair/replace failed devices in a mirror or RAID logical volume.

Additional reporting has been added for 'lvs' to support the new
operations.  Two new printable fields (which are not printed by
default) have been added: "syncaction" and "mismatches".  These
can be accessed using the '-o' option to 'lvs', like:
	lvs -o +syncaction,mismatches vg/lv
"syncaction" will print the current synchronization operation that the
RAID volume is performing.  It can be one of the following:
        - idle:   All sync operations complete (doing nothing)
        - resync: Initializing an array or recovering after a machine failure
        - recover: Replacing a device in the array
        - check: Looking for array inconsistencies
        - repair: Looking for and repairing inconsistencies
The "mismatches" field with print the number of descrepancies found during
a check or repair operation.

The 'Cpy%Sync' field already available to 'lvs' will print the progress
of any of the above syncactions, including check and repair.

Finally, the lv_attr field has changed to accomadate the scrubbing operations
as well.  The role of the 'p'artial character in the lv_attr report field
as expanded.  "Partial" is really an indicator for the health of a
logical volume and it makes sense to extend this include other health
indicators as well, specifically:
        'm'ismatches:  Indicates that there are discrepancies in a RAID
                       LV.  This character is shown after a scrubbing
                       operation has detected that portions of the RAID
                       are not coherent.
        'r'efresh   :  Indicates that a device in a RAID array has suffered
                       a failure and the kernel regards it as failed -
                       even though LVM can read the device label and
                       considers the device to be ok.  The LV should be
                       'r'efreshed to notify the kernel that the device is
                       now available, or the device should be 'r'eplaced
                       if it is suspected of failing.
2013-04-11 15:33:59 -05:00
Petr Rockai
91c9771fc3 test: Re-instate exec in lvm-wrapper, catching crashes inside not. 2013-04-11 16:22:35 +02:00
Petr Rockai
72921d7922 test: Invalidate .cache after vgimportclone. 2013-04-03 22:08:46 +02:00
Petr Rockai
00ed6759c8 lvmetad: Mark PVs visible to lvmetad but not to us as MISSING. 2013-04-03 11:40:29 +02:00
Zdenek Kabelac
6ac4cba276 tests: lvconvert external origin
Add tests for thin external origin support
2013-04-02 15:17:31 +02:00
Jonathan Brassow
69ae454d4d test: Fix the way in_sync calculates the sync field location
'in_sync' was using the last field in the RAID status output as
the location for the sync ratio field.  The sync ratio may not always
be the last field, but it will always be the 7th field.  So we switch
to using the absolute value rather than computing the last field
index number.
2013-03-06 11:12:09 -06:00
Zdenek Kabelac
416eb4b9b3 test: update using exclusive activation
For testing in cluster exclusive activation of origin is needed.
2013-02-05 14:39:11 +01:00
Zdenek Kabelac
a5b9b4bf02 thin: fix forbidden discards checks
Instead of check for lv_is_active() for thin pool LV,
query the whole pool via new  pool_is_active().

Fixes a problem when we cannot change discards settings
for active pool device where the actual layer for pool
device was inactive, but thin volumes using thin pool
have been active.
2013-02-05 14:38:16 +01:00
Zdenek Kabelac
c1becaefe5 test: regression test for lvmetad error 2013-02-04 19:01:10 +01:00
Jonathan Brassow
a3cfe9d9b7 Test (RAID): Test for RAID10 activations when devices are missing
Test the fix for bug 889358.  RAID10 had been failing to activate when
there were devices that had failed in more than one mirror set.
2013-01-28 12:32:33 -06:00
Petr Rockai
f14f2d4378 lvmetad: Fix autoactivation for MDA-less PVs.
Calling pvscan --cache with -aay on a PV without an MDA would spuriously fail
with an internal error, because of an incorrect assumption that a parsed VG
structure was always available. This is not true and the autoactivation handler
needs to call vg_read to obtain metadata in cases where the PV had no MDAs to
parse. Therefore, we pass vgid into the handler instead of the (possibly NULL)
VG coming from the PV's MDA.
2012-12-12 13:19:04 +01:00
Zdenek Kabelac
b38ba27083 test: update thin discards testing
Reflect fixed disards behavior.
2012-12-11 12:05:48 +01:00
Zdenek Kabelac
c5e2f08cf9 tests: add error_dev aux
Aux function to replace PV with specifically damaged device.
Usage:

   aux error_dev "$dev1" 8:32 96:8

Replaces from 8 sector 32 error 512b sectors
and from 96 sector next 8 sectors will fail on rw.
Rest of device is preserved.

For testing:
dd if="$dev1" of=x bs=512 count=104 conv=sync,noerror iflag=direct
2012-12-02 17:55:49 +01:00
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