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
fa5d4bc780 tests: harness updates 2013-06-13 14:51:02 +02:00
Zdenek Kabelac
fe22089edf thin: vgsplit support for thins
Support vgsplit for VGs with thin pools and thin volumes.
In case the thin data and thin metadata volumes are moved to a new VG,
move there also all related thin volumes and check that external origins
are also present in this new VG.
2013-06-13 14:51:00 +02:00
Zdenek Kabelac
9ac0f58ea1 tests: lvresize thin 2013-06-11 14:07:51 +02:00
Zdenek Kabelac
4937df4aed tests: extend harness
Add limit for buffer so if the test is running in some loop
and generating lots of output, the output log gets too large
for browser to display  (at least Firefox is quite confused
to display 300MB logs).

For now limit max output of one test to 32MB.
If there is need to see full log set LVM_TEST_UNLIMITED to
disable interruption of test.

harness now also prints max memory used during test,
it user and system time and amount of read/write operations.
2013-06-11 14:07:51 +02:00
Petr Rockai
c3b06ff55d test: Avoid hardcoding path to bash (not all systems have /bin/bash). 2013-06-10 15:24:55 +02:00
Zdenek Kabelac
b24aad1622 tests: performance testing
Tests speed of activation and deactivation of a lot of volumes.
Currently limited to 1000LVs
TODO: explore why lvmetad fails with higher number.
2013-06-06 12:14:53 +02:00
Zdenek Kabelac
215ab4c9ce tests: check for real mirror target type
Use new available attr instead of guessing...
2013-06-04 15:57:42 +02:00
Zdenek Kabelac
fce7243427 tests: fix strings test
For non udev path use DM_DEFAULT_NAME_MANGLING_MODE.
Skip this test when using real /dev dir, since udev is not able
to create such device name unless mangled...
2013-06-04 15:57:42 +02:00
Zdenek Kabelac
c0f995050f tests: update test
Fix !test -> test !
2013-06-04 15:57:33 +02:00
Zdenek Kabelac
c8dda31466 tests: compilation updates 2013-06-04 15:57:18 +02:00
Zdenek Kabelac
325ca748bb tests: configurable LVM_TEST_RESULTS
Make LVM_TEST_RESULTS configurable
Cleanup results dir on 'make clean'
2013-06-04 15:57:18 +02:00
Zdenek Kabelac
9b2be901ed makefiles: cleanup update
Cleanup also test dir.
Distclean unit tests.
2013-06-04 15:57:18 +02:00
Zdenek Kabelac
eb2c68590b tests: bigger alignment
Test names got a bit longer...
2013-06-03 08:42:34 +02:00
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