1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00
Commit Graph

582 Commits

Author SHA1 Message Date
Petr Rockai
c4d973530f 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
29ab9ad5b3 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
219b1d015b 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
fff1723b6f 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
95dd4eae53 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
2d812dea99 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
e0c9b24a6d Adding test for repair when confusing metadata are found 2011-07-18 12:04:42 +00:00
Petr Rockai
1c8512eb62 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
459f6c60e6 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
Alasdair Kergon
30776aea04 first attempt to fix test 2011-07-04 16:27:27 +00:00
Alasdair Kergon
0eee66e257 Add framework for validation of ioctls. Doesn't do any checks yet.
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
2011-07-01 14:09:19 +00:00
Alasdair Kergon
34be5fb50f update pv_attr check for new missing attr 2011-06-30 19:32:51 +00:00
Alasdair Kergon
3f98a2885d use remove -f 2011-06-30 09:17:49 +00:00
Alasdair Kergon
2fcba16688 teardown stray filesystems too 2011-06-30 09:15:53 +00:00
Zdenek Kabelac
5beb23518d Use -f to remove device
Since some test may leave devices in suspend mode which would require
carefull order of resume operation - use '-f' to replace them with
error targets

For disable_dev  - when  'error' target is used for open count - treat
return code as ok (|| true) to avoid breaking futher test processing.
2011-06-30 09:08:22 +00:00
Milan Broz
cf332f746e Try to force remove dm devices in after test fails. 2011-06-30 08:50:10 +00:00
Alasdair Kergon
2df71f33ac Try to remove any stray loop devices left behind by earlier aborted tests. 2011-06-30 01:17:37 +00:00
Alasdair Kergon
61a821884d test attempt to remove stray loop devs 2011-06-30 00:57:29 +00:00
Alasdair Kergon
06577e86d8 Add age filter to dmsetup udevcomplete_all to minimise concurrency problems. 2011-06-29 21:56:46 +00:00
Alasdair Kergon
589154d209 make udev teardown conditional on using udev 2011-06-29 18:18:18 +00:00
Alasdair Kergon
73c5f313e5 teardown aborts if it hits an error, so better teardown semaphores earlier
as we need them later in the teardown process
2011-06-29 18:14:08 +00:00
Alasdair Kergon
637245e9f5 print any loop devs that weren't torn down 2011-06-29 17:37:30 +00:00
Alasdair Kergon
e2aa3cf6ae remove any stray semaphores after tearing down devs 2011-06-29 17:33:39 +00:00
Alasdair Kergon
ec8423ad76 Add uuids to dmsetup create cmds. 2011-06-29 12:37:51 +00:00
Alasdair Kergon
d5b96bdd95 use dmsetup remove -f as a better way of simulating a device "disappearing" 2011-06-29 12:33:18 +00:00
Alasdair Kergon
2e7ab82b92 More readahead tests. 2011-06-28 09:43:28 +00:00
Alasdair Kergon
77d16e2e39 Change to still sync with udev (to test waiting for rules) then to verify udev
operations like it used to (which will perform them on systems with
non-std dev dirs where test udev rules aren't installed).
2011-06-28 00:38:26 +00:00
Alasdair Kergon
1c365783e8 Selectively enable/disable udev rules. 2011-06-28 00:11:46 +00:00
Milan Broz
3477dd6c19 Fail allocation if number of extents not divisible by area count
Allocation should fail early if this condition is not met.

Quick fix for https://bugzilla.redhat.com/show_bug.cgi?id=707779
2011-06-23 10:53:24 +00:00
Petr Rockai
9ae83a8ea9 Fix RHBZ 651590 (failure to lock LV results in failure to repair mirror after
transient error), stemming from the following sequence of events:

1) devices fail IO, triggering repair
2) dmeventd starts fixing up the mirror
3) during the downconversion, a new metadata version is written

--> the devices come back online here

4) the mirror device suspend/resume is called to update DM tables
5) during the suspend/resume cycle, *pre*-commit metadata is read;
   however, since the failed devices are now back online, we get back
   inconsistent set of precommit metadata and the whole operation fails

The patch relaxes the check that fails in step 5 above, namely by ignoring
inconsistencies coming from PVs that are marked MISSING.
2011-06-15 17:45:02 +00:00
Milan Broz
19f592f230 Fix kernel version test (RHEL: 2.6.32-123). 2011-06-09 19:48:26 +00:00
Milan Broz
a543712431 Fix mirrored stripe reduction.
Patch adds check for stripe not only in direct
LV segment but also in mirror image segment.

