1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
Commit Graph

534 Commits

Author SHA1 Message Date
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
Petr Rockai
6507ce98df Remove obsolete bits of support code from test/. 2011-01-05 14:15:26 +00:00
Petr Rockai
2fbadde558 Re-enable t-lvconvert-repair-transient, avoiding the deadlock by running mkfs
asynchronously.
2011-01-05 14:15:01 +00:00
Petr Rockai
7d048d52f6 Fix another bug in t-pvcreate-operation-md (should pass now). 2011-01-05 01:04:47 +00:00
Petr Rockai
41fb54489f Add a test for RHBZ 640621 (metadata/dirs + no PV MDAs broken). 2011-01-05 01:00:34 +00:00
Petr Rockai
3be9ec308a Fix typo in t-pvcreate-operation-md.sh. 2011-01-05 00:38:41 +00:00
Petr Rockai
f120a17b1d Move the mkdtemp functionality into test/lib/utils.sh. 2011-01-05 00:26:19 +00:00
Petr Rockai
fc7054c150 Fix a couple of bugs in the new (test/lib/)aux.sh. 2011-01-05 00:25:07 +00:00
Petr Rockai
cde70f94db Substantial rework of the functional test support code. Some new features:
- somewhat neater, more consistent and more readable output
- possible to set any lvm.conf value: aux lvmconf "section/key = value"
- LVM_TEST_NODEBUG to suppress the (lengthy) "## DEBUG" output
- back-substitution on test output ($TESTDIR/$PREFIX -> @TESTDIR@/@PREFIX@)
- support code moved from test/ to test/lib/ --> less clutter
2011-01-05 00:16:18 +00:00
Petr Rockai
f56007d95f Use system assert in test/api/percent.c, for now. 2011-01-03 15:07:39 +00:00
Alasdair Kergon
b44cdfc143 Copyright notices for new files. 2010-12-21 01:14:34 +00:00
Zdenek Kabelac
e5526cb27e Move var declarations to function begining
As assert macro jumps to 'bad:' label - we need vg initialized.
2010-12-20 12:29:39 +00:00
Petr Rockai
0bceef8c78 Fix sed substitution in copying tests to builddir (test/Makefile.in). 2010-12-14 23:23:45 +00:00
Petr Rockai
40eee88b06 Add getters for copy_percent and snap_percent to the lvm2app API. 2010-12-14 23:20:58 +00:00
Petr Rockai
6ea66f6925 Hack up the RUN_BASE computation in the test Makefile.in a bit more (so that it
actually works... sometimes).
2010-12-14 17:38:42 +00:00
Petr Rockai
e3deef3baa Remove a redundant %.o: %.c rule from test/api/Makefile.in. 2010-12-12 22:26:47 +00:00
Petr Rockai
4b81bb549d Fix the sed expression to get "base" names of tests. 2010-12-12 21:17:25 +00:00
Petr Rockai
c0274f4018 Only build the required bits under api/ on make check. 2010-12-12 21:08:00 +00:00
Petr Rockai
46ac061fb3 Do not build vgtest (superseded by vgtest.t). Fix the build line for .t files. 2010-12-12 20:49:38 +00:00
Petr Rockai
5e4a1476b3 First go at a somewhat more comprehensive mechanism to run "unit" tests for the
lvm2app API. Further factoring of the support code needed. RHBZ 654445
2010-12-12 20:36:38 +00:00
Milan Broz
c384ad4074 Try to detect fail in clvmd startup in tests. 2010-12-09 11:19:21 +00:00
Petr Rockai
7e8110ec50 Fix a failing test (it used a combination of lvconvert parameters that is no
longer permitted.)
2010-11-30 11:35:32 +00:00
Petr Rockai
3801cb524c Disallow certain lvconvert operations that need to both allocate and free
extents, while physical volumes are specified. Fixes BZ 640051.
2010-11-25 17:15:46 +00:00
Petr Rockai
f1e5a95d89 Add interactive tests for functions to lookup a pv|lv by name|uuid.
Signed-off-by: Dave Wysochanski <wysochanski@pobox.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2010-11-25 14:35:46 +00:00
Petr Rockai
9489a09e01 Update interactive tests for lvm2app lvseg and pvseg apis.
Signed-off-by: Dave Wysochanski <wysochanski@pobox.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2010-11-17 20:13:51 +00:00
Petr Rockai
4bd06a929d Add vg_set_property to the interactive lvm2app test program.
Signed-off-by: Dave Wysochanski <wysochanski@pobox.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2010-11-17 19:17:07 +00:00
Petr Rockai
8179a2dc9c Add code to the dmeventd snapshot plugin to automatically unmount snapshots
that have been invalidated.
2010-10-29 16:43:51 +00:00
Petr Rockai
d9f958852c Add a missed test for dmeventd -R. 2010-10-27 09:16:31 +00:00
Petr Rockai
9a9d7c1c55 Use a more generous timeout for dmeventd in t-lvconvert-repair-dmeventd. 2010-10-26 12:53:07 +00:00
Petr Rockai
0f287ed3dd Let's rely on the exit code and do not test for empty output. 2010-10-26 12:52:25 +00:00
Mike Snitzer
5d5d6e4d4a Explicitly have grep print the matching filenames (needed to
successfully determine scsi_debug device).
2010-10-26 01:25:46 +00:00
Dave Wysochanski
ac146fc759 Add interactive tests for lvm_{pv|vg|lv}_get_property(). 2010-10-25 14:09:19 +00:00
Petr Rockai
affe488e93 Reduce a (huge) timeout in t-mirror-names. 2010-10-20 15:35:00 +00:00
Petr Rockai
c294dbb4c8 Add a test for BZ 509182 (vgchange --monitor y breaks with max_lv). 2010-10-20 15:32:15 +00:00
Zdenek Kabelac
a60e991ee7 Add coverage test for partition table scanning 2010-10-20 15:14:13 +00:00
Petr Rockai
ba29d593b9 Implement automatic snapshot extension with dmeventd, and add two new options
to lvm.conf in the activation section: 'snapshot_autoextend_threshold' and
'snapshot_autoextend_percent', that define how to handle automatic snapshot
extension. The former defines when the snapshot should be extended: when its
space usage exceeds this many percent. The latter defines how much extra space
should be allocated for the snapshot, in percent of its current size.
2010-10-15 16:28:14 +00:00
Petr Rockai
df1b244fda Add a VERBOSE option to make check (make check VERBOSE=1). 2010-10-14 14:36:26 +00:00
Petr Rockai
21a17f291c Give correct error message when creating a too-small snapshot (BZ 587063) 2010-10-13 13:52:53 +00:00
Petr Rockai
46eae0cdd8 Add a test for vgextend --restoremissing. 2010-10-13 10:36:26 +00:00
Zdenek Kabelac
401f9e0eaf Skip fsadm testing until proper installation rules are commited in.
For now testing of fsadm is broken - as it's executing fsadm from system
and not from the package thus we get wrong results.
2010-10-13 09:44:52 +00:00
Petr Rockai
15f4b08f94 Add an option to skip some tests in make check (regex based, like T=): eg.
$ sudo make check S='mirror-basic|fsadm'
2010-10-12 16:17:25 +00:00
Petr Rockai
9b4b94edc0 test-utils: Fix a slight bug in the dmeventd-already-running error message. 2010-10-12 16:13:43 +00:00
Zdenek Kabelac
39429d3905 Update script for fsadm testing 2010-10-08 15:03:21 +00:00
Milan Broz
2da49b93bd Restrict lvm1 partial mode.
Current lvm1 allocation code seems to not properly
map segments on missing PVs.

