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

1246 Commits

Author SHA1 Message Date
Zdenek Kabelac
406ce3760b tests: detect raid presence 2014-05-22 12:01:44 +02:00
Zdenek Kabelac
b2da0f0a5b tests: raid and dmeventd 2014-05-21 23:14:42 +02:00
Zdenek Kabelac
37b4dc7775 tests: more pvchange tests 2014-05-21 23:14:42 +02:00
Zdenek Kabelac
79f4665243 tests: more vgcfgrestore testing
Check '-l' and archiving.
2014-05-21 23:14:41 +02:00
Zdenek Kabelac
9c4953df1b tests: restore disable_dev behavior
Notify needs to go  with major:minor before device disappears.
2014-05-21 16:59:38 +02:00
Zdenek Kabelac
8db67d2aff tests: skips on unsupported systems 2014-05-21 16:48:06 +02:00
Zdenek Kabelac
c34c33d9ba tests: notify loop needs maj:min
Missed in previous commit.
2014-05-21 12:00:32 +02:00
Zdenek Kabelac
cbdb8fa589 tests: notify lvmetad after udev transation
Delay udev notification after the point udev transaction
is finished - since otherwise some device may still
be found missing until udev transaction is finished.
2014-05-21 11:43:24 +02:00
Zdenek Kabelac
b57b4db889 tests: checking mirror_remove_missing
FIXME:

Seems like conversion of log is not supported in clustered VG
and needs to be fixed.
2014-05-20 22:50:52 +02:00
Zdenek Kabelac
f919a255b7 tests: lvconvert needs --yes 2014-05-20 22:50:33 +02:00
Zdenek Kabelac
08fd244506 tests: rebuild paths when Makefile is updated 2014-05-20 21:50:30 +02:00
Zdenek Kabelac
2e9792121f tests: add have_cache and have_raid
Need to be aware of build options, when system would be
configure without raid or cache support
2014-05-20 21:50:30 +02:00
Zdenek Kabelac
7f92c3a13e tests: wait before down-convert 2014-05-20 21:50:29 +02:00
Zdenek Kabelac
205be24768 tests: update lvconvert test
Split raid test to separate file
Add --yes flag to automated testing
2014-05-20 21:50:29 +02:00
Peter Rajnoha
83f468be4e tests: update profiles.sh test for latest changes 2014-05-20 16:27:09 +02:00
Zdenek Kabelac
ecccb75904 tests: drop nosync
Mirrors currently do not support any conversion,
when they are created no-sync.
2014-05-19 13:22:46 +02:00
Zdenek Kabelac
76c06c7252 tests: speedup
Avoid some expencive raid/mirror synchronization when testing
just allocation sizes.
Use lv_attr_bit
2014-05-15 12:08:35 +02:00
Zdenek Kabelac
7b766b0648 tests: updates
Move thin test out of listing.
2014-05-13 10:28:55 +02:00
Zdenek Kabelac
6f057e3c66 tests: replance hostname call 2014-05-12 16:24:40 +02:00
Zdenek Kabelac
4e559103d5 tests: lets the test continue
unwanted start of dmeventd was caused by seg_monitor status.
2014-04-30 10:26:31 +02:00
Zdenek Kabelac
26989e0cd7 tests: improve coverage
Test more code paths for lvscan & lvdisplay
2014-04-28 12:42:57 +02:00
Jonathan Brassow
3bce3ad52a test: Add the new vgsplit RAID test file forgotten in the last commit 2014-04-25 16:59:09 -05:00
Jonathan Brassow
c671be434c test: Move the RAID vgsplit test into a separate file 2014-04-25 16:57:43 -05:00
Jonathan Brassow
3c4234f825 vgsplit: Make RAID 4/5/6 fail cleanly when too few PV specified
While the 'raid1/10' segment types were being handled inadvertently
by '_move_mirrors()', the parity RAIDs were not being properly checked
to ensure that the user had specified all necessary PVs when moving
them.  Thus, internal errors were being triggered when only part of
a RAID LV was moved to the new VG.  I've added a new function,
'_move_raid()', which properly checks over any affected RAID LVs and
ensures that all the necessary PVs are being moved.
2014-04-25 16:24:50 -05:00
Jonathan Brassow
4dffb9fca9 test/vgsplit-operation.sh: Add vgsplit tests for RAID
vgsplit of RAID volumes was problematic because the metadata area
and data areas were always on the same PVs.  This problem is similar
to one that was just fixed for mirrors that had log and images sharing
a PV (commit 9ac858f).  We can now add RAID LVs to the tests for
vgsplit.

