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

582 Commits

Author SHA1 Message Date
Petr Rockai
a91fa821ab Import new test utilities and a test harness. 2008-09-29 15:59:19 +00:00
Milan Broz
dfdb10f6de Add more vgreduce tests. (Jaroslav Stava) 2008-09-19 16:12:25 +00:00
Milan Broz
5cbe5909eb Fix vgreduce test, now requires --force flag. (Jaroslav Stava) 2008-09-19 16:10:46 +00:00
Milan Broz
a0d865492e fix vgreduce tests to detect partial command failure (Jaroslav Stava) 2008-08-28 11:20:49 +00:00
Milan Broz
de27790de8 add vgcreate rejects repeated invocation test
add vgcreate fails when the only pv has --metadatacopies 0 test
(by Jaroslav Stava)
2008-08-28 11:09:58 +00:00
Milan Broz
9c910b7be2 add vgrename by uuid test (Jaroslav Stava)
fix vgsplit rejects last mda copy test (Jaroslav Stava)
2008-08-28 10:59:10 +00:00
Milan Broz
77dc036c8f Add pvremove usage test (Jaroslav Stava) 2008-08-28 10:24:55 +00:00
Milan Broz
aa6e8d82ce - fix environment variable prefix to LVM (this is not GIT:-)
- add lvcreate rejects repeated invocation test
- fix pvs metadata test for partial failure test
- add pvchange reject --addtag to lvm1 pv test

