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

392 Commits

Author SHA1 Message Date
Petr Rockai
a3513577f0 The "should" testing utility should actually only give a warning when the
command fails.
2010-05-12 05:55:42 +00:00
Petr Rockai
29ad12df51 Improve the "check" testing utility: slightly refactor and provide
active/inactive checks.
2010-05-12 05:55:08 +00:00
Petr Rockai
b7983d4fe2 Add a basic test for dmeventd triggering lvconvert --repair. Needs improvement. 2010-05-06 19:01:26 +00:00
Petr Rockai
6120f4c507 Add some basic provisions for automated testing of dmeventd. 2010-05-06 18:54:51 +00:00
Petr Rockai
6c1beb94dc 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
dd8ac54678 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
d5857e6d48 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
4a76f5c764 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
aa3bdb1911 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
d4de2a7aa4 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
e37b173f13 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
b7af7c9c43 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
063083a203 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
7cd66377ef 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
c198ca0285 Add missing readline linkage to lvm2app test. 2010-04-14 16:13:34 +00:00
Petr Rockai
10b62fb0e8 Allow incomplete mirror restore in lvconvert --repair upon insufficient space. 2010-04-14 13:51:58 +00:00
Petr Rockai
73d1626ddc SIGTERM testing clvmd before SIGKILL-ing it. 2010-04-14 12:04:23 +00:00
Dave Wysochanski
4487c42de2 Fix teardown in t-pvcreate-operation-md.sh nightly test. 2010-04-13 21:42:44 +00:00
Petr Rockai
b5e83471bc Add check_cluster and check_local targets in addition to just "check". 2010-04-13 13:28:52 +00:00
Petr Rockai
bfdc05ec71 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
1d7ecbe9a0 Fix a reversed exit status from test harness. 2010-04-13 07:34:19 +00:00
Petr Rockai
9e30a829d5 Optionally disable the verbose repeat of a failed test (export
LVM_TEST_NOVERBOSE=1).
2010-04-13 07:33:34 +00:00
Petr Rockai
698dfbf953 Disable the rather-dangerous prepare_scsi_debug_dev in the testsuite. 2010-04-13 07:02:14 +00:00
Petr Rockai
83fbb1ec11 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
19d0f2b57c 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
05d40b3142 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
28e1e7fd07 More testsuite helpers for check.sh. 2010-04-12 19:33:58 +00:00
Petr Rockai
904e38837e Absorb t-mirror-lvconvert-usage into t-lvconvert-mirror. 2010-04-12 19:32:58 +00:00
Petr Rockai
697c5de267 Explode t-mirror-basic into a number of smaller tests. 2010-04-12 19:16:24 +00:00
Petr Rockai
bfa9c7bcfb 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
2f81a05ce5 Do not pollute /tmp with testing byproducts. 2010-04-12 19:00:23 +00:00
Zdenek Kabelac
2db34bd266 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
f3491d93a0 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
2e9ae681c5 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
a02f7ab0cb another incorrect test that should have been failing before 2010-04-08 01:43:46 +00:00
Petr Rockai
fd7ae0cdf4 Don't forget to cd into $TESTDIR in test-utils.sh / prepare_testdir. 2010-04-07 21:38:01 +00:00
Petr Rockai
dcecda51d8 Fix a mis-override of $PWD in test-utils.sh. 2010-04-07 21:19:20 +00:00
Petr Rockai
acb04c003e 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
86b10089aa Avoid spurious skips in the testsuite due to obsoleted
dmsetup_has_dm_devdir_support_.
2010-04-07 16:00:19 +00:00
Petr Rockai
5e8c230d1f 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
8c2890cf1d 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
8e9da71c32 Keep the testsuite stats correct in spite of failed-test repetition. 2010-04-07 09:41:33 +00:00
Petr Rockai
13deb51d3e Move a fragile testcase toward the end of t-mirror-lvconvert.sh. 2010-04-06 23:04:45 +00:00
Petr Rockai
2c9ffffdca Put back the `lvconvert -m+1 --mirrorlog disk' test in t-lvconvert-mirror.sh. 2010-04-06 22:22:26 +00:00
Alasdair Kergon
13a9bce647 disable another broken check in a test 2010-04-06 18:13:43 +00:00
Alasdair Kergon
dbb3cfe05e Fix is_partitioned_dev not to attempt to reopen device. 2010-04-06 17:36:41 +00:00
Alasdair Kergon
674baa8143 Disable broken test. 2010-04-06 16:30:53 +00:00
Alasdair Kergon
6a5a0222d7 Display PVs created during tests 2010-04-06 14:25:07 +00:00
Zdenek Kabelac
4512267bf1 Using 'not' if the test 'should' fail. 2010-04-06 14:24:13 +00:00
Petr Rockai
f0d1c085b9 Do not pass NULL to setenv in the test harness. 2010-03-31 23:11:12 +00:00
Zdenek Kabelac
45490081c7 Missed to convert T -> SCRIPTS 2010-03-31 23:05:20 +00:00
Petr Rockai
a3503d13e5 Re-run failing tests with log/verbose=4 (-vvvv) to help with debugging. 2010-03-31 22:18:17 +00:00
Jonathan Earl Brassow
18f0009a41 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
1cf64de2bf 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
28aa06675f 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
6e86d0bb03 Enforce distinct-PV allocation of snapshot/origin pairs in vgsplit test. 2010-03-29 16:40:51 +00:00
Zdenek Kabelac
7452298131 Fix also error code from clean:
And fix previous commit which missed test.
2010-03-29 15:53:11 +00:00
Zdenek Kabelac
e4be66b1ac Oops, avoid returning errors from shell to makefile for builddir == srcdir 2010-03-29 15:39:25 +00:00
Zdenek Kabelac
ea64fe3b51 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
f293d0b951 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
eb10fc962b When a scsi_debug modprobe fails, skip the test instead of failing it. 2010-03-28 15:52:04 +00:00
Jonathan Earl Brassow
3318c41356 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
340fa684af Updates .so links for plugins 2010-03-26 13:21:28 +00:00
Alasdair Kergon
8f6c0b24d8 more diagnostics 2010-03-25 12:16:17 +00:00
Alasdair Kergon
b8eddf1bdc more diagnostics 2010-03-25 12:14:14 +00:00
Alasdair Kergon
1469dc216a add debug mesg 2010-03-25 11:57:16 +00:00
Alasdair Kergon
a89db8e69c 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
8c6f06eb34 add debug output and attempt to control which device gets log as intended perhaps 2010-03-25 11:42:17 +00:00
Peter Rajnoha
299db29482 Export and use only valid cookie value in test suite. 2010-03-23 14:47:35 +00:00
Petr Rockai
de33332491 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
f9ddafdc21 Skip locking_type 3 tests instead of failing when system-wide clvmd is running. 2010-03-18 09:27:39 +00:00
Petr Rockai
fdefd5eff9 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
e9e5dbb628 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
0e57141bb5 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
6cf89391b6 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
zkabelac
75f55c758c 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
aa9c970f97 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
5d7ad8ae75 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
4982eabe07 In testsuite, catch also failures that happen in the middle of a pipeline. 2010-02-17 15:41:28 +00:00
Dave Wysochanski
c66ce519f4 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
e74208778d 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
2419c1c540 Use udev transactions in testsuite. 2010-02-15 16:30:13 +00:00
Dave Wysochanski
21573cd4f0 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
3e5a54a791 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
d5ea20a6eb 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
5a414c6ad1 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
dac8cee72c add test/t-snapshot-merge.sh to provide coverage of snapshot-merge support 2010-01-19 22:55:00 +00:00
Mike Snitzer
e894d07b92 test/t-topology-support.sh requires scsi_debug from >= 2.6.31 2010-01-19 17:06:50 +00:00
Mike Snitzer
a90f6e2dda 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
e449bfd741 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
16ee54ad23 disable 'redundant' tests 2010-01-12 14:19:46 +00:00
Jonathan Earl Brassow
84763527c5 Add new test cases for mirrors that are under snapshots. 2010-01-11 21:27:49 +00:00
Jonathan Earl Brassow
1744c1c2ba 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
a8ed16de33 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
ee0a4914d5 Enable udev_sync and udev_rules in lvm.conf by default while running tests. 2010-01-11 15:43:19 +00:00
Petr Rockai
e53a955115 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
e357c9fc0c 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
a47e422715 Fix removal of multiple devices from a mirror (+ regression test). 2009-12-17 15:38:29 +00:00
Jonathan Earl Brassow
157810ea3d s/=/==/ Typo was causing sub test to always return success. 2009-12-10 22:06:15 +00:00
Dave Wysochanski
5818b6efb8 Add tests to check for readahead value in lvcreate. 2009-12-03 01:48:05 +00:00