This prevents bugs like:

# lvcreate -i2 -l10 -n lv vg_test
# lvconvert -m1 -i1 vg_test/lv

# lvreduce -f -l1 vg_test/lv
  WARNING: Reducing active logical volume to 4.00 MiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
  Reducing logical volume lv to 4.00 MiB
  Segment extent reduction 9 not divisible by #stripes 2
  Logical volume lv successfully resized

# lvremove -f vg_test
  Segment extent reduction 1 not divisible by #stripes 2
  LV segment lv:0-4294967295 is incorrectly listed as being used by LV lv_mimage_0
  Internal error: LV segments corrupted in lv_mimage_0.
2011-06-09 19:38:56 +00:00
Milan Broz
4964e2d615 Fix extent rounding for striped segments.
We should never remove more extents than requested by user,
so round up to next stripe boundary during lvreduce.

Also this fixes round to zero sized LV bug:

# lvcreate -i2 -I 64k -l10 -n lvs vg_test
# lvreduce -f -l1 vg_test/lvs
  Rounding size (1 extents) down to stripe boundary size for segment (0 extents)
  WARNING: Reducing active logical volume to 0
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
  Reducing logical volume lvs to 0
  Failed to suspend lvs
2011-06-09 19:34:49 +00:00
Milan Broz
4abb15db5f Fix kernel version parsing in tests, use common function. 2011-06-09 18:58:00 +00:00
Milan Broz
81594343d3 Fix topology test.
Kernel version is misparsed in Fedora rawhide, just test sysfs file.

SCSI_DEBUG_DEV is no longer exported, use provided file instead.
2011-06-09 14:26:47 +00:00
Petr Rockai
db40789590 Also check in the pe_start API test that the disks have not been touched. 2011-06-04 21:55:25 +00:00
Petr Rockai
af8966c42e Add an API test that shows how to find a value of pe_start for a VG without
actually creating the VG on-disk.
2011-06-04 21:46:34 +00:00
Petr Rockai
7b64fccba1 Rewrite vgreduce --removemissing --force, using existing primitives:
lv_remove_with_dependencies and mirror_remove_missing (the latter coming from
lvconvert). Remove substantial amount of legacy code.
2011-05-07 15:52:16 +00:00
Zdenek Kabelac
9139a95616 Add missing cleanup for vgimportclone script 2011-04-28 22:17:06 +00:00
Dave Wysochanski
207060d03c Disable nightly test for vgimportclone until proper fix is made.
This fails on lenny buildslave for some reason.
For now disable the vgimportclone part of the test until proper fix.

Let the first part of the test still run though, which shows pvs working
with duplicate pvs.
2011-04-21 19:06:00 +00:00
Dave Wysochanski
b641164ece Add vgimportclone symlink for nightly test. 2011-04-21 17:42:58 +00:00
Dave Wysochanski
8a997e48fb Add nightly test for vgimportclone and querying of vgnames with duplicate pvs.
Related to rhbz 697959.

This test fails prior to these two commits:
commit af112eb2c9
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date:   Thu Apr 21 13:15:26 2011 +0000

    Skip check for NULL before dm_free

    dm_free makes this test itself.

commit 91419c3e86
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date:   Thu Apr 21 13:13:40 2011 +0000

    Fix use of released vgname and vgid
2011-04-21 17:03:38 +00:00
Zdenek Kabelac
91419c3e86 Fix use of released vgname and vgid
Avoid using of already released memory when duplicated MDA is found.

As get_pv_from_vg_by_id() may call lvmcache_label_scan() use the local copy
of the vgname and vgid on the stack as vginfo may dissapear and code was
then accessing garbage in memory.

i.e.  pvs  /dev/loop0
(when /dev/loop0 and /dev/loop1 has same MDA content)