For now disable this functionality.
(It never worked and previous commit just introduced segfault here.)

So the partial mode in lvm1 can only process missing PVs
with no LV segments only.

Also do not use random PV UUID for missing part but use fixed
string derived from VG UUID (to not confuse clvmd tests).
2010-10-04 18:59:01 +00:00
Milan Broz
8eaef39b33 Fix handling of partial VG for lvm1 format metadata
If some lvm1 device is missing, lvm fails on all operations
# vgcfgbackup -f bck -P vg_test
  Partial mode. Incomplete volume groups will be activated read-only.
  3 PV(s) found for VG vg_test: expected 4
  PV segment VG free_count mismatch: 152599 != 228909
  PV segment VG extent_count mismatch: 152600 != 228910
  Internal error: PV segments corrupted in vg_test.
  Volume group "vg_test" not found

Allow loading of lvm1 partial VG by allocating "new" missing PV,
which covers lost space. Also this fake mising PV inform code
that it is partial VG.

https://bugzilla.redhat.com/show_bug.cgi?id=501390
2010-09-22 13:45:21 +00:00
Milan Broz
05d3869acf Do not run singlenode clvmd tests if support for singlenode not compiled in. 2010-08-27 08:52:54 +00:00
Milan Broz
72489fb458 Currently tests require SI units enabled and data alignment to 1MiB.
For now force it in lvm.conf (otherwise it fails on older systems like RHEL5
where are these options disabled by default).

FIXME: it should test and detect both versions.
2010-08-27 07:59:40 +00:00
Mike Snitzer
e6166e4498 Verify that pvcreate --dataalignment really does override the topology
detected alignment.

NOTE: lvm2 doesn't detect MD 1.2 metadata (now the default on RHEL6) so
for now I'm forcing 1.0 metadata.  This was needed to be able to reuse
the existing loop devices but recreate the md device with different
raid0 striping.
2010-08-21 15:43:45 +00:00
Alasdair Kergon
7b0804c22f Attempt to fix buildbot failure in t-lvconvert-mirror.sh due to failing to
wait for mirror to get into sync before running subsequent command.
2010-08-17 22:01:41 +00:00