1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

997 Commits

Author SHA1 Message Date
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