Invalid read of size 1
   at 0x523C986: dm_hash_lookup (hash.c:325)
   by 0x440C8C: vginfo_from_vgname (lvmcache.c:399)
   by 0x4605C0: _create_vg_text_instance (format-text.c:1882)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)
   by 0x47FBD8: vg_read_internal (metadata.c:3231)
   by 0x477594: get_pv_from_vg_by_id (metadata.c:344)
   by 0x45F07A: _get_pv_if_in_vg (format-text.c:1400)
   by 0x45F0B9: _populate_pv_fields (format-text.c:1414)
   by 0x45F40F: _text_pv_read (format-text.c:1493)
   by 0x480431: _pv_read (metadata.c:3500)
   by 0x4802B2: pv_read (metadata.c:3462)
 Address 0x652ab80 is 0 bytes inside a block of size 4 free'd
   at 0x4C2756E: free (vg_replace_malloc.c:366)
   by 0x442277: _free_vginfo (lvmcache.c:963)
   by 0x44235E: _drop_vginfo (lvmcache.c:992)
   by 0x442B23: _lvmcache_update_vgname (lvmcache.c:1165)
   by 0x443449: lvmcache_update_vgname_and_id (lvmcache.c:1358)
   by 0x443C07: lvmcache_add (lvmcache.c:1492)
   by 0x46588C: _text_read (text_label.c:271)
   by 0x466A65: label_read (label.c:289)
   by 0x4413FC: lvmcache_label_scan (lvmcache.c:635)
   by 0x4605AD: _create_vg_text_instance (format-text.c:1881)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)

Add testing script
2011-04-21 13:13:40 +00:00
Petr Rockai
35c174671b Always copy all tests to builddir regardless of T/S, since subsequent runs
(possibly with different T or S) skip that step.
2011-04-19 15:28:17 +00:00
Petr Rockai
ba7d6c9dd0 Make the mirror log checks in t-lvconvert-repair-policy a bit more strict
(i.e. accurate).
2011-04-12 12:39:24 +00:00
Petr Rockai
81095cc6ea This patchset refactors some reporting code and completes the remaining
lvseg properties for lvm2app, 'devices' and 'seg_pe_ranges'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2011-04-12 12:24:29 +00:00
Zdenek Kabelac
f00b069236 Testing: remove -q from grep
to avoid any problems with pipe breaking.
2011-03-30 13:39:24 +00:00
Zdenek Kabelac
012b164bae Reduce amount of vgremove and vgchange calls
A bit noticable time defference when whole test-suite is run through valgrind.
2011-03-28 11:35:20 +00:00
Zdenek Kabelac
46e72765b6 Indent spaces to tabs 2011-03-10 14:47:22 +00:00
Milan Broz
c2501a7747 Fix test for 8k page (fails on Sparc architecture). 2011-03-06 18:28:09 +00:00
Milan Broz
ddb128b039 Make the lock test a little bit better... 2011-03-04 15:04:08 +00:00
Milan Broz
3e881b9726 Wait until dmeventd properly starts in test. 2011-03-04 14:19:18 +00:00
Zdenek Kabelac
7b0f2031c4 Leave some time to scheduler
Looks like scheduler prefers running task before exiting tasks.
So leave some time to finish running flock process.
2011-03-03 16:04:53 +00:00
Zdenek Kabelac
786d8aa089 Avoid using pipes on lv commands
Failure on pipe kills lv command and produces memory stacktrace.
Add 'true' for empty grep/sed to avoid generating stacktrace.

This should help with long time (7min) for this test on Lenny testing maching
(mimage was filler with stacktrace and each word was used as LV name).
2011-03-03 15:46:05 +00:00
Milan Broz
263c008cf5 Fix test, "echo n" is not needed when -y is specified. 2011-03-03 14:16:08 +00:00
Zdenek Kabelac
06f8f76ca3 Do not echo y to lvconvert
This lvconvert is now able to complete operation automatically without question.
So remove  'echo y |'  - it's breaking pipe on some bash versions.

i.e.:
+ echo y
./t-lvconvert-mirror-basic.sh: line 104: echo: write error: Broken pipe

while command has completed this operation succesfully
2011-03-03 12:30:33 +00:00
Milan Broz
e717fa3bef Increase check timeout again.
It fails on my s390x Hercules emulator otherwise. :)
2011-03-02 20:14:39 +00:00
Milan Broz
c537579e61 Fix test to use explicit /dev/mapper/ node, /proc/mounts should not change this...
(failed on RHEL5)
2011-03-02 13:49:29 +00:00
Petr Rockai
45ba9f9c2f As requested in BZ 454618:
- dmeventd -R will continue to start up even if no dmeventd is currently
  running + a test for this behaviour
