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

646 Commits

Author SHA1 Message Date
Zdenek Kabelac
d044827d9a 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
fd1aaee33f Kill clvmd properly after locking_type 3 tests (using clvmd/singlenode). 2011-01-12 16:07:55 +00:00
Jonathan Earl Brassow
025e69a15a Add disk to mirrored log type conversion. 2011-01-11 17:05:08 +00:00
Zdenek Kabelac
95d3c5f7e1 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
0011955f3a Skip the api/percent test on kernels <= 2.6.32. 2011-01-07 15:04:52 +00:00
Petr Rockai
dbb55cb3e1 Add a test for the interaction of snapshots of mirrors and lvconvert --repair. 2011-01-07 14:56:52 +00:00
Petr Rockai
235ea42e59 Add a test for the interaction of transient errors and dmeventd mirror repair. 2011-01-07 14:56:10 +00:00
Petr Rockai
be294072a1 Fix a typo in the new relaxed mirror check (test/lib/check.sh). 2011-01-07 14:42:35 +00:00
Petr Rockai
21ee9f3234 Remove *.t in test/api's make clean target. 2011-01-07 13:07:10 +00:00
Petr Rockai
a1da766a21 Disable activation/monitoring in testing lvm.conf by default. 2011-01-07 13:04:17 +00:00
Petr Rockai
55be86d4c7 Relax the mirror test in test/lib/check.sh. 2011-01-07 13:03:46 +00:00
Petr Rockai
2479e17526 In aux, exit 200 no longer works as skip -- replace with real skip call. 2011-01-07 13:03:04 +00:00
Petr Rockai
62fbc0a033 Fix up the make clean target in test/. 2011-01-07 12:26:02 +00:00
Zdenek Kabelac
5c4622fd2a 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
e485801d49 Remove obsolete bits of support code from test/. 2011-01-05 14:15:26 +00:00
Petr Rockai
20b7fe3379 Re-enable t-lvconvert-repair-transient, avoiding the deadlock by running mkfs
asynchronously.
2011-01-05 14:15:01 +00:00
Petr Rockai
5d6a6bdf7b Fix another bug in t-pvcreate-operation-md (should pass now). 2011-01-05 01:04:47 +00:00
Petr Rockai
5e79ce33d6 Add a test for RHBZ 640621 (metadata/dirs + no PV MDAs broken). 2011-01-05 01:00:34 +00:00
Petr Rockai
7271b0afea Fix typo in t-pvcreate-operation-md.sh. 2011-01-05 00:38:41 +00:00
Petr Rockai
da6e9afebf Move the mkdtemp functionality into test/lib/utils.sh. 2011-01-05 00:26:19 +00:00
Petr Rockai
92ebc9219e Fix a couple of bugs in the new (test/lib/)aux.sh. 2011-01-05 00:25:07 +00:00
Petr Rockai
1b7c4b9bce 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
9a09ca42d2 Use system assert in test/api/percent.c, for now. 2011-01-03 15:07:39 +00:00
Alasdair Kergon
49e859e5a7 Copyright notices for new files. 2010-12-21 01:14:34 +00:00
Zdenek Kabelac
0281405a4d 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
af979c3b2d Fix sed substitution in copying tests to builddir (test/Makefile.in). 2010-12-14 23:23:45 +00:00
Petr Rockai
8961b1d503 Add getters for copy_percent and snap_percent to the lvm2app API. 2010-12-14 23:20:58 +00:00
Petr Rockai
d6d4e462a4 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
bda30a59b9 Remove a redundant %.o: %.c rule from test/api/Makefile.in. 2010-12-12 22:26:47 +00:00
Petr Rockai
caa443ae49 Fix the sed expression to get "base" names of tests. 2010-12-12 21:17:25 +00:00
Petr Rockai
4f8eeb2a06 Only build the required bits under api/ on make check. 2010-12-12 21:08:00 +00:00
Petr Rockai
6ba68e2a84 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
5f4dc7f957 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
706edf60d5 Try to detect fail in clvmd startup in tests. 2010-12-09 11:19:21 +00:00
Petr Rockai
0669d21847 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
a680e90fb0 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
f2afa4f21d 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
f6531a5f00 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
50814ddb75 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
fe9ac4d3f4 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
b2959bde18 Add a missed test for dmeventd -R. 2010-10-27 09:16:31 +00:00
Petr Rockai
07d7f642f8 Use a more generous timeout for dmeventd in t-lvconvert-repair-dmeventd. 2010-10-26 12:53:07 +00:00
Petr Rockai
3deeab58c7 Let's rely on the exit code and do not test for empty output. 2010-10-26 12:52:25 +00:00
Mike Snitzer
8328e5f094 Explicitly have grep print the matching filenames (needed to
successfully determine scsi_debug device).
2010-10-26 01:25:46 +00:00
Dave Wysochanski
68c5e7d2df Add interactive tests for lvm_{pv|vg|lv}_get_property(). 2010-10-25 14:09:19 +00:00
Petr Rockai
1d85ae71a0 Reduce a (huge) timeout in t-mirror-names. 2010-10-20 15:35:00 +00:00
Petr Rockai
59571213ef Add a test for BZ 509182 (vgchange --monitor y breaks with max_lv). 2010-10-20 15:32:15 +00:00
Zdenek Kabelac
eb166dbc88 Add coverage test for partition table scanning 2010-10-20 15:14:13 +00:00
Petr Rockai
a341cab721 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
e3e64c8ea4 Add a VERBOSE option to make check (make check VERBOSE=1). 2010-10-14 14:36:26 +00:00
Petr Rockai
042312952c Give correct error message when creating a too-small snapshot (BZ 587063) 2010-10-13 13:52:53 +00:00
Petr Rockai
b8281ca1e4 Add a test for vgextend --restoremissing. 2010-10-13 10:36:26 +00:00
Zdenek Kabelac
7dddc57bde 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
1c45bab17f 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
613a177a6f test-utils: Fix a slight bug in the dmeventd-already-running error message. 2010-10-12 16:13:43 +00:00
Zdenek Kabelac
6a4b036c2f Update script for fsadm testing 2010-10-08 15:03:21 +00:00
Milan Broz
b0485a996f 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
980d2d8683 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
ba6662c5d6 Do not run singlenode clvmd tests if support for singlenode not compiled in. 2010-08-27 08:52:54 +00:00
Milan Broz
068fed4534 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
9c179ef418 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
c496bc13e2 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
Mike Snitzer
ed878c8a9a Add some v1 to v2 metadata upgrade testing. 2010-08-16 23:21:20 +00:00
Mike Snitzer
9ac9e06b5c fix t-pvcreate-operation-md.sh to require kernel.org Linux >= 2.6.33 for
the final alignment_offset check.  In the future, might look to check
for the RHEL6 kernel too.
2010-08-12 04:56:05 +00:00
Mike Snitzer
b123a82d73 Change default alignment of pe_start to 1MB.
The new standard in the storage industry is to default alignment of data
areas to 1MB.  fdisk, parted, and mdadm have all been updated to this
default.