(All fixes by Jaroslav Stava)
2008-08-28 10:07:34 +00:00
Dave Wysochanski
3010285bb3 Fix symbolic link creation in test infrastructure.
Original code would create "*.so" symbolic links if there were no actual
files ending in "so".  The second iteration would then cause an error
in the test logs.
2008-08-21 14:33:48 +00:00
Zdeněk Kabeláč
aaad3252f8 fail testcase for failed commands inside the for loop 2008-08-20 13:34:33 +00:00
Zdeněk Kabeláč
52361c94e5 valid parameter for lvchange -p is 'rw' 2008-08-13 14:28:17 +00:00
Zdeněk Kabeláč
798be60fef added test for coverage improvement
added test for metadata type 1
2008-08-13 13:49:07 +00:00
Milan Broz
582706cde6 add tests for pvchange and vgreduce usage (Jaroslav Stava) 2008-08-12 10:04:31 +00:00
Milan Broz
6537cbdc17 test vgsplit: reject to give away pv with the last mda copy (Jaroslav Stava) 2008-08-12 10:01:56 +00:00
Zdeněk Kabeláč
a4d2fddbb2 add test for pool labels gfs
add test for metadatacopies0 and snapshot manipulation
2008-08-05 12:33:41 +00:00
Zdeněk Kabeláč
c54a3f2721 put dmeventd into the LD_LIBRARY_PATH for lvm-wrapper 2008-08-05 12:32:08 +00:00
Zdeněk Kabeláč
5406e3b7c5 avoid endless option parsing loop
add support for lvm verbose operation -vvvv
add dlsym path to the test config file
2008-08-05 11:39:54 +00:00
Zdeněk Kabeláč
6b624b7d00 * parse error output for 'auto' keyword 2008-08-04 09:15:15 +00:00
Zdeněk Kabeláč
1f27bf3774 disable mdadm test-case until a better solution is found 2008-08-01 15:44:53 +00:00
Dave Wysochanski
61243c65cd Add pvcreate tests to verify failure on md array detection. 2008-07-29 21:05:20 +00:00
Dave Wysochanski
cbf1447ebd Refactor pvcreate - simplify return codes. 2008-07-25 14:59:51 +00:00
Dave Wysochanski
b4a70804f0 Refactor pvcreate - --force parameter. 2008-07-25 14:36:55 +00:00
Dave Wysochanski
43e05607af Refactor pvcreate - move uuid and restorefile options. 2008-07-25 00:30:57 +00:00
Dave Wysochanski
55793452d5 Add pvcreate tests for uuid and restorefile. 2008-07-24 17:33:40 +00:00
Dave Wysochanski
e0d61a4336 Add more pvcreate tests to validate writing lvm2 label using --labelsector. 2008-07-21 18:50:10 +00:00
Dave Wysochanski
98fadec2b6 Only use lvm2 metadata for now. 2008-07-17 04:03:04 +00:00
Dave Wysochanski
14f464ecb0 Update pvcreate and vgsplit tests.
Add more pvcreate tests.
Start handling lvm1 and lvm2 metadata and metadatacopies=0,1.
2008-07-17 03:17:01 +00:00
Dave Wysochanski
2ecdaf9bd4 Add pvcreate sanity tests, check for label_write() failure in _text_pv_write().
Failure to check for label_write() return code caused the following test
to indicate it passed when it really failed:
pvcreate rejects labelsector > 1000000000000
2008-07-16 21:32:38 +00:00
Alasdair Kergon
6401f1b1c9 tweak lcov configuration/makefiles 2008-06-27 19:24:17 +00:00
Dave Wysochanski
5d5b575d16 Test script cleanup. 2008-06-25 16:51:26 +00:00
Zdeněk Kabeláč
949c1ab517 Improve/Fix read ahead 'auto' calculation for stripe_size
Fix lvchange output for -r auto setting if auto is already set
Add testcase for read ahead
2008-06-18 11:32:14 +00:00
Dave Wysochanski
757f91ca89 Add simple test case to repro pvs segfault with duplicate vgnames. 2008-06-09 15:31:58 +00:00
Jim Meyering
6f0f5a569d * lvm-utils.sh (init_root_dir_): Correct a diagnostic.
Author: Jim Meyering <meyering@redhat.com>
2008-06-06 13:48:57 +00:00
Dave Wysochanski
e46a6d1cc1 Add test for rhbz440405 - lvconvert -m0 fails incorrectly if all PEs allocated. 2008-04-23 18:27:59 +00:00
Dave Wysochanski
0a2572a5eb Update test function _check_{vg|lv|pv}_field to aid in test debug.
Author: Dave Wysochanski <dwysocha@redhat.com>
2008-04-23 13:02:03 +00:00
Dave Wysochanski
8388779937 Fix vgsplit and vgmerge tests for updated lv counting. 2008-04-11 14:06:16 +00:00
Dave Wysochanski
fc7dfca452 Update vgsplit test to verify loosening of active LV restriction.
This and prior 2 commits resolve Red Hat bz 252041:
Ability to vgsplit an active Volume Group where the split involves only inactive LVs
2008-04-10 21:38:52 +00:00
Alasdair Kergon
e612871ea7 more pre-release cleanup 2008-04-10 19:59:43 +00:00
Dave Wysochanski
8618c271cf Update vgsplit tests that count LVs for adjusted LV counting. 2008-04-10 18:55:40 +00:00
Dave Wysochanski
bf1edbd1e2 Fix lvm tool exit code display in some tests. 2008-04-10 01:06:48 +00:00
Dave Wysochanski
a8484d987d Add vgsplit tests to verify mirror is not moved unnecessarily. 2008-04-09 21:10:13 +00:00
Dave Wysochanski
9b2147f608 Fix vgsplit to only move hidden 'snapshotN' LVs when necessary.
This bug has been around for a long time as far as I can tell.
Without this fix, a vgsplit would unconditionally move the
'hidden/internal' snapshot LVs, and result in corrupted metadata
in the following case:
vg1: contains lv1, lv1snap, both on pvset1
vg1: contains lv2, on pvset2

"vgsplit vg1 vg2 pvset2"
would result in "snapshot0" hidden LV being moved to vg2, and
the origin and cow being left in vg1.  The tools detect the
corruption in vg2, but not in vg1.
2008-04-09 20:56:06 +00:00
Dave Wysochanski
32530b378e Update vgsplit tests for lvnames on the cmdline. 2008-04-09 14:47:34 +00:00
Milan Broz
ac7334c167 Add validation of LV name to pvmove -n. 2008-04-04 11:59:31 +00:00
Dave Wysochanski
7f26240442 Fix lvresize to dump stack if vg_lock_and_read() fails.
Necessary because vg_lock_and_read() may fail silently if the vg_check_status() call fails.