Note that there still seems to be an issue when specifying an
incomplete set of PVs when moving RAID LVs.
2014-04-25 16:22:40 -05:00
Jonathan Brassow
9ac858fe6b vgsplit: Make vgsplit work on mirrors with leg and log on same PV
Given a named mirror LV, vgsplit will look for the PVs that compose it
and move them to a new VG.  It does this by first looking at the log
and then the legs.  If the log is on the same device as one of the mirror
images, a problem occurs.  This is because the PV is moved to the new VG
as the log is processed and thus cannot be found in the current VG when
the image is processed.  The solution is to check and see if the PV we are
looking for has already been moved to the new VG.  If so, it is not an
error.
2014-04-25 14:53:34 -05:00
Alasdair G Kergon
0ee9d59b48 test: configurable write timeout
Hard-coded 3 minutes is far too short when investigating problems.
2014-04-24 22:44:22 +01:00
Alasdair G Kergon
9676ee9ba9 test: Fix default.profile path.
It's a generated file.
2014-04-24 18:52:29 +01:00
Zdenek Kabelac
22037ee328 tests: fix creation of scsi debug
Use proper '||' test form to avoid unwanted test abort
on failure.
(i.e. running failing test profiles-thin.sh on a real /dev)
2014-04-24 14:42:27 +02:00
Marian Csontos
795944f178 test: add lvresize tests
- test for Bug 1088153
- test lvextend does not reduce nor lvreduce extend LV
2014-04-22 12:53:30 +02:00
Zdenek Kabelac
47a60369a0 unknown: fix mempool used for name allocation
Use cmd libmem mempool for name allocation, since mem mempool
is released after each clvmd command.
2014-04-18 16:38:47 +02:00
Zdenek Kabelac
3c82a37aee tests: correct test condition
Abort loop when PIDFILE is gone
2014-04-14 14:55:14 +02:00
Zdenek Kabelac
92ee51a4c3 tests: check there is really pvmove lv
Since the kill may take various amount of time,
(especially when running with valgrind)
check it's really pvmoved LV.

Restore initial restart of clvmd - it's currently
broken at various moments - basically killed lvm2
command may leave clvmd and confusing state leading
to reports of internal errors.
2014-04-14 13:02:28 +02:00
Zdenek Kabelac
4d48577ab9 tests: implement lv_attr_bit
Add easy check function for cheking lv_attr bits
2014-04-14 13:02:28 +02:00
Peter Rajnoha
35721ee134 tests: add test for pvcreate --dataalignment --dataalignmentoffset --restorefile compatibility
Also, avoid division by zero in the pvcreate's param validation
in case someone supplies "pvcreate --dataalignment 0".
2014-04-10 15:02:35 +02:00
Peter Rajnoha
05eb6a167e tests: add separate test file for bootloader area support and enhance tests
Enahnce bootloader area test to check whether restoring values from
backup works correctly.
2014-04-10 14:18:59 +02:00
Peter Rajnoha
b45d2768a8 tests: add some coverage for bootloader areas 2014-04-09 15:44:26 +02:00
Zdenek Kabelac
87e559f1ec tests: check prohibited names 2014-04-08 11:00:16 +02:00
Zdenek Kabelac
c95d43b28c tests: update lvcreate-cache 2014-04-01 20:54:10 +02:00
Peter Rajnoha
504c328e3d tests: add profiles-thin and prepare_profiles helper fn 2014-04-01 15:52:54 +02:00
Petr Rockai
490226fc47 pvs: Wipe persistent filters when given a device argument. 2014-04-01 14:46:22 +02:00
Peter Rajnoha
a30219a8c0 tests: update profiles.sh for recent changes 2014-04-01 11:48:49 +02:00
Zdenek Kabelac
367e4551a1 tests: add more rename test
Drop test, which are now in other files (listings.sh)
2014-03-31 12:05:35 +02:00
Zdenek Kabelac
ee8708cc8e tests: more listing tests 2014-03-31 12:05:35 +02:00
Zdenek Kabelac
8f9150c241 tests: add more pvdisplay tests 2014-03-30 23:45:00 +02:00
Zdenek Kabelac
1216aa7826 tests: workaround clvmd .cache consistency
May need futher fixes, but it's needed only on non-udev systems
(systems which still needs .cache - just like test suite)
2014-03-30 23:45:00 +02:00
Zdenek Kabelac
2c8f0c9800 tests: more vgexport tests
cover more options
2014-03-30 23:45:00 +02:00
Zdenek Kabelac
5aa2e5ec8c tests: update pvs test
TODO:
It seems commit 7e685e6c70
has changed the old logic, when  'pvs device_name' used
to work. (regression from 2.02.104)
Currently put in extra pvscan.
2014-03-28 17:06:13 +01:00
Zdenek Kabelac
3181dc72e7 tests: more coverage for pvchange
Change metadataignore
Argless pvchange
Alocatability for orphans
2014-03-28 11:38:50 +01:00
Zdenek Kabelac
2a79971004 tests: check pvchange changes uuid 2014-03-28 10:41:59 +01:00
Zdenek Kabelac
09b180cfc2 tests: expect failing pvs when missing PV 2014-03-28 10:41:59 +01:00
Zdenek Kabelac
a512ea6a6a tests: updates 2014-03-28 00:41:19 +01:00
Zdenek Kabelac
bd805ff048 tests: move some tests to better places
Some tests already have separate test scripts - so move
those tests to listing and vgcfgbackup files.
2014-03-28 00:41:19 +01:00
Zdenek Kabelac
5b44a036b1 tests: support invalid and fail results
Allow more detailed check for failing exit code:

invalid  -  expects 3
fail - expects 5
2014-03-28 00:41:19 +01:00
Zdenek Kabelac
4ebdfcfb59 tests: more pvchange options examined 2014-03-27 13:13:22 +01:00
Zdenek Kabelac
04a6918518 tests: cover more commands
Visit more code lines.
2014-03-27 13:13:09 +01:00
Zdenek Kabelac
a2614c6866 tests: missed exclusive activation 2014-03-26 00:22:23 +01:00
Zdenek Kabelac
5b900dbef5 tests: pass list devs to allocate from 2014-03-26 00:05:46 +01:00
Zdenek Kabelac
1259ae5954 tests: cover code from more commands 2014-03-26 00:05:46 +01:00
Zdenek Kabelac
4b30863e85 tests: check forced backup 2014-03-26 00:05:46 +01:00
Zdenek Kabelac
4adbb85c37 tests: disable test for broken kernel raid targe
Since using raid5 - validate it's usable on the system
2014-03-26 00:04:59 +01:00
Zdenek Kabelac
fb471a372d tests: remove also 3.14 fc21 kernels 2014-03-26 00:04:59 +01:00
Zdenek Kabelac
8471fb01d8 tests: wipe signature
Check for usable blkid.
2014-03-25 11:23:00 +01:00
Zdenek Kabelac
3c9204a75a tests: update 2014-03-25 11:23:00 +01:00
Zdenek Kabelac
36d87eddcf tests: use exclusive activation
pvmove in cluster needs exlusive activation or cmirrord running.
2014-03-25 11:23:00 +01:00
Zdenek Kabelac
db1d4ba4ac tests: argless pvremove 2014-03-25 11:23:00 +01:00
Zdenek Kabelac
04861b9bed tests: more pvresize tests
Maybe move to separate pvresize test,
remove vgck size this is already executed elsewhere.
2014-03-25 11:22:59 +01:00
Zdenek Kabelac
db04d3e6d2 tests: relocate vgimport test
It seem like a better-fit here.
2014-03-25 11:22:59 +01:00
Zdenek Kabelac
c0c55846b0 tests: wait for clvmd.pid file
Just like with dmeventd and lvmetad.
Do few indent changes around.
2014-03-21 22:29:28 +01:00
Zdenek Kabelac
8b1916fd5a tests: simplify 2014-03-21 22:29:28 +01:00
Zdenek Kabelac
de5683d8d9 tests: add quotes around device paths 2014-03-21 22:29:27 +01:00
Petr Rockai
f12ee43f2e polldaemon: Re-initialise lvmcache properly on fork (fixes RHBZ 1073670). 2014-03-19 16:25:12 +01:00
Zdenek Kabelac
aed36c12f8 tests: use check lv_tree_on
Use internal /lib function.
Reduce extent size for test to create smaller devices.
2014-03-18 10:28:09 +01:00
Zdenek Kabelac
81166a84be tests: more fedora kernels unusable for testing raid456 2014-03-18 10:28:08 +01:00
Zdenek Kabelac
31b1d06ddd tests: replace skip_if_mirror_recovery_broken
Use mirror_recovery_works instead with easier to follow logic.
2014-03-17 16:33:29 +01:00
Zdenek Kabelac
19fd6040c2 tests: quotes for LVM_TEST vars 2014-03-17 16:32:29 +01:00
Zdenek Kabelac
e3d208f7c2 tests: put vars in quotes
This shell var has space in middle
2014-03-17 16:30:52 +01:00
Zdenek Kabelac
a2c544dc91 tests: make test usable in cluster
Origin needs exclusive activation
2014-03-17 15:18:20 +01:00
Zdenek Kabelac
ae2d80dd7e tests: update error message check 2014-03-17 15:18:02 +01:00
Zdenek Kabelac
e398901ed1 tests: zero and error type tests 2014-03-17 14:31:45 +01:00
Zdenek Kabelac
fe8603dd60 tests: lvconvert snapshot testing 2014-03-17 14:31:45 +01:00
Zdenek Kabelac
27d556de9e tests: enhance snapshot test
Improve cleanup routine and use it also for vg removal.
2014-03-17 14:31:45 +01:00
Zdenek Kabelac
1a0fea104b tests: put test envvar into braces
Ensure we not fail on space.
2014-03-17 14:31:45 +01:00
Zdenek Kabelac
95f74af404 tests: skip mangling test
Mangling is only using dmsetup commands,
so there is no lvm command and no contact with
clvmd nor lvmetad so skip this test there.
2014-03-17 14:31:45 +01:00
Zdenek Kabelac
909e2207bd tests: test spare volume removal 2014-03-17 14:31:44 +01:00
Zdenek Kabelac
404593c710 tests: more coverage 2014-03-17 14:31:44 +01:00
Zdenek Kabelac
7d3fa6fc32 tests: skip more Fedora kernels for raid456 2014-03-17 14:31:44 +01:00
Zdenek Kabelac
0fc17fe1ce tests: add more help text and paths quotes
Add LVM_VALGRDIN help text
Use proper quotes for  abs_  paths
(Assignment in makefile doesn't need them, only shell usage)
2014-03-17 14:31:44 +01:00
Peter Rajnoha
12eb284eec tests: fix name-mangling test
We need to use "--verifyudev" for dmsetup mangle command used in
the name-mangling test since without the --verifyudev, we'd end up
with the failed rename.

Also, add direct check for the dev nodes - node with old name must
be gone and node with new name must be present. Before, we checked
just the output of the command.

One bug popped up here when renaming with udev and libdevmapper
fallback checking the udev when target mangle mode is "none"
(fixme added in the libdevmapper's node rename code).
2014-03-17 11:51:30 +01:00
Zdenek Kabelac
58e812a13f tests: use DMEVENTD_PIDFILE
Test for compiled-in pidfile location
(so we are not based on assumption /var/run or /run link exists)
2014-03-14 11:16:24 +01:00
Zdenek Kabelac
900cb6717b tests: quick update of location of pid file
Until better fix is put in - replace with /run.
2014-03-14 10:40:48 +01:00
Zdenek Kabelac
8b14ebb2f1 tests: another kernel with unusable kmem_check 2014-03-12 16:17:36 +01:00
Zdenek Kabelac
a2c64e21fd tests: check we are no reading pool device 2014-03-12 00:26:47 +01:00
Zdenek Kabelac
dd690d5fd1 tests: add inactive pool creation test 2014-03-12 00:25:59 +01:00
Zdenek Kabelac
5dc9402774 tests: dmeventd valgrind testing 2014-03-10 12:24:11 +01:00
Zdenek Kabelac
c7262d5b38 tests: aux adds kill_sleep_kill_
Move common code to subfunction
2014-03-10 12:24:11 +01:00
Zdenek Kabelac
1c18fc42ec tests: drop unused make_ioerror 2014-03-10 12:24:11 +01:00
Zdenek Kabelac
6cc75d1497 tests: workaround bash bug
Seems new bash4.3 is somewhat buggy
https://bugzilla.redhat.com/show_bug.cgi?id=1074202

Put in cheap workaround for now.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
4eed2c8142 tests: skip valgrind testing when assigned to 0
When LVM_VALGRIND_CLVMD/LVMETAD is set to 0  skip testing.
(Proviosly any value caused to run valgrind testing,
so now '0' skips testing))
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
41e1b12e03 tests: skip another kernel
This kernel has still buggy kmem_cache debugging so skip it for raid456.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
d913fcbd46 tests: improve wait for open
Add loop to detect open device from 'sleep <'
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
fa23234e71 tests: reuse existing check dev_md5sum
Create md5sum in reusable way and use exiting check function.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
ef1d910dee tests: updates for new test
snaphost needs exclusive origin for cluster
older md5 needs 2 space char
2014-03-06 18:01:21 +01:00
Zdenek Kabelac
6b561a7a3b tests: check created snapshot has good max size
Testing if we are creating large enough old-snapshot
(so the COW max size is correct)
https://bugzilla.redhat.com/show_bug.cgi?id=1035871
2014-03-06 17:30:10 +01:00
Zdenek Kabelac
d0673b0ddc tests: detect old-snap metadata consitency
Add some test for correctness of snapshot metadata.
Based upon original test from Mikulas.
Needs correctly working kernel snapshot target.
2014-03-06 17:30:10 +01:00
Peter Rajnoha
cfc9e178bf tests: fix name-mangling test and remove udev transaction in dmsetup wrapper 2014-03-06 14:46:50 +01:00
Petr Rockai
3c9887467f test: Use correct path to /dev in lvchange-raid.sh. 2014-03-05 10:22:39 +01:00
Zdenek Kabelac
08aedff1fc tests: testing usable of /dev/kmsg
It's not so easy to recongnize unusable /dev/kmsg
Reorder the code in a way if the first regular read of /dev/kmsg
fail, fallback to klogctl interface.

Call drain_dmesg also for the case there is no user log output.
2014-03-04 17:54:33 +01:00
Zdenek Kabelac
9a99cb8c79 tests: hide error message
Make the logging looks normal for this case
2014-03-04 16:41:07 +01:00
Zdenek Kabelac
a01e2ff81c tests: print kernel version 2014-03-04 16:27:00 +01:00
Zdenek Kabelac
b47bdb4dca tests: check readability of /dev/kmsg
Looks like there are systems with /dev/kmsg device,
which is however not readable

Fix check for result value of klogctl and use only positive value.
2014-03-04 16:27:00 +01:00
Zdenek Kabelac
30810de1b0 tests: reinstantiate support for klogctl
Add a bit more complexity here - Switch to use /dev/kmsg
which has been introduced in 3.5 kernels and could run without
lossing lines from /proc/kmsg.

On older systems user may set env var LVM_TEST_CAN_CLOBBER_DMESG=1
to get kernel messages via klogctl() call (which deletes dmesg buffer)
otherwise no logging of kernel messages is provided.
2014-03-04 15:18:19 +01:00
Petr Rockai
cb77bdc253 test: Make teardown (more) resistant to funny DM device names. 2014-03-04 11:16:00 +01:00
Zdenek Kabelac
d739e16d85 tests: restore .txt suffix 2014-03-03 19:30:48 +01:00
Zdenek Kabelac
719261a33a tests: speedup kmsg processing
Since there could be multiple readers of kmsg (test & journald) it needs
to be fast, to capture things like sysrq trace.

But to capture whole output it would need to prioritize reading of kmsg,
thus we would first log kernel messages and followed by command output.

As a trade-off always log command output first and use large drain
buffer so is captures most of messages, but occasionaly miss some
lines.
2014-03-03 19:30:47 +01:00
Zdenek Kabelac
52007a9191 tests: split raid test
Use separate files for raid1, raid456, raid10.
They need different target versions to work, so support
more precise test selection.

Optimize duplicate tests of target avalability and skip
unsupported test cases sooner.
2014-03-03 11:23:57 +01:00
Marian Csontos
445c0a5585 test: Remove incorrect evaluation 2014-03-03 08:31:33 +01:00
Zdenek Kabelac
6df716332c tests: detect nc or socat
Since shell is not in -o pipefail mode here,
we need to generate separate failure ahead of tee.
2014-03-02 21:48:28 +01:00
Zdenek Kabelac
6c377f5b3c tests: restore usage of reading kmsg
Basically reverts commit af8580d756.
"test: Use klogctl in the harness instead of reading /var/log/messages."

Problem is - this interface clears dmesg buffer
(just like call of dmesg -c)
Thus after running lvm2 test suitedmesg is empty - while all the
messages are usually logged in the journal/message, it's still not nice to
clear dmesg buffer.

It's not a pure revert, but switch to use /proc/kmsg directly instead of
reading /var/log/messages.
2014-03-02 21:30:26 +01:00
Zdenek Kabelac
33d69162e4 tests: split raid test
Use separate test file for raid456
Change test for broken kernel which has broken raid456 support.
2014-03-02 21:27:26 +01:00
Zdenek Kabelac
3ff10f5e61 tests: disable test which leaks node
This test is not detected as fault but leak device node
on a real /dev.
Added FIXME.
2014-03-02 21:27:26 +01:00
Zdenek Kabelac
75b5855ca1 tests: report selinux mode 2014-03-02 21:27:26 +01:00
Zdenek Kabelac
a2af5855c5 tests: use longer sleep
Eplore why 30sec is not enough for hydra and try higher value.
2014-03-02 21:27:25 +01:00
Petr Rockai
fade191aed test: Test that we cope with stray device nodes. 2014-03-02 20:53:43 +01:00
Petr Rockai
3b958984f1 test: Properly synchronize direct dmsetup calls. 2014-03-02 20:53:43 +01:00
Zdenek Kabelac
72ecf8e591 tests: detect reiserfs support
Since reiserfs is not commonly available detect its presence in kernel.
Stop reporting skipped test as WARNING.
2014-03-01 14:08:59 +01:00
Petr Rockai
daa897fe90 test: Fix stat calls in lvmetad-pvscan-filter. 2014-02-28 23:33:30 +01:00
Petr Rockai
1bb29bb402 test: Downgrade lvmetad-lvm1 failure to a warning. 2014-02-28 23:33:17 +01:00
Petr Rockai
6733ac86d7 test: Fix the failing branch in aux lvmetad_talk. 2014-02-28 23:30:17 +01:00
Petr Rockai
f3b9fe6024 test: Add lvmetad_talk and lvmetad_dump to aux. 2014-02-28 11:23:53 +01:00
Petr Rockai
8e814eb899 test: Fix notify_lvmetad for symlinked devices. 2014-02-28 11:23:53 +01:00
Petr Rockai
bf29eabdba lvmetad: Keep the cache consistent when a PV moves around.
In cases where PV appears on a new device without disappearing from an old one
first, the device->pvid pointers could become ambiguous. This could cause the
ambiguous PV to be lost from the cache when a different PV comes up on one of
the ambiguous devices.
2014-02-28 11:23:52 +01:00
Petr Rockai
a368698672 lvmetad: Hide corrupt MDAs from the cache.
This is probably not optimal, but makes the lvmetad case mimic non-lvmetad code
more closely. It also fixes vgremove of a partially corrupt VG with lvmetad, as
_vg_write_raw (and consequently, entire vg_write) currently panics when it
encounters a corrupt MDA. Ideally, we'd be able to explicitly control when it is
safe to ignore them.
2014-02-28 11:23:52 +01:00
Jonathan Brassow
38ab4c31a6 test: warn rather than fail when %FREE isn't working right
%FREE allocation has been broken for RAID.  At 100%FREE, there is
still an extent left for certain tests.  For now, change the test
to warn rather than completely fail.
2014-02-27 22:47:30 -06:00
Zdenek Kabelac
a7dc422bde tests: remove extra vgremove
These vgremove calls were not correct.
2014-02-27 14:53:33 +01:00
Zdenek Kabelac
c23cd12023 tests: quote dev 2014-02-27 14:49:49 +01:00
Zdenek Kabelac
f4afd07700 tests: drop remove
Generates waaaaay too much log from lvmetad test.

TODO: once we will be able to remove more LVs with a single
write - we may restore....
2014-02-27 14:48:32 +01:00
Zdenek Kabelac
47b15b805e tests: updates
Add some vgremove calls.
Remove uneeded test for some unused commands.
Add tests for missing commands.
2014-02-27 13:01:04 +01:00
Zdenek Kabelac
d00fc1de78 snapshot: correct previous snapshot commit
Condition was swapped - however since it's been based on 'random'
memory content it's been missed as attribute has not been set.

So now we have quite a few possible results when testing.

We have old status without separate metadata and
we have kernels with fixed snapshot leak bug.

(in-release update)
2014-02-27 13:00:49 +01:00
Zdenek Kabelac
40e6176d25 snapshots: fix incorrect calculation of cow size
Code uses target driver version for better estimation of
max size of COW device for snapshot.

The bug can be tested with this script:
VG=vg1
lvremove -f $VG/origin
set -e
lvcreate -L 2143289344b -n origin $VG
lvcreate -n snap -c 8k -L 2304M -s $VG/origin
dd if=/dev/zero of=/dev/$VG/snap bs=1M count=2044 oflag=direct

The bug happens when these two conditions are met
* origin size is divisible by (chunk_size/16) - so that the last
  metadata area is filled completely
* the miscalculated snapshot metadata size is divisible by extent size -
  so that there is no padding to extent boundary which would otherwise
  save us

Signed-off-by:Mikulas Patocka <mpatocka@redhat.com>
2014-02-26 14:25:09 +01:00
Zhiqing Zhang
014ba37cb1 lvresize: fix stripe size validation
While stripe size is twice the physical extent size,
the original code will not reduce stripe size to maximum
(physical extent size).

Signed-off-by: Zhiqing Zhang <zhangzq.fnst@cn.fujitsu.com>
2014-02-26 13:25:50 +01:00
Zdenek Kabelac
b5e03c88b8 tests: support for older snapshot target version
TODO: unsure about 1.10...
2014-02-26 11:17:39 +01:00
Zdenek Kabelac
aef6016011 tests: improve read-only test for snapshot
Switch to use ext2 to make it usable on older systems.
Previous test has not been able to catching problem.

Multiple tests are now put in.

FIXME: validate what is doing kernel target when
the header is undeleted and same chunk size is used.

It seems snapshot target successfully resumes and
just complains COW is not big enough:

kernel: dm-8: rw=0, want=40, limit=24
kernel: attempt to access beyond end of device

When chunk size is different it fails instantly.

For checking this with lvm2 and this test case use this patch:

--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -769,7 +769,7 @@ static int _read_activation_params(struct
lvcreate_params *lp,
        lp->permission = arg_uint_value(cmd, permission_ARG,
                                        LVM_READ | LVM_WRITE);

-       if (lp->snapshot) {
+       if (0 && lp->snapshot) {
                /* Snapshot has to zero COW header */
                lp->zero = 1;
                lp->wipe_signatures = 0;

---
and switch to use  -c 4 for both snapshots
2014-02-26 10:19:46 +01:00
Zdenek Kabelac
2b044452e3 snapshot: zero cow header for read-only snapshot
When read-only snapshot was created, tool was skipping header
initialization of cow device.  If it happened device has been
already containing header from some previous snapshot, it's
been 'reused' for a newly created snapshot instead of being cleared.
2014-02-26 00:22:46 +01:00
Zdenek Kabelac
3e49753e6c tests: cache needs 1.3 2014-02-25 09:36:07 +01:00
Zdenek Kabelac
8083143822 tests: add extra wait
Parallel upconvert & downconvert is now tested separately
in lvconvert-mirror-updown.sh
2014-02-24 21:13:36 +01:00
Zdenek Kabelac
dc839fb361 tests: check for python before other tests 2014-02-24 21:13:36 +01:00
Zdenek Kabelac
32138969f9 tests: enhance thin test
Add more tests to also check validaty of transaction_id
and also detect we are not leaving active unusable thin pool LVs.
2014-02-24 21:13:36 +01:00
Zdenek Kabelac
9c9f4515ae tests: add some quotes
Use quotes for DM_DEV_DIR
2014-02-24 21:13:36 +01:00
Zdenek Kabelac
f8780e2d79 tests: drop mirror from filter 2014-02-24 21:13:36 +01:00
Jonathan Brassow
ee89ac7b88 pvmove: Disallow pvmove of cache LVs
Skip over LVs that have a cache LV in their tree of LV dependencies
when performing a pvmove.

This means that users cannot move a cache pool or a cache LV's origin -
even when that cache LV is used as part of another LV (e.g. a thin pool).

The new test (pvmove-cache-segtypes.sh) currently builds up various LV
stacks that incorporate cache LVs.  pvmove tests are then performed to
ensure that cache related LVs are /not/ moved.  Once pvmove is enabled
for cache, those tests will switch to ensuring that the LVs /are/
moved.
2014-02-24 12:25:18 -06:00
Jonathan Brassow
fdb7356d6a test: Add cache[pool] support to lv_tree_devices_ test suite function. 2014-02-24 10:40:00 -06:00
Jonathan Brassow
46223c4284 test: move RAID10 tests from lvcreate-raid.sh to lvcreate-raid10.sh 2014-02-21 18:28:16 -06:00
Petr Rockai
294671fa62 test: Only try raid10 on dm-raid versions that support it. 2014-02-21 19:47:06 +01:00
Zdenek Kabelac
5e83682ccf tests: add small test for clustered conversion of mirror
Test currently fails with make check_cluster - so uses 'should'

CLVMD[4f435880]: Feb 19 23:27:36 Send local reply
format_text/archiver.c:230   WARNING: This metadata update is NOT backed up
metadata/mirror.c:1105   Failed to initialize log device
metadata/mirror.c:1145         <backtrace>
lvconvert.c:1547         <backtrace>
lvconvert.c:3084         <backtrace>
2014-02-19 23:34:07 +01:00
Jonathan Brassow
00ce01e52d cache-pool: Change segtype name from cache_pool to cache-pool
Thin pools use "thin-pool" for the segment type name.  To be consistent,
we use "cache-pool" instead of "cache_pool".
2014-02-19 09:26:03 -06:00
Zdenek Kabelac
c71a3bcbc0 activation: lv_activation_skip remove always same arg.
Remove 'skip' argument passed into the function.
We always used '0' - as this is the only supported
option (-K) and there is no complementary option.

Also add some testing for behaviour of skipping.
2014-02-19 11:33:39 +01:00
Zdenek Kabelac
fdcd95a3b3 tests: check locking is not lost during thin_check 2014-02-18 14:58:41 +01:00
Zdenek Kabelac
0e0f91b6dd tests: use exclusive activation for mirror case
Since mirror doesn't take exclusive lock implicitely yet,
enforce it for cluster testing.
2014-02-18 10:39:29 +01:00
Jonathan Brassow
6a00a7e33d RAID: Allow implicit stripe (and parity) when creating RAID LVs
There are typically 2 functions for the more advanced segment types that
deal with parameters in lvcreate.c: _get_*_params() and _check_*_params().
(Not all segment types name their functions according to this scheme.)
The former function is responsible for reading parameters before the VG
has been read.  The latter is for sanity checking and possibly setting
parameters after the VG has been read.

This patch adds a _check_raid_parameters() function that will determine
if the user has specified 'stripe' or 'mirror' parameters.  If not, the
proper number is computed from the list of PVs the user has supplied or
the number that are available in the VG.  Now that _check_raid_parameters()
is available, we move the check for proper number of stripes from
_get_* to _check_*.

This gives the user the ability to create RAID LVs as follows:
# 5-device RAID5, 4-data, 1-parity (i.e. implicit '-i 4')
~> lvcreate --type raid5 -L 100G -n lv vg /dev/sd[abcde]1

# 5-device RAID6, 3-data, 2-parity (i.e. implicit '-i 3')
~> lvcreate --type raid6 -L 100G -n lv vg /dev/sd[abcde]1

# If 5 PVs in VG, 4-data, 1-parity RAID5
~> lvcreate --type raid5 -L 100G -n lv vg

Considerations:
This patch only affects RAID.  It might also be useful to apply this to
the 'stripe' segment type.  LVM RAID may include RAID0 at some point in
the future and the implicit stripes would apply there.  It would be odd
to have RAID0 be able to auto-determine the stripe count while 'stripe'
could not.

The only draw-back of this patch that I can see is that there might be
less error checking.  Rather than informing the user that they forgot
to supply an argument (e.g. '-i'), the value would be computed and it
may differ from what the user actually wanted.  I don't see this as a
problem, because the user can check the device count after creation
and remove the LV if they have made an error.
2014-02-17 20:18:23 -06:00
Zdenek Kabelac
0be6caba6e tests: drop more debug.log
Avoid login result from last lvm command when target_at_least fails.
2014-02-17 22:25:53 +01:00
Zdenek Kabelac
18cac16540 tests: more clustered testing 2014-02-17 22:25:53 +01:00
Zdenek Kabelac
37cf201906 tests: on older system use mirror type 2014-02-17 22:25:53 +01:00
Zdenek Kabelac
8eedb18c73 tests: add short delay
Give some extra delay so the file will be opened.
2014-02-17 22:25:53 +01:00
Zdenek Kabelac
25cea92338 thin: fix merge of old snaphost
Fix merging of old snapshot into thinvolume origin.
Add also internal error for the error case when
merging requests activation of merged LV.
2014-02-17 22:25:53 +01:00
Jonathan Brassow
fa4812bf7b cache: Fix cache LV not being instantiated in kernel
When an origin exists and the 'lvcreate' command is used to create
a cache pool + cache LV, the table is loaded into the kernel but
never instantiated (suspend/resume was never called).  A user running
LVM commands would never know that the kernel did not have the
proper state unless they also ran the dmsetup 'table/status' command.
The solution is to suspend/resume the cache LV to make the loaded
tables become active.
2014-02-14 16:04:31 -06:00
Jonathan Brassow
4b6e3b5e5e allocation: Allow approximate allocation when specifying size in percent
Introduce a new parameter called "approx_alloc" that is set when the
desired size of a new LV is specified in percentage terms.  If set,
the allocation code tries to get as much space as it can but does not
fail if can at least get some.

One of the practical implications is that users can now specify 100%FREE
when creating RAID LVs, like this:
~> lvcreate --type raid5 -i 2 -l 100%FREE -n lv vg
2014-02-13 21:10:28 -06:00
Zdenek Kabelac
d68e5d5ab9 tests: utilize check and get
Replace some in-test use of lvs commands with their check
and get equivalent.

Advantage is these 'checking' commands are not necessarily always
valiadated via extensive valgrind testing and also the output noice
is significantly reduces since the output of check/get is suppressed.
2014-02-11 19:00:07 +01:00
Zdenek Kabelac
177db48c11 tests: add check lv_not_exists 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
4ed831e7ef tests: remove debug.log in enable_dev
In aux functions we may drop debug log from
last running lvm command - so we do not
get debug log from properly executed command,
when we fail here.
2014-02-11 19:00:06 +01:00
Jonathan Brassow
96626f64fa cache: Code to allow the create/remove of cache LVs
This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.
2014-02-04 16:50:16 -06:00
Zdenek Kabelac
ef557b8091 tests: update test
Remove some unneeded traces and outputs.
2014-02-04 14:49:38 +01:00
Zdenek Kabelac
42fa0e6dd1 tests: validate acceptable external origin size 2014-01-29 14:59:09 +01:00
Zdenek Kabelac
e9d9852c55 thin: more validation of thin name
Avoid starting conversion of the LV to the thin pool and thin volume
at the same time.  Since this is mostly a user mistake, do not try
to just convert to one of those type, since we cannot assume if the
user wanted LV to become thin volume or thin pool.

Before the fix tool reported pretty strange internal error:
Internal error: Referenced LV lvol1_tdata not listed in VG mvg.

Fixed output:
lvconvert --thinpool lvol0 -T mvg/lvol0
Can't use same LV mvg/lvol0 for thin pool and thin volume.
2014-01-28 13:21:39 +01:00
Zdenek Kabelac
bc5f40ee1c tests: check for mkfs
Test mkfs.ext3 presence for test.
Test also on singlenode cluster.
Speed up a bit slowed down device.
2014-01-28 10:40:08 +01:00
Zdenek Kabelac
c0bd436dcb thin: disable extension of reduced thin with etx.origin
Since we are currently incapable of providing zeroes for
reextended thin volume area, let's disable extension of
such already reduce thin volumes.

(in-release change)
2014-01-28 10:40:08 +01:00
Zdenek Kabelac
6b73d21ba9 locking: avoid dropping locks
When lvm2 command forks, it calls reset_locking(),
which as an unwanted side effect unlinked lock file from filesystem.

Patch changes the behavior to just close locked file descriptor
in children - so the lock is being still properly hold in the parent.
2014-01-27 12:13:29 +01:00
Zdenek Kabelac
f18ee04fab lvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm
Test LVM_LVMETAD_PIDFILE for pid for lvm command.
Fix WHATS_NEW envvar name usage
Fix init order in prepare_lvmetad to respect set vars
and avoid clash with system settings.
Update test to really test the 'is running' message.
2014-01-24 15:59:38 +01:00
Zdenek Kabelac
c1df1f3a81 tests: thin external origin resize 2014-01-23 14:22:34 +01:00
Zdenek Kabelac
efe36fcd43 tests: more testing for online thin metadata resize
Some more tests for online resize, but it's still disabled
by default, since kernel doesn't work yet for this feature.
2014-01-21 13:53:10 +01:00
Zdenek Kabelac
79768b2e9c tests: update testing for xfs 2014-01-20 12:02:33 +01:00
Petr Rockai
e892ac7398 test: Increase the overall timeout to 3 hours. 2014-01-08 17:11:32 +01:00
Petr Rockai
d52c4154c5 test: Time out the entire testsuite after an hour. 2014-01-08 17:11:32 +01:00
Petr Rockai
af8580d756 test: Use klogctl in the harness instead of reading /var/log/messages. 2014-01-08 17:11:32 +01:00
Petr Rockai
1937715d2c test: Add a regression test for pvcreate -ff. 2014-01-08 15:24:43 +01:00
Zdenek Kabelac
2b7f7d0ab4 tests: use compiled lvm for clvmd executed lvs 2014-01-08 13:52:05 +01:00
Zdenek Kabelac
434d95cef3 tests: clear inactive table before resuming in teardown 2013-12-18 10:40:36 +01:00
Zdenek Kabelac
904a02335f tests: hide expected error message
Test typically enables disabled device - so it mostly expects
error target will be reloaded here - thus hide confusing message.
2013-12-17 14:08:54 +01:00
Zdenek Kabelac
fd73b2b7b9 tests: skip pool-label test for lvmetad
Unsupported by lvmetad.
2013-12-17 14:08:54 +01:00
Petr Rockai
56af6cae08 test: Turn check_full into check_system complementary with normal check. 2013-12-15 17:26:28 +01:00
Petr Rockai
97fbbbc150 test: Make the harness optionally less verbose (QUIET=1). 2013-12-15 16:44:47 +01:00
Zdenek Kabelac
c9fe05eee2 tests: count interrupted test as failed 2013-12-10 11:21:40 +01:00
Zdenek Kabelac
e3b7fa4b8d thin: thin metadata resize unsupported with 1.9
Thin kernel target 1.9 still does not support online resize of
thin pool metadata properly - so disable it with expectation
for much higher version - and reenable after fixing kernel.
2013-12-10 11:17:37 +01:00
Alasdair G Kergon
16eab3ec08 config: shorten new sig wiping option string
Rename wipe_signatures_on_new_logical_volumes_when_zeroing  to
wipe_signatures_when_zeroing_new_lvs.
2013-12-09 09:35:47 +00:00
Zdenek Kabelac
2b3adf4eea tests: more limits for python test
It will be most probably more problem with
incomplete initialization of lvm.conf settings
when lvm2app is in use.

Skip cluster & lvmetad test for now.
2013-12-06 10:37:49 +01:00
Zdenek Kabelac
f460d6d9b5 tests: python test needs dmeventd
Until lvm2app respects all lvm.conf setting,
this test require dmeventd.
2013-12-06 10:08:34 +01:00
Zdenek Kabelac
b494881e68 tests: sysrq only when stuck with no output.
If we are stuck in user for too long without output,
grab kernel stack traces.
If we just produce too many lines of output, it's
not probably kernel related bug.
2013-12-05 12:40:47 +01:00
Zdenek Kabelac
c7b733cd6c tests: do not run lvmetad tests without lvmetad
Skip tests when lvmetad is not compiled.
2013-12-05 12:40:47 +01:00
Zdenek Kabelac
aa75698a17 tests: harness prints debug.log
When the test is interrupted because debug.log has got to big,
and the test doesn't react on SIGINT - and needs to be only
killed with SIGKILL - it's still valuable to print at least
a portion of this debug.log (currently 4MB).

LVM_TEST_UNLIMITED  could be set to avoid this limitation
(i.e. when busy-looping lvm command needs to be running
for gdb attachment)
2013-12-05 11:18:15 +01:00
Zdenek Kabelac
76ca82df82 tests: drop RUN... already have this var elsewhere 2013-12-04 21:37:33 +01:00