Update LVM to align the PV's data area start (pe_start) to 1MB.  This
provides a more useful default than the previous default of 64K (which
generally ended up being a 192K pe_start once the first metadata area
was created).

Before this patch:
# pvs -o name,vg_mda_size,pe_start
  PV         VMdaSize  1st PE
  /dev/sdd     188.00k 192.00k

After this patch:
# pvs -o name,vg_mda_size,pe_start
  PV         VMdaSize  1st PE
  /dev/sdd    1020.00k   1.00m

The heuristic for setting the default alignment for LVM data areas is:
- If the default value (1MB) is a multiple of the detected alignment
  then just use the default.
- Otherwise, use the detected value.

In practice this means we'll almost always use 1MB -- that is unless:
- the alignment was explicitly specified with --dataalignment
- or MD's full stripe width, or the {minimum,optimal}_io_size exceeds
  1MB
- or the specified/detected value is not a power-of-2
2010-08-12 04:11:48 +00:00
Mike Snitzer
dff224669d Require --restorefile when using pvcreate --uuid.
Introduce --norestorefile to allow user to override the new requirement.

This can also be overridden with "devices/require_restorefile_with_uuid"
in lvm.conf -- however the default is 1.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-08-12 04:08:59 +00:00
Mike Snitzer
57d31c99cc Require logical volume(s) to be explicitly named for lvconvert --merge. 2010-08-03 20:22:31 +00:00
Zdenek Kabelac
1342414a8d Minor speedup of lock test -
Instead of waiting for flock process finish kill the flock process.
2010-08-02 13:23:01 +00:00
Zdenek Kabelac
3015a9ab9c Add shell function to trim spaces.
Test values as "$val" to avoid weird results when spaces are in output.
2010-08-02 13:20:50 +00:00
Zdenek Kabelac
380cd989ac Using count=0 is sufficient for creation of zeroed files. 2010-08-02 13:18:42 +00:00
Zdenek Kabelac
c133a264b0 Visually better align lines which are executed as a result of true
or false result of previous command.
2010-08-02 13:18:01 +00:00
Alasdair Kergon
64f95b40ca add copyright notices to new files 2010-07-28 12:20:38 +00:00
Petr Rockai
8b90730e41 Do not create a clustered volume group in t-nomda-missing. 2010-07-27 21:08:32 +00:00
Petr Rockai
82c99fb63f Make vgck warn about missing PVs. 2010-07-27 20:05:29 +00:00
Petr Rockai
65d20c2f32 Don't fail t-pvcreate-operation-md if mdadm is broken. 2010-07-21 14:12:47 +00:00
Dave Wysochanski
96c3c4645f Add --force to pvchange, and allow override of prompt involving metadataignore.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-07-07 19:14:57 +00:00
Dave Wysochanski
05d2c210e1 Test failed commit of mda on new pv - failed vgextend.
Test the auto-repair capability when we fail committing to an mda
on a new pv adding to a vg.  This test should fail until we fix
the auto-repair in this case.
2010-07-07 14:43:57 +00:00
Dave Wysochanski
3a3281c195 Update metadata-balance test for --vgmetadatacopies 0.
Should be equivalent to "unmanaged".
2010-06-30 22:22:00 +00:00
Milan Broz
6117bfc0af Fix vgremove to allow removal of VG with missing PVs. (2.02.52) 2010-06-30 14:01:39 +00:00
Dave Wysochanski
2dbb08a4fe Update nightly tests for vgextend --metadataignore. 2010-06-30 13:04:59 +00:00
Dave Wysochanski
7f119c2236 Update pvcreate tests for --metadataignore. 2010-06-30 12:17:55 +00:00
Dave Wysochanski
763888abef Update t-covercmd pvck to take proper device argument. 2010-06-28 21:49:31 +00:00
Dave Wysochanski
7815d8263a Update tests to handle phase 2 (vg based) metadata balance.
Test vgcreate/vgchange --vgmetadatacopies, vgextend, vgreduce,
vgsplit, vgmerge.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-06-28 20:40:27 +00:00
Dave Wysochanski
7088fb9260 Ensure --metadatacopies parameter gets interpreted based on command.
Now that we have both --pvmetadatacopies and --vgmetadatacopies,
we need to make sure --metadatacopies gets interpreted correctly.

For pv commands, --metadatacopies should imply --pvmetadatacopies,
and for vg commands, --vgmetadatacopies.

