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
Petr Rockai
0dfafd77d4 TEST: Only run the pvscan --cache test with lvmetad active. 2012-10-08 07:23:13 +02:00
Petr Rockai
e702073235 TEST: Add lvmetad-pvscan-cache to check that pvscan --cache works. 2012-10-07 22:32:32 +02:00
Zdenek Kabelac
7f4f7f70ce test: lvm2api thin data_percent 2012-10-05 10:37:41 +02:00
Zdenek Kabelac
39f3c9de0b test: check data_percent is equal to snap_percent 2012-10-05 10:37:41 +02:00
Jonathan Brassow
886656e4ac RAID: Fix problems with creating, extending and converting large RAID LVs
MD's bitmaps can handle 2^21 regions at most.  The RAID code has always
used a region_size of 1024 sectors.  That means the size of a RAID LV was
limited to 1TiB.  (The user can adjust the region_size when creating a
RAID LV, which can affect the maximum size.)  Thus, creating, extending or
converting to a RAID LV greater than 1TiB would result in a failure to
load the new device-mapper table.

Again, the size of the RAID LV is not limited by how much space is allocated
for the metadata area, but by the limitations of the MD bitmap.  Therefore,
we must adjust the 'region_size' to ensure that the number of regions does
not exceed the limit.  I've added code to do this when extending a RAID LV
(which covers 'create' and 'extend' operations) and when up-converting -
specifically from linear to RAID1.
2012-09-27 16:51:22 -05:00
Petr Rockai
f8e287cca2 TEST: Workaround for lvmetad vs inconsistent metadata. 2012-09-26 17:26:23 +02:00
Petr Rockai
2d7a8b4531 TEST: Add LVM_VALGRIND_LVMETAD to testing options. 2012-09-26 17:26:23 +02:00
Petr Rockai
c7b17836ea Implement devices/global_filter.
The global filter is applied first, and is also applied in pvscan --cache (which
is called from udev rules to keep lvmetad updated). Cf. example.conf.
2012-09-26 14:49:15 +02:00
Petr Rockai
376cb3fe64 TEST: Kill lvmetad early in teardown. 2012-09-26 12:23:34 +02:00
Marian Csontos
9d0dc63c8b Fix tests to accept extended attribute
attr field had a character (p)artial appended.
2012-09-20 07:30:24 +02:00
Jonathan Brassow
2e04681248 mirror: 'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirror
When reformatting the 'lvchange_resync' code in commit
05131f5853, a '!' should have been removed
from the condition that checks for the LV_NOTSYNCED flag on a corelog
mirror LV.  The presence of this '!' caused the LV_NOTSYNCED flag to be
cleared when it wasn't present and left when it was present.

It is not allowed to add images to a 'mirror' or 'raid1' LV if the
LV_NOTSYNCED flag is set.  We add some up-convert tests to ensure this
behavior is being enforced and that the LV_NOTSYNCED flag is being
properly cleared by 'lvchange --resync'.

(Not updating WHATS_NEW because this is intrarelease.)
2012-09-19 11:16:45 -05:00
Jonathan Brassow
5cdd7848f4 TEST: Add missing test for RAID module version
RAID10 was added to dm-raid module version 1.3.0.  Omitted test for
this version is causing test suite to fail.
2012-09-12 06:27:37 -05:00
Jonathan Brassow
1b01a2f65a TEST (lvresize-raid): Also test resizing of RAID10 2012-09-05 11:33:07 -05:00
Peter Rajnoha
2a70e98b05 test: snapshot_extend_threshold -> snapshot_autoextend_threshold
Missing the "auto" prefix in the config key name. The unknown
setting is silently ignored otherwise.
2012-08-27 14:04:21 +02:00
Zdenek Kabelac
5a3c597fd5 tests: testing lvm_lv_rename
Test stacking of rename operation within one udev transaction.
2012-08-27 13:03:15 +02:00
Jonathan Brassow
4047e4dfb1 RAID: Add support for RAID10
This patch adds support for RAID10.  It is not the default at this
stage.  The user needs to specify '--type raid10' if they would like
RAID10 instead of stacked mirror over stripe.
2012-08-24 15:34:19 -05:00
Petr Rockai
b61be64370 libdaemon: Draft logging infrastructure.
- logging is not controlled by "levels" but by "types"; types are
  independent of each other... implementation of the usual "log level"
  user-level semantics can be simply done on top; the immediate
  application is enabling/disabling wire traffic logging independently
  of other debug data, since the former is rather bulky and can easily
  obscure almost everything else
- all logs go to "outlets", of which we currently have 2: syslog and
  stderr; which "types" go to which "outlets" is entirely configurable
2012-08-08 09:44:19 +02:00
Petr Rockai
20ca6d6545 TEST: Add lvmetad-test; checks --test with lvmetad. 2012-07-30 11:21:55 +02:00
Jonathan Brassow
599f18db8a TEST: Conditionalize RAID tests on whether the dm-raid module exists 2012-07-25 09:43:28 -05:00
Jonathan Brassow
5555d2a000 RAID: Fix segfault when attempting to replace RAID 4/5/6 device
Commit 8767435ef8 allowed RAID 4/5/6
LV to be extended properly, but introduced a regression in device
replacement - a critical component of fault tolerance.