Also add lvresize tests.
2008-04-02 12:17:30 +00:00
Dave Wysochanski
d83a354781 Enhance test debugging by updating verbose mode of check_*_field_ functions.
Author: Dave Wysochanski <dwysocha@redhat.com>
2008-03-28 18:02:22 +00:00
Dave Wysochanski
eaa46a2575 Add vgmerge tests. 2008-03-26 18:03:35 +00:00
Dave Wysochanski
17c1f54369 Add vgsplit tests to verfy attributes of new VG match source VG.
Author: Dave Wysochanski <dwysocha@redhat.com>
2008-03-23 15:40:35 +00:00
Dave Wysochanski
33ae38e71b Fixup vgsplit tests in preparation for vgsplit changes. 2008-03-21 22:00:29 +00:00
Dave Wysochanski
ef58af4bf1 Update vgsplit tests to execute twice (existing and new VG as destination). 2008-03-21 21:14:38 +00:00
Milan Broz
3316d59910 Add metadata test for escaping double quotes in device names (bz431474). 2008-03-12 17:34:58 +00:00
Dave Wysochanski
6381666df4 Update vgsplit tests.
- Add validation on pv_count, lv_count, and snap_count after split
NOTE: Some of these counts are misleading.  If you compare "lvs" output
with these counts you will be left scratching your head what a "logical volume"
really is.  ;-)
2008-03-04 22:49:00 +00:00
Dave Wysochanski
736f1aa301 Update vgsplit tests.
- Divide into 'usage' and 'operation' tests.
- Add operation tests for specific LV types.
2008-03-04 19:48:32 +00:00
Dave Wysochanski
8226a5276b Add vgsplit test to check failure when PV not in source volume group. 2008-02-29 00:09:21 +00:00
Dave Wysochanski
77ad0bb12e Fix t-vgsplit-operation.sh lv2-3 definitions to include test signature. 2008-02-28 17:39:47 +00:00
Dave Wysochanski
9412b42206 Fix t-vgsplit-operation.sh lv1 definition to include test signature. 2008-02-28 16:48:09 +00:00
Alasdair Kergon
2b83c80593 Fix mirror log name construction during lvconvert. (2.02.30)
Make monitor_dev_for_events recurse through the stack of LVs.
Clean up some more compiler warnings.
Add mirror names test script.
2008-01-31 12:19:36 +00:00
Alasdair Kergon
25e2d4da44 . 2008-01-26 00:25:45 +00:00
Dave Wysochanski
b65f5a844f Fix vgsplit tests 12-13 2008-01-22 03:30:14 +00:00
Dave Wysochanski
95a69f99ba Fix vgsplit - print different message on successful split of existing / new vg
Fix vgsplit - fix a couple error paths that forgot to call unlock_vg
Update vgsplit test cases
2008-01-22 03:25:45 +00:00
Dave Wysochanski
71d609895a Fix vgsplit - print error if vgcreate option given w/existing vg destination
Fix vgsplit - reject split if metadata types or clustered attributes differ
Fix vgsplit - remove physicalextentsize option
Add vgsplit test cases
2008-01-22 02:48:53 +00:00
Dave Wysochanski
9b52617919 Add a test case for 'vgreduce --removemissing' on stacked mirror 2008-01-17 18:29:36 +00:00
Dave Wysochanski
efc1d46c89 More test script fixes. 2008-01-17 18:05:57 +00:00
Dave Wysochanski
e9433e83cd Minor test fix 2008-01-17 15:56:53 +00:00
Dave Wysochanski
67bcfb6947 Fix descriptions in the newly added test cases 2008-01-17 02:20:48 +00:00
Dave Wysochanski
2802c476ee Fix 'make check' runnable with recent versions of dmsetup.
Fix 'make check' to use DMDIR to check DM_DEV_DIR support in dmsetup.
Add basic test cases for mirrored LV.
Add basic test cases for lvconvert mirror.
Add basic test cases for pvmove.
	Jun'ichi Nomura <j-nomura@ce.jp.nec.com>