Note: this will change the behavior of vgcreate with --metadatacopies
to be a synonym for --vgmetadatacopies.  Previously, --metadatacopies
would apply to any PVs given with vgcreate that needed an implicit
pvcreate.  As a result, one small change is needed to one of the nightly
tests - t-vgcreate-usage.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-06-28 20:39:39 +00:00
Dave Wysochanski
c6894cf031 Add tests for phase 1 of metadata balance - manage per-PV ignore bit.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-06-28 20:36:06 +00:00
Petr Rockai
eddb91d1e7 Minor shell style cleanup. 2010-06-28 19:13:33 +00:00
Petr Rockai
a8dfed8267 Add a test of wait_for_locks behaviour (adapted from an original by Dave). 2010-06-24 07:57:54 +00:00
Milan Broz
31943693c7 Require partial option in lvchange --refresh for partials LVs.
We must not refresh LV if some PVs are missing and partial activation
was not requested.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=598886
2010-06-03 12:45:05 +00:00
Milan Broz
3014fad054 Fix topology test after last changes to not leak loop devices. 2010-05-24 19:27:38 +00:00
Milan Broz
8e0ef70c96 Use mv -f for replace config in test. 2010-05-24 17:19:50 +00:00
Milan Broz
8a65725195 Replace lvm.conf instead of truncating it. 2010-05-24 17:18:05 +00:00
Petr Rockai
84fa520c03 t-lvconvert-repair-transient hangs on .33 and on RHEL6 kernel -> disable 2010-05-24 16:33:21 +00:00
Petr Rockai
d345bf2cd3 Account for mirror transient status when doing lvconvert --repair. 2010-05-24 15:32:20 +00:00
Petr Rockai
1a36448da3 Skip t-pvcreate-operation-md if mdadm fails to create the required device. 2010-05-24 15:28:45 +00:00
Dave Wysochanski
a616c0de2e Test lvm_vgname_from_{pvid|device}. 2010-05-19 11:53:30 +00:00
Alasdair Kergon
bdadde2f7a Use -d to control level of messages sent to syslog by dmeventd.
Change -d to -f to run dmeventd in foreground.
(mornfall)
2010-05-14 14:56:39 +00:00
Petr Rockai
1540955fc6 Chop up the big t-lvconvert-mirror-basic loop across 4 separate test scripts
(and use sourcing to avoid code duplication).
2010-05-12 13:15:38 +00:00
Petr Rockai
d74800fd23 Run tests in alphabetical (and thus stable across machines) order. 2010-05-12 11:59:46 +00:00
Petr Rockai
685d9e615b Bump the debug.log level from 4 to 9 (the numbering is different from verbose). 2010-05-12 11:58:51 +00:00
Petr Rockai
15bd6a29b9 Revert the "repeat failed tests with -vvvv" feature. Instead, dump debug logs
to a file using log/file, with log/overwrite set and dump this file in
STACKTRACE. The overall effect is that only the command that ran last before
the failure has been triggered will get its debug output logged. This is
similar to how we treat coredumps.
2010-05-12 11:23:16 +00:00
Petr Rockai
0e7c1ee3e7 A fairly extensive refactor of the mirror testing code. The exhaustive
lvconvert testing is now in its own test, t-lvconvert-mirror-basic ... it
doesn't do anything fancy but it does run lvconvert through a lot of
combinations.

I have also merged the remaining t-mirror-lvconvert tests into
t-lvconvert-mirror and abolished the former. The latter will be split again
later into more thematic divisions. (The previous split was rather arbitrary,
may I even say random...)
2010-05-12 10:08:35 +00:00
Petr Rockai
85ab113b31 Revert the huge device creation in t-lvconvert-mirror and downgrade the
race-induced failure to a warning, until we have a better fix for this.
2010-05-12 06:09:22 +00:00
Petr Rockai
e598348504 Add a test for activation in presence of missing devices. This partially covers
the robustness requirements for system startup that we have.
2010-05-12 06:02:28 +00:00
Petr Rockai
6c53c22139 Rename t-partial-activate to t-activate-partial (more activation tests coming). 2010-05-12 05:59:24 +00:00
Petr Rockai
69638ad6b1 The "should" testing utility should actually only give a warning when the
command fails.
2010-05-12 05:55:42 +00:00
Petr Rockai
4aa8216d7e Improve the "check" testing utility: slightly refactor and provide
active/inactive checks.
2010-05-12 05:55:08 +00:00
Petr Rockai
0b0caec5f6 Add a basic test for dmeventd triggering lvconvert --repair. Needs improvement. 2010-05-06 19:01:26 +00:00
Petr Rockai
b52496b7af Add some basic provisions for automated testing of dmeventd. 2010-05-06 18:54:51 +00:00
Petr Rockai
d6b9d2cbc3 Add a "should" alongside "not" to the test utilities. When a "should" command
fails, the test will carry on but will issue a warning. The harness detects
such warnings from tests and marks tests that passed with warnings with a
special status.
2010-04-30 14:33:39 +00:00
Jonathan Earl Brassow
6c6ce2ba0e Test all combinations of mirror conversion, both while the LV
is active and while it is in-active.

+for i in $(seq 0 4); do
+       for j in $(seq 0 4); do
+               for k in core disk mirrored; do
+                       for l in core disk mirrored; do

The testing code still needs some improvement.  I'd like to add
the ability to test specifying the PVs to be added/removed during
a convert.  It will also be important to test partial PV
specification during down converts (i.e. request to remove more
mirror images than we have provided PVs for).
2010-04-28 17:46:34 +00:00
Mike Snitzer
60267bdce8 Disallow the direct removal of a merging snapshot.
Allow lv_remove_with_dependencies() to know the top-level LV that was
requested to be removed (otherwise it recurses and we lose context).

A merging snapshot cannot be removed directly but the associated origin
can be.  Disallow removal of a merging snapshot unless the associated
origin is also being removed.
2010-04-23 19:27:10 +00:00
Mike Snitzer
1f661c5dd8 When removing a snapshot avoid preloading the origin if the
snapshot-merge target is not active.
2010-04-23 02:57:39 +00:00
Jonathan Earl Brassow
6753ff894f The following tests in the testsuite have race conditions:
1) Test that the primary mirror image cannot be removed while
   the mirror set is sync'ing.
2) Test that you cannot start a second mirror up-convert while
   one is already in progress.

The trouble is that if the sync/conversion finishes before the
tests occur, the tests will fail by why of success where there
should have been failure.  This means the sync/conversion must
happen very quickly, but this is possible because the test
mirrors we are creating are so small.

In order to decrease the likelyhood of these test failing (or
more correctly, failing to test the right thing), I've increase
the size of the mirrors.  It will still be remotely possible that
the tests will fail (by way of failing to test the right thing).
If this continues to happen, more involved mechanisms will need
to be put in place.  (Perhaps these will still be created, but
this change should be a remedy until that time.)
2010-04-22 15:39:40 +00:00
Jonathan Earl Brassow
3c76d9abaf Disallow the addition of mirror images while a mirror up-convert
is already occurring.  The addition of new legs can be retried
once the current conversion is complete.
2010-04-21 14:04:24 +00:00
Jonathan Earl Brassow
66f79d05eb Disallow the primary mirror image from being removed when the
mirror is not in-sync.  This restriction is not extended to
repair operations (i.e. it will not limit what 'lvconvert --repair'
can do).
2010-04-21 13:55:08 +00:00
Mike Snitzer
4bd1ac728c Re-enable t-topology-support.sh
Reintroduce split teardown (teardown() calls teardown_devs()) because
t-topology-support.sh only needs the teardown_devs() subset of the full
teardown() between each iteration of the topology tests -- in particular
the $TESTDIR must not get removed between each topology test iteration.

prepare_loop() must return if prepare_scsi_debug_dev() already
established $LOOP.