When only 1 or 2 drives are being replaced, the 'area_count' needed
can be equal to the parity_count.  The 'area_multiple' for RAID 4/5/6
was computed as 'area_count - parity_devs', which could result in
'area_multiple' being 0.  This would ultimately lead to a division by
zero error.  Therefore, in calc_area_multiple, it is important to take
into account the number of areas that are being requested - just as
we already do in _alloc_init.
2012-07-24 19:02:06 -05:00
Jonathan Brassow
407198e17d TEST: Replace old sync test/wait functions with new library functions
Generic sync test/wait functions have replaced the old mirror/raid functions.
2012-07-24 14:20:30 -05:00
Jonathan Brassow
753cb9204d TEST: Add library functions for checking and waiting for sync
Add 'in_sync' and 'wait_for_sync' to test and wait for synchronization
of a mirror or RAID logical volume.
2012-07-24 14:17:54 -05:00
Jonathan Brassow
00d9bf8107 TEST (lvresize-raid): Don't run test when RAID module doesn't exist
Check for RAID module and skip test if not there.
2012-07-17 10:50:21 -05:00
Jonathan Brassow
8767435ef8 RAID: Fix extending size of RAID 4/5/6 logical volumes.
Reducing a RAID 4/5/6 LV or extending it with a different number of
stripes is still not implemented.  This patch covers the "simple" case
where the LV is extended with the same number of stripes as the orginal.
2012-06-26 09:44:54 -05:00
Jonathan Brassow
bf81d5607a TEST (lvconvert-raid): Turn on RAID conversion testing under snapshots 2012-06-26 06:45:45 -05:00
Jonathan Brassow
7168880caa TEST (lvconvert-raid): localize a function variable
Function was overwriting a global variable because it used a variable
of the same name without first declaring it with 'local'.
2012-06-25 22:25:46 -05:00
Jonathan Brassow
149ab6921e TEST (lvcreate-raid): Allow more time for RAID arrays to sync
My machines can run very slow sometimes causing this test to fail
when it would otherwise have succeeded given more time.
2012-06-25 22:20:24 -05:00
Alasdair G Kergon
dd5b2974c0 gitignore: Remove redundant test dir entry 2012-06-08 23:34:15 +01:00
Peter Rajnoha
9bb148ff4e Partial activation working, expect success in tests. 2012-05-17 12:03:30 +00:00
Peter Rajnoha
1dffc9bcb0 Re-enable tests for snapshots of mirrors. 2012-05-17 08:04:11 +00:00
Zdenek Kabelac
313a71048e snaps of mirrors are enabled 2012-05-16 15:01:06 +00:00
Petr Rockai
12a15f939c Add a (currently failing) test for RHBZ 816672. 2012-05-16 10:44:36 +00:00
Petr Rockai
03885b6863 Add provisions to flag tests that we know will fail, without flagging the build
(i.e. an expected failure).
2012-05-16 10:43:41 +00:00
Peter Rajnoha
ec808a033b Remove VG/PV used in the test. 2012-05-09 14:44:59 +00:00
Peter Rajnoha
9c17acdfe8 Fix division by zero if PV with zero PE count is used during vgcfgrestore. 2012-05-09 12:30:56 +00:00
Jonathan Earl Brassow
eb2d70293d Fix up-convert when mirror activation is controled by volume_list and tags.
When mirrors are up-converted, a transient mirror layer is put in so that
only the new devices are sync'ed.  That transient layer must carry the tags
of the original mirror LV, otherwise it will fail to activate when activation
is regulated by lvm.conf:activation/volume_list.  The conversion would then
fail.

The fix is to do exactly the same thing that is being done for linear ->
mirror converting (lib/metadata/mirror.c:_init_mirror_log()).  We copy the
tags temporarily for the new LV and remove them after the activation.
2012-05-05 02:08:46 +00:00
Jonathan Earl Brassow
1e4e9548b1 Disallow snapshots of mirror segment types.
Snapshots of RAID logical volumes are allowed (including "raid1").  However,
snapshots of "mirror" logical volumes has been disallowed due to unsolvable
issues inherent to the design.  The fact that mirroring (dm-raid1.c) must
stop all I/O as the result of a failure and wait for userspace intervention
can lead to a circular dependency if userspace is simultaneously waiting for
snapshots (on mirrors) to make an I/O update before proceeding.