Add new vgsplit and vgmerge tests.
	Dave Wysochanski <dwysocha@redhat.com>
2008-01-16 21:21:22 +00:00
Dave Wysochanski
dad73465fc Create vgs_are_compatible() fn to check whether vgs are compatible for merging.
Add new vgmerge and vgsplit tests to check rejection of incompatible vgs.
Cleanup comments.
Bugzilla: bz251992

---
 lib/metadata/metadata-exported.h |    3 +
 lib/metadata/metadata.c          |   89 +++++++++++++++++++++++++++++++++-
 test/t-vgmerge-usage.sh          |  101 +++++++++++++++++++++++++++++++++++++++
 test/t-vgsplit-operation.sh      |   20 +++++++
 tools/vgmerge.c                  |   69 --------------------------
 tools/vgsplit.c                  |    5 -
 6 files changed, 215 insertions(+), 72 deletions(-)
2008-01-16 19:54:39 +00:00
Dave Wysochanski
628d3bff45 Move more parameter validation into the library.
Update vgrename to call validate_vg_rename_params().
Fix vgcreate and vgsplit default arguments by adding defaults parameter to
fill_vg_create_params().
Add t-vgrename-usage.sh test.
Bugzilla: bz251992
---
 tools/toollib.c  |   32 ++++++++------------------------
 tools/toollib.h  |    5 ++---
 tools/vgcreate.c |   35 +++++++++++++++++++++--------------
 tools/vgrename.c |   35 ++++++-----------------------------
 tools/vgsplit.c  |   21 ++++++++++++++-------
 5 files changed, 51 insertions(+), 77 deletions(-)
2008-01-15 22:56:30 +00:00
Dave Wysochanski
38857ba29e Allow vgcreate options as input to vgsplit when new vg is split destination. 2008-01-14 21:07:58 +00:00
Dave Wysochanski
1c7520ec8f Allow vgsplit into existing vg.
Add vgsplit tests to validate operation for new and existing vg destinations.
2008-01-11 21:43:16 +00:00
Dave Wysochanski
cc203245e4 Refactor vgcreate for parameter validation and add tests 2008-01-11 07:02:35 +00:00
Jim Meyering
c9d9a96630 Avoid spurious test failure when compiled with readline support.
* test/t-000-basic.sh: Invoke initial test of lvm with its "version"
argument, so that the behavior of the tool doesn't depend on whether
readline was enabled at configure time.


Author: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Committer: Jim Meyering <meyering@redhat.com>
2007-12-05 09:49:08 +00:00
Jim Meyering
b8e48113a3 Run tests with LVM_SYSTEM_DIR pointing to private root and /dev dirs.
This makes the tests more reproducible and helps isolate
them from any existing LVM set-up.
* test/Makefile.in (abs_builddir): Define.
(init.sh): Emit definition of abs_builddir.
* test/lvm-utils.sh (unsafe_losetup_): Keep only the portable,
iterative approach.
(dmsetup_has_dm_devdir_support_): New function.
(init_root_dir_): New function.
Invoke init_root_dir_ for all but the first test.
* test/test-lib.sh (this_test_): Adapt to test-name change.
Invoke lvm-utils.sh much later (after tmpdir creation), and
only if the current test is not being skipped.
Remove useless abs_top_srcdir definition.
Rename t0->test_dir_rand_.
* test/t-lvcreate-pvtags.sh: Skip this test if the available
version of dmsetup is not new enough.
Use global, $G_dev_, rather than hard-coded "/dev".
* test/t-lvcreate-usage.sh: Make --verbose output more useful.