Also fix (and simplify) the unsafe scsi-debug device discovery in
prepare_scsi_debug_dev().
2010-04-20 18:18:59 +00:00
Dave Wysochanski
3332edacb9 Add device creation to basic nightly test.
Ensure we can create devices for use in tests before running the real
tests.  This may in various cases, and may involve machine configuration
rather than a failure in some specific test.
For example, if a test is run with LVM_TEST_DIR=/tmp, selinux is enabled,
and the default security context is set to "<<none>>" for /tmp, all the
tests will fail, unable to create devices, since dmsetup will fail, a
result of machpathcon() returning an error code.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-20 15:19:36 +00:00
Mike Snitzer
d9933eaf1b Add additional test to start the snapshot merge (which had just failed
because an FS was mounted -- origin was still open).
2010-04-19 22:44:42 +00:00
Dave Wysochanski
212510fdf8 Add missing readline linkage to lvm2app test. 2010-04-14 16:13:34 +00:00
Petr Rockai
a86107dfb1 Allow incomplete mirror restore in lvconvert --repair upon insufficient space. 2010-04-14 13:51:58 +00:00
Petr Rockai
cb296d5bb5 SIGTERM testing clvmd before SIGKILL-ing it. 2010-04-14 12:04:23 +00:00
Dave Wysochanski
2f31756149 Fix teardown in t-pvcreate-operation-md.sh nightly test. 2010-04-13 21:42:44 +00:00
Petr Rockai
a2263de0a3 Add check_cluster and check_local targets in addition to just "check". 2010-04-13 13:28:52 +00:00
Petr Rockai
2f938809c4 Process all core dumps that exist upon a test failure (this would hopefully
include eg. clvmd cores, apart from the usual lvm ones).
2010-04-13 08:01:53 +00:00
Petr Rockai
d78af3f646 Fix a reversed exit status from test harness. 2010-04-13 07:34:19 +00:00
Petr Rockai
0128c3703a Optionally disable the verbose repeat of a failed test (export
LVM_TEST_NOVERBOSE=1).
2010-04-13 07:33:34 +00:00
Petr Rockai
cad4999faa Disable the rather-dangerous prepare_scsi_debug_dev in the testsuite. 2010-04-13 07:02:14 +00:00
Petr Rockai
468667effa Make it easy to run just a subset of tests by saying make check T="regex". 2010-04-13 06:45:53 +00:00
Petr Rockai
99224dfeac Fix t-lvcreate-usage, as lvcreate ... -i1 no longer prints "Redundant stripes
argument: default is 1".
2010-04-13 06:25:08 +00:00
Petr Rockai
cd7d2bc5e4 For the testsuite, set a default polling interval to 0 in lvm.conf. Cuts down
testing time considerably.
2010-04-13 06:24:20 +00:00
Petr Rockai
31f8085a1b More testsuite helpers for check.sh. 2010-04-12 19:33:58 +00:00
Petr Rockai
88e3d4e262 Absorb t-mirror-lvconvert-usage into t-lvconvert-mirror. 2010-04-12 19:32:58 +00:00
Petr Rockai
400502f7e6 Explode t-mirror-basic into a number of smaller tests. 2010-04-12 19:16:24 +00:00
Petr Rockai
bedabf92f3 Add a new helper script for the testsuite, that makes checking for various
(lvm) properties easier and produces nicer output.
2010-04-12 19:02:59 +00:00
Petr Rockai
b7d23b7943 Do not pollute /tmp with testing byproducts. 2010-04-12 19:00:23 +00:00
Zdenek Kabelac
23b059e7b7 INSTALL rules updates
Patch is inspired by Debian's extra patch.

- removes OWNER & GROUP make vars they are parts of INSTALL command.
- adds INSTALL_PROGRAM for executable, uses $(INSTALL)
- adds INSTALL_DATA for non-executable data, uses ($INSTALL)
- adds INSTALL_WDATA for writable non-executable data, uses ($INSTALL)
- adds configure option --enable-write_install - to support
  installatin of writable files used by distribution
- replaces usage of ifeq @LIB_SUFFIX@ with $(LIB_SUFFIX)
- installs .a files from static builds without executable flag
- installs .a files to $(usrlibdir) instead of $(libdir)
- installs all static binaries to $(staticdir)
- create .so links for devel package in $(usrlibdir) instead of
  $(libdir)
- makes .so and .so.LIB_VERSION files within builddir
- removes VERSIONED_SHLIB and created versioned LIB_SHARED automagicaly
- install LIB_SHARED via install_lib_shared target
- install plugins via install_lib_shared_plugin target
- prints whole 'install' command during installation instead of less
  informative "Installing  $(something) $(somewhere)"
- install multiple man pages with one INSTALL command
- use DISTCLEAN_TARGETS instead of creating multiple distclean targets
2010-04-09 21:42:48 +00:00
Zdenek Kabelac
c737d34804 Use vpath instead of VPATH.
Usage of VPATH makes troubles when used within $(builddir).
Not only source files are being found through VPATH,
but targets as well. (make --debug=v)

Thus if user builds the code in $(srcdir) and also in some $(builddir)
he gets mangled results as some generated files (i.e. .export.sym)
are 'reused' from $(srcdir) instead of $(builddir).