Various snapshot on mirror tests have been removed as a result.
2012-05-01 19:21:24 +00:00
Zdenek Kabelac
dd11efb673 Expect failure if the reduction doesn't really happen 2012-04-24 12:17:49 +00:00
Zdenek Kabelac
83eeeb59ed Update test 2012-04-11 12:53:46 +00:00
Zdenek Kabelac
a59c3731c3 Improve test suite
Add make help target.
Add LVM_TEST_PARALLEL to support parallel runs of tests
Work around the problem the dmsetup table/info may return error
by using dmtable and dminfo function that will use 'should'.
(Error happens when some concurently running process removes table
entry while dmsetup command resolves table entries inside the loop.)
2012-03-28 11:10:08 +00:00
Peter Rajnoha
9e072e7072 Fix tests to work with vgscan --cache fixing inconsistent metadata. 2012-03-28 07:46:35 +00:00
Zdenek Kabelac
86bdfb3722 Improve teardown_devs
Try to avoid start of dmeventd during vgremove if the code has any bug
inside.
2012-03-23 09:41:20 +00:00
Zdenek Kabelac
8100989dbb Sleep longer in the test so it really dies properly
and check for right exit code from pgrep
2012-03-20 13:35:46 +00:00
Zdenek Kabelac
ef199faeda Update testing scripts
Make the teardown really usable - it will try down to remove all the left
devices even from previous test runs
(the only missing piece is probably proper mdadm teardown)
Add few more local vars
Try to setup PATH and LD_LIBRARY_PATH just once.
Try shorter sleeps.
2012-03-20 10:51:57 +00:00
Zdenek Kabelac
758f674240 Update test for dmevent restart
Actually restart was failing for different reason - so pass in proper
location of dmeventd for restart from lvm command and avoid using
the one from /sbin location.

Update pv create test with "" around path.
2012-03-20 10:48:59 +00:00
Zdenek Kabelac
fad6a65f3c Add comment about slow startup of dmeventd
Separat lvm dumpconfig on extra line, so the shell trace output
is not mixed with dump.
2012-03-16 19:13:09 +00:00
Zdenek Kabelac
171d7d5793 Skip dmeventd restart test
If dmevendt is not in /sbin, do not try to run restarting test.
FIXME: add some workaround for testing.
2012-03-16 19:11:29 +00:00
Zdenek Kabelac
e79d64b52b Regression fix kernel version check
got changed improperly with large update patch.
2012-03-16 19:09:49 +00:00
Zdenek Kabelac
358b3ce26b Longer sleep after clvmd start 2012-03-16 19:08:09 +00:00
Zdenek Kabelac
6bf324c4fd Switch condition for dmeventd check 2012-03-16 13:44:51 +00:00
Zdenek Kabelac
351be15dc4 Update tests
Indent

Shell improvements - use internal function for checks

Use PVs in ""   (LV and VG cannot have spaces)

Several test very starting 'dmeventd' without annoucing
it via prepade_dmeventd.

Fix some of test actually.
2012-03-16 13:00:05 +00:00
Zdenek Kabelac
cce2475889 Update test.sh check.sh utils.sh get.sh
Indent
Better shell usage
Function simplification
More usage of 'get' functions
Don't use valgrind tracing for check and get function (faster)
Update shell debugging (PS4, better stacktrace)
Support paths with spaces
Export SCRIPTNAME for external usage
Watch for dmeventd unexpectedly started during test
2012-03-16 12:59:43 +00:00
Zdenek Kabelac
fd818eb3aa Update aux.sh lvmwrapper
Indent

Add valgrind support:
 env LVM_TEST_VALGRIND={0123} (the higher level, more commands tested)
 env LVM_TEST_CLVMD=1   runs clvmd within valgrind.
 env VALGRIND  script name executed for each lvm command (def. is valg).

Smarted teardown - should minimize occurence of left dev entries
 (using dmsetup remove -f only as last resort)
 sort removed devices by open count before actual removal

Use "" around string that may contain spaces.

Set log/verbose and activation/retry_deactivation to defined value.

Remove  debug.log after successful lvm command (easier to check output).
2012-03-16 12:59:02 +00:00
Zdenek Kabelac
7755376d7c Test suite skip md_detection
Not normally needed - lets' enable it only for test that
really needs it.
2012-03-16 12:57:28 +00:00
Zdenek Kabelac
803b1056ca Allow to use also special prefixed names for test
Currently we could not test special prefixes in our test suite.
As teardown will not find such device and basicaly busyloops here,
as at cannot remove such names.

This patch adds possibity to use:

vgcreate  V_$vg1 $dev

Note: you still need to use $PREFIX somewhere in the name.
(And of course, it's really bad idea to use $PREFIX (=LVMTEST)
 for normally used LVs)

The only purpose of this patch is to allow testing cluster with
special vg names that begins with V_ , P_....
2012-03-16 12:56:29 +00:00
Petr Rockai
5ee11ece1a Relax the active-minor test a bit. 2012-03-16 11:36:51 +00:00
Petr Rockai
7720ed7037 Fix a regression in handling --major/--minor arguments to lvcreate & lvchange,
by allowing arg_int_value to be used with groupable options.
2012-03-16 10:43:52 +00:00
Jonathan Earl Brassow
dc7b1640ed Fix name conflicts that prevent down-converting RAID1 when specifying a device
When down-converting a RAID1 device, it is the last device that is extracted
and removed when the user does not specify a particular device.  However,
when a device is specified (and it is not the last), the device is removed and
the remaining sub-LVs are "shifted down" to fill the hole.  This cause problems
when resuming the LV because if the shifted devices were resumed (and thus
renamed) before the sub-LV being extracted, there would be a name conflict.
The solution is to resume the extracted sub-LVs first so that they can be
properly renamed preventing a possible conflict.