Author: Jim Meyering <jim@meyering.net>
Committer: Jim Meyering <meyering@redhat.com>
2007-10-09 13:13:06 +00:00
Jim Meyering
f35026c74f Avoid over-quoting in shell scripts.
Do not use "..." around the RHS of VAR= assignment,
nor on the argument of "case ... in ...".


Author: Jim Meyering <jim@meyering.net>
2007-09-24 19:19:18 +00:00
Dave Wysochanski
d7814c7011 add tests to validate lvextend %PVS 2007-09-21 21:14:25 +00:00
Jim Meyering
eba4417947 Rename test scripts not to include the 4-digit number.
Author: Jim Meyering <jim@meyering.net>
2007-09-21 17:12:13 +00:00
Jim Meyering
6b9c7485f1 test/t3000-lvcreate-pvtags.sh: Use better test names.
Author: Jim Meyering <jim@meyering.net>
2007-09-18 21:07:21 +00:00
Jim Meyering
b1d5e1b5e3 test/Makefile.in (lvm-wrapper): Use $(DMDIR)/lib/, not $(DMDIR)/lib/ioctl/.
Author: Jim Meyering <jim@meyering.net>
2007-09-18 14:29:06 +00:00
Jim Meyering
8d92a5cc14 Clean-up and wording changes; add copyright notices.
* test/Makefile.in (srcdir, top_srcdir): Use @srcdir@, etc.
(top_builddir, abs_srcdir, abs_top_builddir, abs_top_srcdir): Likewise.
(so_name): Remove definition.
(.bin-dir-stamp): No longer create symlink in $(DMDIR) tree.
Prompted by suggestions from Alasdair Kergon.
* test/t1000-lvcreate-usage.sh (cleanup_): Redirect to a file,
rather than to /dev/null.
Change wording of some test titles.
Suggestions from Alasdair Kergon.

* test/Makefile.in: Add a copyright notice.
* test/lvm-utils.sh: Likewise.
* test/mkdtemp: Likewise.
* test/t0000-basic.sh: Likewise.
* test/t1000-lvcreate-usage.sh: Likewise.
* test/t3000-lvcreate-pvtags.sh: Likewise.
* test/t4000-pv-range-overflow.sh: Likewise.
* test/test-lib.sh: Likewise.


Author: Jim Meyering <jim@meyering.net>
2007-09-18 14:02:22 +00:00
Jim Meyering
fc455df92c Test how lvcreate handles its command-line options.
* test/t1000-lvcreate-usage.sh: New tests.
* test/Makefile.in (T): Add it.
Derived from test cases by Dave Wysochanski.


Author: Jim Meyering <jim@meyering.net>
2007-09-18 14:01:46 +00:00
Jim Meyering
c0076ebfa1 Clean up shared-lib support in test/.
* test/Makefile.in (so_name): Use @DMDIR@.
(.bin-dir-stamp): Create symlink only if @DMDIR@ is nonempty.
(lvm-wrapper): Emit LD_LIBRARY_PATH setting only if @DMDIR@ is nonempty.
Based on a patch from Jun'ichi Nomura.


Author: Jim Meyering <jim@meyering.net>
2007-09-18 14:01:24 +00:00
Jim Meyering
fa1b9a4098 Add testing framework, along with first few tests.
* Makefile.in (check): New target.
* configure.in (AC_CONFIG_FILES): Add test/Makefile.
* configure: Regenerate.
* test/.gitignore: New file.
* test/Makefile.in: New file.
* test/lvm-utils.sh: New script.
* test/mkdtemp (die, rand_bytes, mkdtemp): New script.
* test/t0000-basic.sh: New tests.
* test/t3000-lvcreate-pvtags.sh: New, failing test.
Derived from a script by Jun'ichi Nomura.
* test/t4000-pv-range-overflow.sh: New test.
* test/test-lib.sh: Testing framework, based on the one from git.


Author: Jim Meyering <jim@meyering.net>
2007-09-18 14:00:42 +00:00