This patch switches to use vpath were we could explicitly name
suffixes that should be looked via vpath - we must take care,
we do not generate files with these suffixes:
.c, .in, .po, .exported_symbols
2010-04-09 21:34:25 +00:00
Alasdair Kergon
9a62f0d59a And another test that should have been failing - normal allocation policy
does not put stripes on the same disk as each other!
2010-04-08 01:58:06 +00:00
Alasdair Kergon
1969deb742 another incorrect test that should have been failing before 2010-04-08 01:43:46 +00:00
Petr Rockai
09d11ca3d8 Don't forget to cd into $TESTDIR in test-utils.sh / prepare_testdir. 2010-04-07 21:38:01 +00:00
Petr Rockai
3103d5e2d9 Fix a mis-override of $PWD in test-utils.sh. 2010-04-07 21:19:20 +00:00
Petr Rockai
36bc6c3d19 Set ulimit -c to unlimited to allow coredumps to be collected and analysed in
the testsuite.
2010-04-07 16:04:22 +00:00
Petr Rockai
4c68b2cb9c Avoid spurious skips in the testsuite due to obsoleted
dmsetup_has_dm_devdir_support_.
2010-04-07 16:00:19 +00:00
Petr Rockai
ed5686d981 Refactor the test utilities, dropping the legacy test-lib.sh and curtailing
lvm-utils.sh. Clears up lots of unused code, should have little observable
impact (it does change test directory layout slightly).
2010-04-07 14:46:26 +00:00
Petr Rockai
e096611c96 In test harness, use fwrite(3) in place of write(2) to avoid mixing fd-level
and FILE-level IO on stdout.
2010-04-07 09:48:11 +00:00
Petr Rockai
c48d915f11 Keep the testsuite stats correct in spite of failed-test repetition. 2010-04-07 09:41:33 +00:00
Petr Rockai
065988dcd7 Move a fragile testcase toward the end of t-mirror-lvconvert.sh. 2010-04-06 23:04:45 +00:00
Petr Rockai
d2aa9707de Put back the `lvconvert -m+1 --mirrorlog disk' test in t-lvconvert-mirror.sh. 2010-04-06 22:22:26 +00:00
Alasdair Kergon
f3b0e21c20 disable another broken check in a test 2010-04-06 18:13:43 +00:00
Alasdair Kergon
6d25082d65 Fix is_partitioned_dev not to attempt to reopen device. 2010-04-06 17:36:41 +00:00
Alasdair Kergon
9891603994 Disable broken test. 2010-04-06 16:30:53 +00:00
Alasdair Kergon
3a615fa11f Display PVs created during tests 2010-04-06 14:25:07 +00:00
Zdenek Kabelac
deb4382dd0 Using 'not' if the test 'should' fail. 2010-04-06 14:24:13 +00:00
Petr Rockai
a39d299df4 Do not pass NULL to setenv in the test harness. 2010-03-31 23:11:12 +00:00
Zdenek Kabelac
43e3c22ae4 Missed to convert T -> SCRIPTS 2010-03-31 23:05:20 +00:00
Petr Rockai
7ca751c78d Re-run failing tests with log/verbose=4 (-vvvv) to help with debugging. 2010-03-31 22:18:17 +00:00
Jonathan Earl Brassow
3c4a088312 We only need one extent for the mirror log. So, when specifying
the devices on which to place the individual mirror parts, we can
specify the log devices as $dev:x instead of $dev:x-y.
2010-03-31 03:56:25 +00:00
Jonathan Earl Brassow
0f632bf218 For the mirror repair tests, we should use --ignoremonitoring because
we are running the repair manually.  If we don't ignore, then dmeventd
and the manually run repair can collide.  (We should still get clean
results in such a case, but it makes it harder to validate the test
results.)
2010-03-31 02:36:03 +00:00
Petr Rockai
a3a50148fb Work around a problem in t-mirror-lvconvert: different PV order on the
commandline of lvconvert can lead to allocation failures even if enough space
is available. A separate testcase demonstrating the problem will follow.
2010-03-29 16:50:27 +00:00
Petr Rockai
eb256dbb6b Enforce distinct-PV allocation of snapshot/origin pairs in vgsplit test. 2010-03-29 16:40:51 +00:00
Zdenek Kabelac
c9895ac01e Fix also error code from clean:
And fix previous commit which missed test.
2010-03-29 15:53:11 +00:00
Zdenek Kabelac
1e070872a3 Oops, avoid returning errors from shell to makefile for builddir == srcdir 2010-03-29 15:39:25 +00:00
Zdenek Kabelac
051e55b12b Split long line in Makefile and keep $abs_top_buildir as shell variable
within init.sh.
2010-03-29 14:19:42 +00:00
Zdenek Kabelac
b7be589ed0 Fixing another set of distclean problems where we left some generated files
in clvmd, dmevend, man, tests.

Don't include dependency files for clow and cscope.out targets

Improve dependency tracking for dmeventd and liblvm2cmd sources.
2010-03-29 14:17:59 +00:00
Petr Rockai
5a4760792f When a scsi_debug modprobe fails, skip the test instead of failing it. 2010-03-28 15:52:04 +00:00
Jonathan Earl Brassow
7a369d3704 Add ability to create mirrored logs for mirror LVs.
This check-in enables the 'mirrored' log type.  It can be specified
by using the '--mirrorlog' option as follows:
#> lvcreate -m1 --mirrorlog mirrored -L 5G -n lv vg

I've also included a couple updates to the testsuite.  These updates
include tests for the new log type, and some fixes to some of the
*lvconvert* tests.
2010-03-26 22:15:43 +00:00
Zdenek Kabelac
d20956dcb1 Updates .so links for plugins 2010-03-26 13:21:28 +00:00
Alasdair Kergon
0aae84f9a2 more diagnostics 2010-03-25 12:16:17 +00:00
Alasdair Kergon
dc49eeb6a3 more diagnostics 2010-03-25 12:14:14 +00:00
Alasdair Kergon
c1a3bffdae add debug mesg 2010-03-25 11:57:16 +00:00
Alasdair Kergon
1239365201 add debug mesgs and attempt to control which device is used for log as perhaps intended 2010-03-25 11:47:00 +00:00
Alasdair Kergon
a570dca703 add debug output and attempt to control which device gets log as intended perhaps 2010-03-25 11:42:17 +00:00
Peter Rajnoha
2e08dbcb65 Export and use only valid cookie value in test suite. 2010-03-23 14:47:35 +00:00
Petr Rockai
c7ee154ba9 Run both locking_type 1 and 3 tests (forgot to uncomment locking_type 1 before
last checkin).
2010-03-18 09:28:42 +00:00
Petr Rockai
e2e67c87f5 Skip locking_type 3 tests instead of failing when system-wide clvmd is running. 2010-03-18 09:27:39 +00:00
Petr Rockai
649c45078f Add infrastructure for running the functional testsuite with locking_type set
to 3, using a local (singlenode) clvmd.
2010-03-18 09:19:30 +00:00
Dave Wysochanski
a09aa49783 Add pvchange -u --all to testsuite.
This can be an interesting test case when using PVs with --metadatacopies 0.
2010-03-17 17:02:01 +00:00
Mike Snitzer
d0af5def87 testsuite: get stacktrace if test drops core
Requires lvm be built with debugging (-g).
Also requires 'ulimit -c' be non-zero (to drop core file).
2010-03-17 14:55:28 +00:00
Milan Broz
acb4b5e4de Fix pvcreate device check.
If user try to vgcreate or vgextend non-existent VG,
these messages appears:

# vgcreate xxx /dev/xxx
  Internal error: Volume Group xxx was not unlocked
  Device /dev/xxx not found (or ignored by filtering).
  Unable to add physical volume '/dev/xxx' to volume group 'xxx'.
  Internal error: Attempt to unlock unlocked VG xxx.

(the same with existing VG and non-existing PV & vgextend)
# vgextend vg_test /dev/xxx
...

It is caused because code tries to "refresh" cache if
md filter is switched on using cache destroy.

But we can change filters and rescan even without this
machinery now, just use refresh_filters
(and reset md filter afterwards).

(Patch also  discovers cache alias bug in vgsplit test,
fix it by using better filter line.)
2010-03-17 14:44:18 +00:00
Zdenek Kabelac
f30875dbc6 Pthread linking change
Create new substituted variable PTHREAD_LIBS and link this library
only with tools/libs which really needs it - i.e. dmeventd.

Check for libpthread only for builds with clvmd or dmeventd.

Remove variable LIB_PTHREAD
2010-03-04 11:21:05 +00:00
Dave Wysochanski
d8c4949f3e Update lvm2app interactive unit test for vg/lv tags.
Simple test of vg/lv tag addition/deletion.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-02-24 18:16:35 +00:00
Petr Rockai
2fbeba9c32 Relax a check on blkid exit value, which seems to be different in different
versions. Fixes a spurious test failure introduced with -o pipefail.
2010-02-22 14:47:55 +00:00
Petr Rockai
943c443426 In testsuite, catch also failures that happen in the middle of a pipeline. 2010-02-17 15:41:28 +00:00
Dave Wysochanski
97d91b30e6 Add nightly test to cover vg/lv tags add/delete.
Simple nightly test coverage for adding / deleting lv/vg tags via
create and change functions.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-02-16 17:49:18 +00:00
Dave Wysochanski
6371bcbe55 Add get_{pv|vg|lv}_field() nightly test helper functions.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-02-16 17:48:46 +00:00
Peter Rajnoha
be40fe90ae Use udev transactions in testsuite. 2010-02-15 16:30:13 +00:00
Dave Wysochanski
5ffe56d800 Update simple lvm2app unit test for new size apis.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-02-14 03:23:07 +00:00
Mike Snitzer
234b12480e lvconvert --merge @tag support
Switch lvconvert's --merge code over to using process_each_lv().  Doing
so adds support for a single 'lvconvert --merge' to start merging
multiple LVs (which includes @tag expansion).

Add 'lvconvert --merge @tag' testing to test/t-snapshot-merge.sh

Adjust man/lvconvert.8.in to reflect these expanded capabilities.

The lvconvert.c implementation requires rereading the VG each iteration
of process_each_lv().  Otherwise a stale VG instance associated with
the LV passed to lvconvert_single_merge() would result in stale VG
metadata being written back out to disk.  This overwrote new metadata
that was written when a previous snapshot LV finished merging (via
lvconvert_poll).  This is only an issue when merging multiple LVs that
share the same VG (a single VG is typical for most LVM configurations on
system disks).

In the end this new support is very useful for performing a "system
rollback" that requires multiple snapshot LVs be merged to their
respective origin LV.

The yum-utils 'fs-snapshot' plugin tags all snapshot LVs that it creates
with a common 'snapshot_tag' that is unique to the yum transaction.
Rolling back a yum transaction, that created LVM snapshots with the tag
'yum_20100129133223', is as simple as:
  lvconvert --merge @yum_20100129133223

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-02-05 22:44:37 +00:00
Dave Wysochanski
b34f3ea13f Remove unnecessary "dmsetup resume" after "dmsetup create".
It is not necessary to resume after a create since the create will
create the table and make it active.
2010-02-01 19:43:22 +00:00
Mike Snitzer
43d99aab6c Default to checking LV's progress before waiting in _wait_for_single_lv.
Support "wait before testing" using '+' in pvmove and lvconvert
interval.  Doing so overrides the new default of sleeping after checking
the LV's progress.

Sleeping before checking progress can lead to extraneous polldaemons
being left running.  These polldaemons would have otherwise exited had
they checked before sleeping.  Checking progress before sleeping helps
workaround the subtly unreliable nature of "finished" state checking
in _percent_run.

Update test/t-mirror-names.sh to use '+' when providing its lvconvert
interval.
2010-01-22 21:59:42 +00:00
Mike Snitzer
fc6dc34429 add test/t-snapshot-merge.sh to provide coverage of snapshot-merge support 2010-01-19 22:55:00 +00:00
Mike Snitzer
cf760281f0 test/t-topology-support.sh requires scsi_debug from >= 2.6.31 2010-01-19 17:06:50 +00:00
Mike Snitzer
8e8f77f8f3 Add a common way to establish a scsi_debug-based 4K drive for use by an
LVM2 test (rather than using the traditional loop device).

prepare_scsi_debug_dev currently assumes exclussive access to the
scsi_debug module.  Any script that tries to use prepare_scsi_debug_dev
when scsi_debug is unavailable or already loaded into the kernel will be
skipped.

t-topology-support.sh shows how prepare_scsi_debug_dev function can be
used repeatedly (within a script) to test LVM2 ontop of a ramdisk-based
SCSI device w/ arbitrary scsi_debug features.
2010-01-19 16:44:57 +00:00
Mike Snitzer
fd6ca7415f update test/t-pvcreate-operation-md.sh attempt loading raid0.ko if raid0
isn't already available (in /proc/mdstat).

switch to requiring 2.6.33 for the alignment_offset tests; 2.6.{31,32}
alignment_offset values aren't reliable.  2.6.33 _should_ have mkp's
alignment_offset fixes but so far it doesn't (as of 2.6.33-rc4).
2010-01-19 15:59:34 +00:00
Alasdair Kergon
d7e70d2557 disable 'redundant' tests 2010-01-12 14:19:46 +00:00
Jonathan Earl Brassow
6275dd8126 Add new test cases for mirrors that are under snapshots. 2010-01-11 21:27:49 +00:00
Jonathan Earl Brassow
673421ffc2 Testsuite updates and fixes for recently added features.
1. Found bug in 'redundant log' implementation that caused
   problems when converting a linear that spanned multiple
   devices to a mirror (wasn't checking for NULL value of
   provided parameter in _alloc_parallel_area)

2. Testsuite was failing to perform tests when 'not' modifier
   was used.  This allowed a couple issues to slip through.
   Added a 'not_sh' modifier that negates tests performed by
   functions defined in the shell source file.

3. Was initializing a variable to far down, which cause
   previously set value to be overridden.  (This was the
   result of the collision of the "redundant log" and
   lvconvert fix patches.)
2010-01-11 21:20:19 +00:00
Peter Rajnoha
4df024c40c Define {DM, LVM}_UDEV_DISABLE_CHECKING=1 env. variables for tests.
We need to disable udev checking for our tests since they use their own
location for device nodes and symlinks.
2010-01-11 15:48:49 +00:00
Peter Rajnoha
0366ff6fb0 Enable udev_sync and udev_rules in lvm.conf by default while running tests. 2010-01-11 15:43:19 +00:00
Petr Rockai
eaac0790f5 In lvconvert --repair --use-policies, for the allocate policies, return success
even if allocation fails, as long as the downconversion or corelog conversion
succeeded.
2010-01-08 13:04:10 +00:00
Milan Broz
0c409a58ee Explicitly use non-clustered vgcreate in test.
(So the tests can run under cluster locking and do not require
cluster mirror or snapshots.)

Add vgscan before block device readahead change
(flush long running process - clvmd - dev cache.)
2009-12-28 18:33:04 +00:00
Petr Rockai
dff5da2d64 Fix removal of multiple devices from a mirror (+ regression test). 2009-12-17 15:38:29 +00:00
Jonathan Earl Brassow
2df53fc3d0 s/=/==/ Typo was causing sub test to always return success. 2009-12-10 22:06:15 +00:00
Dave Wysochanski
e4e8cf3b59 Add tests to check for readahead value in lvcreate. 2009-12-03 01:48:05 +00:00
Petr Rockai
99a304bc17 Optionally abort on internal errors (and leverage this option in the
testsuite). (This is showing a problem in the pvmove test for me, so I expect
the tests to start failing -- this needs to be fixed separately though.)
2009-11-30 17:17:11 +00:00
Petr Rockai
42812732a3 The sourcedir instances of the test scripts are not PHONY. 2009-11-30 16:58:53 +00:00
Petr Rockai
1bedaf742a Don't fail in the builddir == srcdir case, though. (testsuite) 2009-11-30 16:56:42 +00:00
Petr Rockai
a124554ded Fix test/api to work with srcdir != builddir. 2009-11-30 15:12:34 +00:00
Petr Rockai
be46b5e5a8 More fixes for the testsuite in the $(builddir) != $(srcdir) situation. 2009-11-30 14:59:26 +00:00
Petr Rockai
c7dbfb43c4 Add a basic test for snapshots of mirrors, thanks to Jon Brassow. 2009-11-19 13:55:40 +00:00
Petr Rockai
e7a5c8cf3d Fix the dmeventd LD_LIBRARY_PATH in the testsuite. 2009-11-19 12:01:39 +00:00
Petr Rockai
1ace1b5ddf Rudimentary support for running testsuite in a builddir != srcdir situation. 2009-11-02 15:16:21 +00:00
Dave Wysochanski
1ef6c6b107 Add to vgcreate and vgextend nightly tests. 2009-10-31 16:43:07 +00:00
Petr Rockai
b4048242f5 Handle metadata with unknown segment types more gracefully. 2009-10-16 17:41:49 +00:00
Dave Wysochanski
0ddb66efba Add --pvmetadatacopies as a synonym for --metadatacopies in various commands.
Going forward, we would like to allow users to specify the total
number of metadatacopies in a VG rather than on a per-PV basis.  In
order to facilitate that, introduce --pvmetadatacopes to replace
--metadatacopies everywhere.  We still allow --metadatacopies for
pv commands, but require --pvmetadatacopies for vg commands.
Eventually we will introduce --vgmetadatacopies.  Once we do that,
we should either deprecate --metadatacopies or make it a synonym based
on the command (pvmetadatacopies for pv commands, and vgmetadatacopies
for vg commands).  The latter option would likely just require a simple
'strncpy' check against cmd->command->name to qualify the merge_synonym
call.

Update nightly tests to cover the pvmetadatacopies synonym.

Note that this patch is the result of an eariler review comment for
the implicit pvcreate patches.  Should apply cleanly on top of the
implicit pvcreate patches (I applied after patch 10/10 in that series).

NOTE: This patch will require --pvmetadatacopies for vgconvert as
--metadatacopies is no longer accepted.
2009-10-05 20:55:56 +00:00
Dave Wysochanski
b8a7da0133 Add --pvmetadatacopies as a synonym for --metadatacopies in various commands.
Going forward, we would like to allow users to specify the total
number of metadatacopies in a VG rather than on a per-PV basis.  In
order to facilitate that, introduce --pvmetadatacopes to replace
--metadatacopies everywhere.  We still allow --metadatacopies for
pv commands, but require --pvmetadatacopies for vg commands.
Eventually we will introduce --vgmetadatacopies.  Once we do that,
we should either deprecate --metadatacopies or make it a synonym based
on the command (pvmetadatacopies for pv commands, and vgmetadatacopies
for vg commands).  The latter option would likely just require a simple
'strncpy' check against cmd->command->name to qualify the merge_synonym
call.

Update nightly tests to cover the pvmetadatacopies synonym.

Note that this patch is the result of an eariler review comment for
the implicit pvcreate patches.  Should apply cleanly on top of the
implicit pvcreate patches (I applied after patch 10/10 in that series).

NOTE: This patch will require --pvmetadatacopies for vgconvert as
--metadatacopies is no longer accepted.
2009-10-05 20:53:41 +00:00
Dave Wysochanski
0175de7f11 Add implicit tests for implicit pvcreate during vgcreate and vgextend.
Update tests and WHATS_NEW for implicit pvcreate support.
2009-10-05 20:04:40 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Dave Wysochanski
1d707156cc Update nightly tests to deal with unit changes.
Now uppercase letters imply Si units, so use lowercase everywhere.
We could stay with uppercase, but then we'd have to deal with rounding, etc.
Also, some output / error messages change slightly (instead of "GB" we're
now saying "GiB").
One test enhancement might be to add some new tests for the units changes
but for now let's just get the test back to passing.
2009-09-30 16:13:53 +00:00
Dave Wysochanski
5a446cfbb9 Fix lvm2app test to run under test/api subdirectory only when configured. 2009-09-15 19:59:04 +00:00
Dave Wysochanski
a4cc1ef5d9 Fix build failure when enabling dmeventd and applib.
This patch fixes a build with options similar to the following:
./configure --enable-debug --enable-applib --enable-dmeventd --enable-cmdlib
2009-09-14 22:56:27 +00:00
Milan Broz
97cf20174d Do not run mdadm tests if MD module is not loaded. 2009-09-13 19:28:00 +00:00
Dave Wysochanski
e2ac2ad9bc Update lvm2app unit test vgtest - fix remove bug.
We now must commit to disk after lvm_vg_remove().
2009-09-04 19:17:46 +00:00
Dave Wysochanski
46b50a2520 Fix path to test/api/vgtest in nightly testsuite. 2009-09-04 14:26:16 +00:00
Dave Wysochanski
25eac61778 Add lvm2app.sh to nightly testsuite.
More tests to come but for now just call into vgtest.
Fix warning in vgtest.c
2009-09-04 12:54:23 +00:00
Dave Wysochanski
5e9891477a Fix path to test/api/vgtest in nightly testsuite. 2009-09-04 14:26:16 +00:00
Dave Wysochanski
e5ee502092 Remove 'test' interative api unit tests from 'TARGET' line.
The test/api directory TARGET line will be reserved for non-interactive
unit tests.  Building the interactive test can still be done with "make test"
from the test/api dir.
2009-09-04 13:49:02 +00:00
Dave Wysochanski
4071b6a401 Add lvm2app.sh to nightly testsuite.
More tests to come but for now just call into vgtest.
Fix warning in vgtest.c
2009-09-04 12:54:23 +00:00
Dave Wysochanski
b153cf3169 Update lvm2app vgtest to take vgname and devices as parameters. 2009-09-03 17:13:46 +00:00
Dave Wysochanski
73e48198f0 Fix vgsplit test to require -M on ordering of vgnames. 2009-09-02 19:38:53 +00:00
Dave Wysochanski
5863975c29 Add alphabetical vgname ordering tests for vgsplit, vgmerge, vgrename. 2009-09-02 18:31:11 +00:00
Dave Wysochanski
5d370b1bdd Make lvm2app lv_t handle definition consistent with lvm_t.
This patch update lv_t handle to be consistent with lvm_t - define as a pointer
to internal struct logical_volume.

Author: Dave Wysochanski <dwysocha@redhat.com>
2009-08-13 12:17:32 +00:00
Dave Wysochanski
7510963fbf Make lvm2app vg_t handle definition consistent with lvm_t.
This patch update vg_t handle to be consistent with lvm_t - define as a pointer
to internal struct volume_group.

Author: Dave Wysochanski <dwysocha@redhat.com>
2009-08-13 12:16:45 +00:00
Dave Wysochanski
a5a6597a7e Update test/api/test.c to call lvm_vg_create and lvm_vg_remove.
Also fix a couple bugs.
2009-08-07 21:22:37 +00:00
Mike Snitzer
61b61849eb Added basic pvcreate --dataalignmentoffset testing to t-pvcreate-usage.sh
Added topology testing via new test/t-pvcreate-operation-md.sh
- requires mdadm and rawhide kernel for full test coverage
2009-08-04 16:02:39 +00:00
Petr Rockai
f5cb304acb Make lvconvert honour log mirror options combined with downconversion.
(RHBZ 463272)
2009-08-02 21:59:21 +00:00
Petr Rockai
7aa72b6820 Add test for RHBZ 481793 (passing, thanks to vg_read changes checked in
previously).
2009-08-02 21:45:45 +00:00
Alasdair Kergon
3543c9b320 renamed include files 2009-07-29 14:06:31 +00:00
Dave Wysochanski
d48b3d26c9 Update interactive unit test - fix silly vg_close error. 2009-07-28 14:12:29 +00:00
Dave Wysochanski
e3f0940aae Update interactive unit test for liblvm - add vg_write, general cleanup. 2009-07-28 13:49:28 +00:00
Dave Wysochanski
9ac1af7160 Add lvm_vg_get_seqno, updating lvm.h and unit test.
Adding the ability to get the seqno is important for an application to
determine if something has changed in a VG.  Otherwise, the only way to
know is to open the VG with write permission and hold the handle.
2009-07-28 13:17:04 +00:00
Dave Wysochanski
f7bc94ac3a Add lvm_library_get_version() and update unit tests to display version. 2009-07-28 11:03:28 +00:00
Dave Wysochanski
9c2e73fdd2 Rename lvm_create to lvm_init and lvm_destroy to lvm_quit. 2009-07-28 09:16:18 +00:00
Dave Wysochanski
5f16e04b77 Add config_reload and config_override to test.c, change prompt.
PV         PV UUID                                VG
  /dev/loop1 A95EvV-iqmb-ZFuJ-u8MV-Npwn-wlc2-Ul1Mnn vg1
  /dev/loop0 R16FDG-OmoS-HNGt-LSZY-OAlC-7qeU-t2gztp vg1
lvm> config_override loop0
Success overriding LVM configuration
lvm> config_reload
Success reloading LVM configuration
lvm> vg_open vg1
Couldn't find device with uuid 'A95EvV-iqmb-ZFuJ-u8MV-Npwn-wlc2-Ul1Mnn'.
Success opening vg vg1
lvm> vg_close vg1
lvm> quit

Maybe a bug in lvm_vg_open for missing pvs but the filter seems to work.

Change prompt from "lvm>" to "liblvm>".

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-07-27 21:02:51 +00:00
Dave Wysochanski
c533b9a305 Update test/api/test.c to include lvm_vg_reduce and lvm_vg_extend.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-27 17:45:21 +00:00
Dave Wysochanski
ed8031de4f Update test/api/vgtest.c to include lvm_vg_reduce.
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Acked-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-27 17:44:58 +00:00
Dave Wysochanski
7d55939138 Update test/api/test.c to display lvm_lv_is_active and lvm_lv_is_suspended.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 20:59:02 +00:00
Dave Wysochanski
0e5c15a1ba Update test/api/test.c to call lv_deactivate and lv_activate.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 20:58:38 +00:00
Dave Wysochanski
bd1dcfbe96 Update test/api/*.c to use consistent liblvm error returns.
For now, liblvm will return -1 (fail) / 0 (success) or
NULL (fail) / non-NULL (success).  Upon failure, lvm_errno and
lvm_errmsg should be used to determine the precise error.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 20:29:56 +00:00
Dave Wysochanski
2572832e0c Rename lvm_scan_vgs to lvm_scan.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 16:44:05 +00:00