This addresses bug 801967.
2012-03-15 20:00:54 +00:00
Zdenek Kabelac
813a1868c6 Use proper "" for absolute paths 2012-03-14 17:14:33 +00:00
Zdenek Kabelac
32e7600cbd Improve harness code
Support timestamping with harness -  using VERBOSE=2
Fix also logging in several situation
(i.e. continue logging multiple test in VERBOSE mode,
do not coredump with empty output).
2012-03-12 14:24:15 +00:00
Alasdair Kergon
6185506b85 update reworded string 2012-03-06 03:16:05 +00:00
Alasdair Kergon
d36313a418 Change pvscan --cache syntax 2012-03-06 02:54:31 +00:00
Peter Rajnoha
1518c7aac2 Add test for name mangling functionality. 2012-03-05 12:49:06 +00:00
Zdenek Kabelac
1e6a29dbee Update thin test for thin_check
Test if thin_check is present in system and disable its use, when its missing.

Add testing for poolmetadatasize.

FIXME: Allocation policy for metadata pool might need some relaxing.
(For now it needs to put all block on one PV.)
2012-03-04 16:04:52 +00:00
Zdenek Kabelac
487c65373b Speedup test run by a few minutes
Reduce disc excercise for some test and focus on LVM testing by
using smaller extent size.

Reduce number of teardown_devs calls and use vg/lvremove instead.

Don't sleep for seconds on pvmove.

FIXME: shell/lvconvert-mirror-basic.sh seems to need more checking.
Test fails for smalled extent size then 512k.
2012-03-04 16:02:19 +00:00
Alasdair Kergon
d742cdf327 Change pvscan --lvmetad to pvscan --cache. 2012-03-02 18:09:46 +00:00
Zdenek Kabelac
e70d12be9e Wait for mirror in sync
1s could be too short
2012-03-02 00:08:48 +00:00
Petr Rockai
8cf54e6e13 Add a regression test for the PSize bug in pvs/lvmetad. 2012-03-01 20:03:45 +00:00
Petr Rockai
726cf41b80 Make the calls to pvscan --lvmetad in the testsuite slightly more civilised. 2012-02-23 23:58:42 +00:00
Zdenek Kabelac
d0a3aa04c8 Unit testing for some string libdm functions
TODO: more functions need to be unit tested.
2012-02-23 22:47:17 +00:00
Petr Rockai
d4836062ff Add a vgscan to lvcreate-repair.sh. The old test applied device filter hacks to
make devices invisible to lvm, but the behaviour of those is slightly different
than of actual missing devices. Running vgscan after re-enabling the device
triggers a metadata repair which is not done by vgremove -ff. This is not a
regression, merely an odd behaviour that has been around even before lvmetad.
2012-02-23 14:55:29 +00:00
Petr Rockai
edfff8a26a Kick out a debugging call to valgrind in lvmcache-exercise.sh. 2012-02-23 14:21:18 +00:00
Petr Rockai
dae0822698 The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in
lvm.conf *and* lvmetad is running.
2012-02-23 13:11:07 +00:00
Petr Rockai
1ea2c6a2f6 Run tests with lvmetad if we have it. 2012-02-15 14:24:31 +00:00
Zdenek Kabelac
5b29e2ac60 Deal with slower test processing
If the merge was faster then query - deal with it and pass the test.
2012-02-15 13:51:17 +00:00
Petr Rockai
a635143d62 In the test harness, do the back-substitution (@TESTDIR@, @PREFIX@) also on the
live VERBOSE output, not just the post-mortem dumps.
2012-02-15 01:31:10 +00:00
Zdenek Kabelac
511a5f3ad8 Add test for memory allocation failures
Replace asserts with test for failing memory allocation.
Add at least stack traces.
Index counter starts from 1 (0 reserved for error), so replacing fingerprint.
2012-02-10 13:49:29 +00:00
Zdenek Kabelac
400dede7a6 TARGETS macro has to be defined before inclusion of make.tmpl
Use @TESTING@ check in this case.
2012-01-27 10:55:02 +00:00
Zdenek Kabelac
599771c9b0 Build test run target only for $(TESTING)
Add libraries properly in LDLIBS.
2012-01-26 21:40:36 +00:00
Zdenek Kabelac
6255e1b5f0 If clvmd is not started, die test instead of skipping it 2012-01-26 18:25:46 +00:00
Jonathan Earl Brassow
6cf3274732 Use suspend|resume_origin_only when up-converting RAID LVs, as mirrors do.
Failure to do so results in "Performing unsafe table load while X device(s) are
known to be suspended" errors.  While fixing the problem in this way works and
is consistent with the way the mirror segment type does it, it would be nice
to find a solution that uses the generic suspend/resume calls.

