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

527 Commits

Author SHA1 Message Date
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
Alasdair Kergon
67d60b0365 first attempt to fix test 2011-07-04 16:27:27 +00:00
Alasdair Kergon
2243718fae 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
b3c42d7cc1 update pv_attr check for new missing attr 2011-06-30 19:32:51 +00:00
Alasdair Kergon
e04640b421 use remove -f 2011-06-30 09:17:49 +00:00
Alasdair Kergon
181b1f9fec teardown stray filesystems too 2011-06-30 09:15:53 +00:00
Zdenek Kabelac
e21ef74f11 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
afc438a5ab Try to force remove dm devices in after test fails. 2011-06-30 08:50:10 +00:00
Alasdair Kergon
5f30b9f4c8 Try to remove any stray loop devices left behind by earlier aborted tests. 2011-06-30 01:17:37 +00:00
Alasdair Kergon
1a3d96757e test attempt to remove stray loop devs 2011-06-30 00:57:29 +00:00
Alasdair Kergon
f96cf55d36 Add age filter to dmsetup udevcomplete_all to minimise concurrency problems. 2011-06-29 21:56:46 +00:00
Alasdair Kergon
5ffa914c59 make udev teardown conditional on using udev 2011-06-29 18:18:18 +00:00
Alasdair Kergon
10e002742b 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
456d357692 print any loop devs that weren't torn down 2011-06-29 17:37:30 +00:00
Alasdair Kergon
23ad430648 remove any stray semaphores after tearing down devs 2011-06-29 17:33:39 +00:00
Alasdair Kergon
174ccd3561 Add uuids to dmsetup create cmds. 2011-06-29 12:37:51 +00:00
Alasdair Kergon
efdaae8312 use dmsetup remove -f as a better way of simulating a device "disappearing" 2011-06-29 12:33:18 +00:00
Alasdair Kergon
0b1a308797 More readahead tests. 2011-06-28 09:43:28 +00:00
Alasdair Kergon
101ce82afa 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
a320aeb30f Selectively enable/disable udev rules. 2011-06-28 00:11:46 +00:00
Milan Broz
6adbb95b82 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
6d25c0d26f 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
cd72be458c Fix kernel version test (RHEL: 2.6.32-123). 2011-06-09 19:48:26 +00:00
Milan Broz
f4ba9c5d1e 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
851b1a9606 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
96e7ca3c78 Fix kernel version parsing in tests, use common function. 2011-06-09 18:58:00 +00:00
Milan Broz
aa809cb877 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
f221800b25 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
f7a80fd8e3 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
ed6ff5d2b3 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
9ecab00d26 Add missing cleanup for vgimportclone script 2011-04-28 22:17:06 +00:00
Dave Wysochanski
a1e22157d3 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
954dc4e8a6 Add vgimportclone symlink for nightly test. 2011-04-21 17:42:58 +00:00
Dave Wysochanski
1af48ed7c6 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
b680d5bf7b 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
cf83eac6fe 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
192ec18c76 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
db22d9b978 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
e6609094f7 Testing: remove -q from grep
to avoid any problems with pipe breaking.
2011-03-30 13:39:24 +00:00
Zdenek Kabelac
114faabf04 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
1092ae2dbe Indent spaces to tabs 2011-03-10 14:47:22 +00:00
Milan Broz
5446fc8cea Fix test for 8k page (fails on Sparc architecture). 2011-03-06 18:28:09 +00:00
Milan Broz
e7f77b36f5 Make the lock test a little bit better... 2011-03-04 15:04:08 +00:00
Milan Broz
90c9d95c15 Wait until dmeventd properly starts in test. 2011-03-04 14:19:18 +00:00
Zdenek Kabelac
26e000eecf 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
6a9646d1ce 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
8595f0c6ac Fix test, "echo n" is not needed when -y is specified. 2011-03-03 14:16:08 +00:00