- add -R to dmeventd manpage
2011-03-02 12:49:13 +00:00
Milan Broz
5993dc5b48 Rather return success if skipping udev wait. 2011-03-01 23:44:07 +00:00
Zdenek Kabelac
c9aeaebd1a Invert condition for READLINE check 2011-03-01 23:29:14 +00:00
Zdenek Kabelac
bc7397105c Build test.c also without readline library
Allow bulding of this testing tool also without readline library.
Outputs message about build without readline library then.
2011-03-01 23:18:40 +00:00
Milan Broz
6795c361c1 Fix tests if udevadm missing (old udev). 2011-03-01 22:28:27 +00:00
Zdenek Kabelac
81957c524b Quick fix to compile lvm2api tests when possible
Do not build lvm2api tests when lvm2api lib is not enabled.
2011-03-01 21:30:43 +00:00
Zdenek Kabelac
23b5c9b9e5 Use backward compatible configuration for test
Currently the test are not properly working with new code.
Use settings for the previous behaviour.

FIXME: update tests to properly test new allocation policies.
2011-02-28 19:44:21 +00:00
Peter Rajnoha
c4dbd497b2 vgconvert is fixed now to work with the changes in metadata area handling - enable the tests.
Add a small fix that preserves pe_start for lvm1 PVs when being converted.