Also included in this check-in are additions to the test suite that perform
conversions on RAID LVs under a snapshot.  These tests are disabled for the
time being due to a kernel bug that is yet to be tracked down.
2012-01-24 14:33:38 +00:00
Zdenek Kabelac
f9fb138bdd Minor oldstyle warning update 2012-01-09 12:29:15 +00:00
Zdenek Kabelac
61d8cb80e4 Thin update test case
Use thin-pool instead of thin_pool type.
2011-12-21 13:45:42 +00:00
Petr Rockai
90b7423846 Add a unit test for config cascade (overlay). Needs expanding though. 2011-12-18 23:56:36 +00:00
Zdenek Kabelac
c6958856f8 Cleanup test compile warning
Add some declaration and cast to cleanup gcc warnings.
Add missing dm_config_destroy() to cleanup pool leak report.
2011-12-13 12:08:42 +00:00
Petr Rockai
a8215f3774 Use a more canonic regex escaping in the default lvm.conf file for testing. 2011-12-12 00:01:12 +00:00
Petr Rockai
509278c7d2 Add a shell test for config parsing and merging (lvm dumpconfig). 2011-12-11 23:14:37 +00:00
Petr Rockai
06c51c80d7 Add a unit test for dm_config_clone_node. 2011-12-11 15:45:14 +00:00
Petr Rockai
3324f8f4b8 Start a rudimentary unit test for the dm_config_* interface. 2011-12-11 15:19:41 +00:00
Petr Rockai
5da88e5ba4 Use pkg-config to look for CUnit (needed for systems where it's not on the
standard include path).
2011-12-11 15:15:57 +00:00
Petr Rockai
8d21033e52 Nowadays, lvm-version.h is generated from lvm-version.h.in, and lives in the
build directory, not the source one -> fix test/shell/000-basic.sh.
2011-12-10 14:55:31 +00:00
Zdenek Kabelac
b4a39a569a Try longer sleep
Seems like testing machine could be busy - so 10s might not be enough
for rechecking status.
2011-11-23 15:27:14 +00:00
Zdenek Kabelac
8d7da8864e Cleanup files from testing
Cleanup generated files from coverage testing.
Do not skip standard .o compilation for lib/not and lib/harness.
Make a bit longer string in harness to fit new shell/ in.
2011-11-23 14:56:47 +00:00
Zdenek Kabelac
9fb16c608d Swap condition order
Swap condtion so the make line does not return 'false'.
Remove cleanup of lvm2api.sh since it is not created anymore.
2011-11-23 13:03:57 +00:00
Zdenek Kabelac
5a036adb32 Put back devmapper-event linkage
Older systems are not able to get this library from lvm2api library and need
this library to be passed to the linker (i.e. Debian Lenny).
2011-11-23 13:02:17 +00:00
Zdenek Kabelac
4b42d7ae98 Cleanup test makefiles
Simplify /api makefile and use SUBDIRS target for test dir.
Properly cleanup Makefiles with distclean in /test.
Use symbolic links for shell scripts for non-srcdir compilation.
2011-11-23 12:21:41 +00:00
Zdenek Kabelac
c571aeae6f Cleanup gcc warning
bitset_t.c:39: warning: 'last' may be used uninitialized in this function

Compiler is not smart enough to see the code path which avoid using
unitialized 'last'.
2011-11-21 13:15:40 +00:00
Zdenek Kabelac
d6a05ea5e6 Add some cflags to ldflags
Things like gcov needs the compilation flags for linker as well.
TODO: cleanup compilation flags usage
2011-11-21 13:11:03 +00:00
Petr Rockai
58ea7af08c Fix a bug in dmeventd snapshot monitoring code where the monitoring threshold
would grow with subsequent snapshot extensions (RHBZ 754198).
2011-11-21 12:31:18 +00:00
Petr Rockai
8e4a96dcb1 Fix the last fix (t-XXX -> shell/XXX). 2011-11-21 11:36:53 +00:00
Petr Rockai
12494fd3e5 Fix the fallout in shell tests from the t-XXX -> shell/XXX move. 2011-11-21 11:25:35 +00:00
Petr Rockai
f2a3f0fe3d Tidy the shell tests into their own subdir. We now have:
- test/lib -- infrastructure and helper code
- test/api -- liblvm2app API tests
- test/unit -- C-based unit tests
- test/shell -- shell-based functional tests
2011-11-21 00:15:42 +00:00
Petr Rockai
cfe1ec8d1f Fix a syntax error. 2011-11-20 21:55:24 +00:00
Petr Rockai
d4fed28523 Implement a CUnit-based runner for unit tests. Copy and adapt (actual unit)
tests from unit-tests/*/*_t.c (now under test/unit). The valgrind/pool test is
missing, since it's not really a unit test and probably not too valuable
either. Available via "make unit" (and if --enable-testing was passed to
configure, also executed by make check).
2011-11-20 21:43:20 +00:00
Zdenek Kabelac
37f274ced9 Query before removing inactive snapshots
Removal of an inactive origin removes also all related snapshots.

When we now support 'old' external snapshots with thin volumes,
removal of pool will not only drop all thin volumes, but as
a consequence also all snapshots - which might be seen a bit
unexpected for the user - so add a query to confirm such action.

lvremove -f will skip the prompt.
2011-11-18 19:25:20 +00:00
Zdenek Kabelac
7891cead11 Thin send create_snap message
Start creating snapshots for real.
Update test suite to check it happens.
2011-11-10 15:30:59 +00:00
Zdenek Kabelac
54feef9366 Thin update testing script 2011-11-10 12:44:33 +00:00
Zdenek Kabelac
0641b3883d Add generic function to check for target version
So the test script may use a simple line like i.e.:

aux target_at_least dm-thin-pool 1 0 0 || skip
aux target_at_least snapshot-origin 1 6 || skip
2011-11-10 12:44:00 +00:00
Petr Rockai
bac10d6aa3 Do not repeat a failed test's output when VERBOSE is in effect. 2011-11-07 17:02:56 +00:00
Zdenek Kabelac
5a6ae6f5aa Fix core on buggy config file
Since fixed within unreleased version so no WHATS_NEW
2011-10-28 20:07:38 +00:00
Zdenek Kabelac
faf7c493f8 Test with -F flag
grep need -F to check what we really want to test.
Add better test for existing device.

Currently this test DOES NOT work with real /dev handle via udev
since our tool does not see such device listet through udev.

FIXME: We might be able to see it at least through dmsetup table and
use for lvm.
2011-10-23 21:24:27 +00:00
Zdenek Kabelac
c13f82579c Used device name instead of device path
Udev is tricky here - since with udev the node does not exists until
it resume happens.  So we need to resume devices via its name.
2011-10-23 15:43:10 +00:00
Zdenek Kabelac
cb8c101885 Do not make link in the real /dev
Skip trying to make link when real /dev dir is used for test.
2011-10-23 15:40:15 +00:00
Zdenek Kabelac
c6676c2e57 Expect failure with real /dev dir
As udev is for now incapable to create such devices
turn this test error into warning.
2011-10-23 15:39:08 +00:00
Petr Rockai
d0d516eb5e In t-lvcreate-large, do not create a clustered VG. LV activation/suspend does
not work yet with singlenode clvmd in clustered VGs.
2011-10-23 14:30:51 +00:00
Jonathan Earl Brassow
f60175c308 Add the ability to convert LVs of "mirror" segtype to "raid1" segtype.
Example:
~> lvconvert --type raid1 vg/mirror_lv

Steps to convert "mirror" to "raid1"
1) Allocate a RAID metadata LV for each mirror image from the same PVs
   on which they are located.
2) Clear the metadata LVs.  This involves writing LVM metadata, so we don't
   change any aspects of the mirror LV before this so that the user can easily
   remove LVs from the failed convert attempt while retaining the original
   mirror.
3) Remove the mirror log, if it exists.
4) Add metadata LVs to mirror LV
5) Rename mirror sub-lvs (s/mimage/rimage/)
6) Change flags and segtype from mirror to raid1
2011-10-07 14:56:01 +00:00
Jonathan Earl Brassow
d3582e0252 Add the ability to convert linear LVs to RAID1
Example:
~> lvconvert --type raid1 -m 1 vg/lv

The following steps are performed to convert linear to RAID1:
1) Allocate a metadata device from the same PV as the linear device
   to provide the metadata/data LV pair required for all RAID components.
2) Allocate the required number of metadata/data LV pairs for the
   remaining additional images.
3) Clear the metadata LVs.  This performs a LVM metadata update.
4) Create the top-level RAID LV and add the component devices.

We want to make any failure easy to unwind.  This is why we don't create the
top-level LV and add the components until the last step.  Should anything
happen before that, the user could simply remove the unnecessary images.  Also,
we want to ensure that the metadata LVs are cleared before forming the array to
prevent stale information from polluting the new array.

A new macro 'seg_is_linear' was added to allow us to distinguish linear LVs
from striped LVs.
2011-10-07 14:52:26 +00:00
Jonathan Earl Brassow
a391248427 Fix vgsplit when there are mirrors that have mirrored logs.
The problem as reported by "ben <benscott@nwlink.com>" on lvm-devel:

vgsplit fails with mirrored mirror log

#lvs --all -o lv_name,lv_attr,devices
LV                       Attr   Devices
MyMirror                 mwi--
[MyMirror_mimage_0]      Iwi--- /dev/sdq(0)
[MyMirror_mimage_1]      Iwi--- /dev/sdo(0)
[MyMirror_mimage_2]      Iwi--- /dev/sdi(0)
[MyMirror_mlog]          mwi---
[MyMirror_mlog_mimage_0] Iwi--- /dev/sds(0)
[MyMirror_mlog_mimage_1] Iwi--- /dev/sde(0)

#vgsplit -v "TestA" "TestB" "/dev/sdq" "/dev/sdo" "/dev/sdi" "/dev/sds"
"/dev/sde"
  Checking for volume group "TestA"
  Checking for new volume group "TestB"
  Archiving volume group "TestA" metadata (seqno 213).
Can't split mirror MyMirror between two Volume Groups

AFTER FIX:

[root@bp-01 ~]# lvs -a -o name,vg_name,devices vg new
  Volume group "new" not found
  Skipping volume group new
  LV                 VG   Devices
  lv                 vg   lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0]      vg   /dev/sdb1(0)
  [lv_mimage_1]      vg   /dev/sdc1(0)
  [lv_mlog]          vg   lv_mlog_mimage_0(0),lv_mlog_mimage_1(0)
  [lv_mlog_mimage_0] vg   /dev/sdh1(0)
  [lv_mlog_mimage_1] vg   /dev/sdi1(0)
[root@bp-01 ~]# vgsplit vg new /dev/sd[bchi]1
  New volume group "new" successfully split from "vg"
[root@bp-01 ~]# lvs -a -o name,vg_name,devices vg new
  LV                 VG   Devices
  lv                 new  lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0]      new  /dev/sdb1(0)
  [lv_mimage_1]      new  /dev/sdc1(0)
  [lv_mlog]          new  lv_mlog_mimage_0(0),lv_mlog_mimage_1(0)
  [lv_mlog_mimage_0] new  /dev/sdh1(0)
  [lv_mlog_mimage_1] new  /dev/sdi1(0)
2011-10-06 14:17:45 +00:00
Zdenek Kabelac
643d3e8134 Let the utils to prepare PVs 2011-09-29 08:58:27 +00:00
Zdenek Kabelac
7ae124743e Use execvp for clvmd restart
Since execve passed only NULL as environ, we had lost all environment vars on
restart - thus actually running  'different' clvmd then the one at start.

Preserving environ allows to restart clvmd with the same settings
(i.e. LD_LIBRARY_PATH)

Add test for second restart.
2011-09-26 07:51:23 +00:00
Zdenek Kabelac
90d106ef19 Restart CLVMD with same cluster manager
Add named cluster_ops to easily learn the name of the active cluster manager,
so we are able to restart singlenode manager in testing.

Add simple test for clvmd -S  (restart) and -R (refresh)
(though it needs some extensions).
2011-09-25 19:37:00 +00:00
Zdenek Kabelac
102dd99ca4 Allow overwrite for VERIFY_UDEV
When running tests it might be useful to have an override option when
testing on real /dev  and some broken system (i.e. Debian and its rules).

So one can use:

LVM_TEST_DEVDIR=/dev LVM_VERIFY_UDEV=1 make check
2011-09-24 21:15:13 +00:00
Zdenek Kabelac
d040c17000 Avoid sending garbage to terminal in verbose mode.
When read in drain returned <0 value, terminal content has been trashed.
Remove unneeded  memset() and use whole buffer.
Free  readbuf before exit (valgrind).
2011-09-24 21:12:35 +00:00
Zdenek Kabelac
a4b6b51757 Improvements
Simplify RUN_BASE

Put .tests-stamp deps only for check target and fix its cleanup.
Fix abs_top_srcdir.
vgimportclone needs  srcdir.
Clean  api subdir.
2011-09-24 21:10:19 +00:00
Zdenek Kabelac
518164ce96 Detect unusable nodes on fs
Test whether nodes could be used on given filesystem where TMP
dir is being used and skip teardown quicker in fail case.
(makes the problem quickly obvious if you try to such fs).

Skip teardown_dev if we have not created any devs yet.

and do not mkdir /dev/mapper dir  when LVM_TEST_DEVDIR is set.

Drop this test from t-000-basic.sh.
2011-09-24 20:54:35 +00:00
Zdenek Kabelac
da1350d420 Add missing log_error() to lvresize command when fsadm tool fails
Also add test case
2011-09-21 10:39:47 +00:00
Zdenek Kabelac
bfcaa5a4ed Unmount works with -y 2011-09-19 19:37:26 +00:00
Zdenek Kabelac
b28088f0e4 Another vgremove for speedup
It seems like test-suite is significantly slowed down on removal phase.

Maybe it should be part of generic teardown - though the reason of slowdown
should be also discovered -  probably related to retry loop ?
2011-09-19 18:40:51 +00:00
Zdenek Kabelac
08885c4b92 Ensure fsadm.sh is executable
When the srcdir == builddir we get the link on non-exectable file.
So make always sure fsadm.sh is executable script file.

Add cleanup target for lib/fsadm.
2011-09-19 15:54:15 +00:00
Zdenek Kabelac
967f2d4510 Enable t-fsadm test
Now all commands are executed from preffered directory.
2011-09-19 13:52:22 +00:00
Zdenek Kabelac
438f53af63 Add link for fsadm script
Prepare to enabling t-fsadm.sh test
2011-09-19 12:50:17 +00:00
Zdenek Kabelac
8122e7caab Test speed up
Removing vg  reduces time execution of this test.
Teardown has some wait states here...
2011-09-19 12:49:14 +00:00
Milan Broz
5170efd1ee Disable t-lvcreate-large.sh for now with cluster. 2011-09-16 14:32:47 +00:00
Zdenek Kabelac
c89f44ed85 Add inital thin testing
Currently test is skipped by default (since it needs code hack to work)
Check command line options to create & remove thin pools and thin volumes.

Activation code for thin LV support is missing, thus it only works without
driver loaded.
2011-09-16 12:23:59 +00:00
Zdenek Kabelac
e377b78095 Remove vg at the test's end
Speedup this test by removing mirrored vg when it's not longer needed.
teardown() seems to be waiting here for too long.
2011-09-16 11:52:33 +00:00
Petr Rockai
fd7d4adc57 Fix the divisibility check in the allocator for the mirror+stripe case (require
divisibility by stripe count alone, not by (mirror*stripe)).
2011-09-16 09:59:42 +00:00
Petr Rockai
44dfb51f2a When resizing LVs, always round in the safe direction, regardless of whether we
were called as lvresize or lvreduce.
2011-09-15 18:51:11 +00:00
Milan Broz
b18e1fd50e Fix possible overflow of size if %FREE or %VG is used.
https://bugzilla.redhat.com/show_bug.cgi?id=737087
2011-09-15 15:26:40 +00:00
Zdenek Kabelac
eeef355887 Updated testing script
Since attrs were extended by 2 new fields update check functions.
2011-09-09 13:19:19 +00:00
Zdenek Kabelac
77f771ebc3 Replace char class :space: with explicit chars
Some major distributions are still using 'mawk' and they are not using
the latest version - we end here with hidden dependency on the latest
version of mawk (1.3.4) while i.e. Debian Lenny seems to stay with 1.3.3.
So we end with completely broken  vgimportclone script on such system.

We would need to check for proper support of :space: and abort build if
it doesn't work or simplier replace [:space:] with [ \t] which seems
sufficient to make it work (as can be seen in this patch)

A better fix would be to use command line parameter override - leaving
as FIXME comment.

This patch makes t-vgimportclone.sh test passing on Lenny.
2011-09-07 08:31:16 +00:00
Petr Rockai
a53037f2c5 Do not call prepare_lvmetad just yet in tests. 2011-08-31 12:42:55 +00:00
Petr Rockai
615534d305 A compromise integration of LVMetaD into the build: I have kept all the
daemon/common code in a single libdaemon.a, which is completely private. This
is currently linked into the lvmetad binary, and will be linked into LVM (the
client part, since static linking only picks up only symbols that are actually
used). I have also added --enable/disable-lvmetad to ./configure; although the
current default is off, I expect this to be flipped to on shortly. There's no
LVM-side support yet, but when there is, even when built, it'll still need to
be enabled by an lvm.conf option.
2011-08-31 11:31:57 +00:00
Jonathan Earl Brassow
97db301ad4 Move RAID convert tests to new file, t-lvconvert-raid.sh
There is duplicate code in t-lvconvert-raid.sh and t-lvcreate-raid.sh.
This should be moved into a common file which is then sourced by these two
files.  I'll wait to move the duplicate code until I can talk to mornfall.
2011-08-18 19:56:17 +00:00
Jonathan Earl Brassow
4aebd52c4c Add ability to down-convert RAID1 arrays.
Also, add some simple RAID tests to testsuite.
2011-08-11 18:24:40 +00:00
Zdenek Kabelac
cf98c05082 Add detect_internal_vg_cache_corruption to lvm.conf
Add config option to enable crc checking of VG structures.
Currently it's disabled by default.

For the internal test-suite this check it is enabled.

Note: In the case the internal error is detected, debug build with
compile option DEBUG_ENFORCE_POOL_LOCKING helps to catch the source
of the problem.
2011-08-11 17:46:13 +00:00
Zdenek Kabelac
600dbd3b27 Add simple test for read-only table reload suppression
Just a small test for previous libdm commit.
2011-07-25 08:41:52 +00:00
Zdenek Kabelac
80869133f2 Better version of failing 'should' test
where the naming is left completely on lvm.
(Commited code has been different version of test).
So here it should be able to figure out new free name and create a new LV.
2011-07-18 12:12:41 +00:00
Zdenek Kabelac
8e97096fa2 Adding test for repair when confusing metadata are found 2011-07-18 12:04:42 +00:00
Petr Rockai
4ded6393df Fix t-vgreduce-usage to stop relying on the persistent cache not seeing a
device that has been brought back from the dead: this sometimes fails with
clvmd (the cache is updated "too soon"). Instead, force a pvscan and rely on an
up-to-date cache as usual.
2011-07-11 12:13:07 +00:00
Zdenek Kabelac
a6fc6250e0 Increase timeout for udev settle
For some unknown reason (atm) udev settle takes longer time on recent rawhide.
To pass the test - inrease the settle timeout.
2011-07-08 10:05:43 +00:00