(this fix needs to be replaced with something more clever, but let's have this working now)
2011-02-25 14:12:14 +00:00
Peter Rajnoha
7ef77b52a8 Temporarily disable 'convert a VG from lvm2 to lvm1 format' test until a known issue is resolved.
Otherwise we get an error:

  PV segment VG free_count mismatch: 32 != 33
  PV segment VG extent_count mismatch: 32 != 33
2011-02-21 12:37:33 +00:00
Zdenek Kabelac
02c2036731 Replace PV_MIN_SIZE with function pv_min_size()
Add configurable option to define minimal size of
of block device usable as a PV.

pv_min_size() is added to lvm-globals and it's being
initialized through _process_config.

Macro PV_MIN_SIZE is unused and removed.

New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global
and unlike PV_MIN_SIZE it uses KB units.

Should help users with various slow devices attached to the system,
which cannot be easily filtered out (like FDD on /dev/sdX):
https://bugzilla.redhat.com/show_bug.cgi?id=644578
2011-02-18 14:11:22 +00:00
Petr Rockai
e8c5b0512d Allow overriding the DM_DEV_DIR used by the test suite (fixes BZ 672796). Use
like this:

# LVM_TEST_DEVDIR=/tmp/dev make check
2011-02-09 17:57:14 +00:00
Zdenek Kabelac
c60ff20842 Skip sysinit test for cluster
Add #bin/bash to utils.sh
and update fsadm test to current version of aux script
2011-01-31 22:05:30 +00:00
Zdenek Kabelac
e4b7c72b3a Fix udev synchronization for no-locking mode
Instead of implicitly syncing udev operation in clustered and
file locking code -  call synchronization directly in lock_vol() when
the operation unlocks VG

The problem is missing implicit fs_unlock() in the no_locking code.
This is used with --sysinit on read-only filesystem locking dir.
In this case vgchange -ay could exit before all udev nodes are properly
synchronised and may cause problems with accessing such node right after
vgchange --sysinint command is finished.

Add test case for vgchange --sysinit.
2011-01-31 19:52:40 +00:00
Zdenek Kabelac
e50edb8410 Lower device size of pvmove test
Lower the size of devices in this test for speedup.
And check only once that  LVs are prepared properly.
2011-01-28 16:15:08 +00:00
Zdenek Kabelac
5b8845974c Lower disk space usage of inconsistent mda test
Smaller size of devices speedups this test.
2011-01-28 16:13:39 +00:00
Zdenek Kabelac
2169ecd063 Replacei sleep wait with udev settle
Use new udev_wait command instead of unpredictable sleep waiting.
As with more devices in the system, udev processing is slower.
2011-01-28 16:12:45 +00:00
Zdenek Kabelac
74c10192aa Query only test related vg name 2011-01-28 16:11:14 +00:00
Zdenek Kabelac
cb3031b7fe Add command to wait for udevadm settle 2011-01-28 16:10:21 +00:00
Zdenek Kabelac
61e665d65b Do not break pipes
As the option 'set -e -o pipefail' is very sensite on pipe breaking
stop using '-q' for grep commands.

Otherwise this command (with large enough table) would fail:

 dmsetup table | egrep -q

with exit code 141 (128 + SIGPIPE)

As Peter suggested, he prefers to keep '-o pipefail' - so make sure all
piped commands will read the whole output and will not exit too early.
2011-01-28 16:08:39 +00:00
Zdenek Kabelac
2d8c68d097 Accelerate mirror tests
Instead of recreation of whole device set for each test round,
just cleanup created LVs to empty VG.
Lower the size of PV devices to 16MB
2011-01-28 16:07:04 +00:00
Zdenek Kabelac
9bcd306c02 Display duration of tests when it passed.
Enhance output with info about the test duration.
Cleanup few declarations in the code.
2011-01-28 16:05:38 +00:00
Zdenek Kabelac
f2439f2096 Add missing lvm_quit in test
Fix occasional confusing memory leak report in testing.
2011-01-26 21:21:56 +00:00
Jonathan Earl Brassow
f0306e63b2 Add test to make sure that a log device is retained when a
mirror image fails and the policies are set to:
 mirror_image_fault_policy = "replace"
 mirror_log_fault_policy = "remove"
2011-01-19 19:22:07 +00:00
Zdenek Kabelac
ce94c7ea73 Remove -f from list of targets for cleanup
rm -f is already in used for this cleanup.
2011-01-17 15:18:10 +00:00
Zdenek Kabelac
7a18ae6da4 Set default value to counter_last
Missed in previous commit and could be using some random stack value.
2011-01-13 15:03:28 +00:00
Zdenek Kabelac
49376579bf Include default make.tmpl
Use default clean targets for this Makefile
Use also same build flags for compiling testing tools like harness.
2011-01-13 14:58:59 +00:00
Zdenek Kabelac
8a3e1de5c8 Enable monitoring for cluster tests 2011-01-13 14:57:18 +00:00
Zdenek Kabelac
a4cdc80836 Check for file with clvmd pid
Instead of checking  $LOCAL_CLVMD set during some 'aux' execution which
doesn't seem to be propagated to this shell - check for existance of pid
file of clvmd process - so this test is skipped in singlenode cluster test.
2011-01-13 11:05:27 +00:00
Zdenek Kabelac
b598e9482d Hotfix to stop harness busylooping
Harness seems to be able to busyloop in while cycle and not moving forward
for certain buffer - so check whethere there was some progress.
This fix allows to continue after failed cluster test.

Fix gcc warning for hiding global variable 's' -> sig.
2011-01-13 11:02:55 +00:00
Petr Rockai
d2a3f3afa1 Kill clvmd properly after locking_type 3 tests (using clvmd/singlenode). 2011-01-12 16:07:55 +00:00
Jonathan Earl Brassow
d67ac7ed5c Add disk to mirrored log type conversion. 2011-01-11 17:05:08 +00:00
Zdenek Kabelac
57f8bc3081 Use strndup as GNU extension
strndup needs _GNU_SOURCE defined as it's GNU extension.
Remove duplicate string.h header added in previous harness commit.
2011-01-10 13:25:22 +00:00
Petr Rockai
9ce215ed01 Skip the api/percent test on kernels <= 2.6.32. 2011-01-07 15:04:52 +00:00
Petr Rockai
ad7bccb8ea Add a test for the interaction of snapshots of mirrors and lvconvert --repair. 2011-01-07 14:56:52 +00:00
Petr Rockai
3621b75306 Add a test for the interaction of transient errors and dmeventd mirror repair. 2011-01-07 14:56:10 +00:00
Petr Rockai
14908e3a3b Fix a typo in the new relaxed mirror check (test/lib/check.sh). 2011-01-07 14:42:35 +00:00
Petr Rockai
dcaf6313af Remove *.t in test/api's make clean target. 2011-01-07 13:07:10 +00:00
Petr Rockai
b74d30d55a Disable activation/monitoring in testing lvm.conf by default. 2011-01-07 13:04:17 +00:00
Petr Rockai
9c705ce71e Relax the mirror test in test/lib/check.sh. 2011-01-07 13:03:46 +00:00
Petr Rockai
16af1b083b In aux, exit 200 no longer works as skip -- replace with real skip call. 2011-01-07 13:03:04 +00:00
Petr Rockai
f4d63e9e58 Fix up the make clean target in test/. 2011-01-07 12:26:02 +00:00
Zdenek Kabelac
56b6c12e8a Fix gcc warnings for missing headers and prototypes
Add missing header  string.h (strcmp, strndup).
Add 'static' to fix missing prototypes gcc warning.
Remove unused variables verbose_off, TESTDIR, PREFIX.
2011-01-05 15:03:43 +00:00