1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

175 Commits

Author SHA1 Message Date
Petr Rockai
f7a80fd8e3 Add an API test that shows how to find a value of pe_start for a VG without
actually creating the VG on-disk.
2011-06-04 21:46:34 +00:00
Petr Rockai
db22d9b978 This patchset refactors some reporting code and completes the remaining
lvseg properties for lvm2app, 'devices' and 'seg_pe_ranges'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2011-04-12 12:24:29 +00:00
Zdenek Kabelac
a912d581c4 Invert condition for READLINE check 2011-03-01 23:29:14 +00:00
Zdenek Kabelac
e3dd1c81e9 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
Zdenek Kabelac
11ec59c8d5 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
8f7cff6aec Query only test related vg name 2011-01-28 16:11:14 +00:00
Zdenek Kabelac
23fb1fbd48 Add missing lvm_quit in test
Fix occasional confusing memory leak report in testing.
2011-01-26 21:21:56 +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
21ee9f3234 Remove *.t in test/api's make clean target. 2011-01-07 13:07:10 +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
8961b1d503 Add getters for copy_percent and snap_percent to the lvm2app API. 2010-12-14 23:20:58 +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
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
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
Dave Wysochanski
68c5e7d2df Add interactive tests for lvm_{pv|vg|lv}_get_property(). 2010-10-25 14:09:19 +00:00
Dave Wysochanski
a616c0de2e Test lvm_vgname_from_{pvid|device}. 2010-05-19 11:53:30 +00:00
Dave Wysochanski
212510fdf8 Add missing readline linkage to lvm2app test. 2010-04-14 16:13:34 +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
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
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
Petr Rockai
a124554ded Fix test/api to work with srcdir != builddir. 2009-11-30 15:12:34 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +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
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
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
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
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
Dave Wysochanski
4e57aae3a7 Rename lvm_vg_get_free to lvm_vg_get_free_size.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 16:06:46 +00:00
Dave Wysochanski
1efda0fbb9 Rename lvm_list_vg_ids to lvm_list_vg_uuids.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 16:06:21 +00:00
Dave Wysochanski
befeabb45a Update test/api/test.c to call lvm_lv_remove.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 14:37:15 +00:00
Dave Wysochanski
90e0faf3db Update test/api/test.c - correct list_vg_names and list_vg_ids.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 13:08:00 +00:00
Dave Wysochanski
81bbb483f4 Update test/api/test.c for liblvm 'get' functions.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 13:07:41 +00:00
Dave Wysochanski
599e07d2e0 Update test/api/test.c to call lvm_vg_create_lv_linear.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:35:47 +00:00
Dave Wysochanski
ce611945ad Update test/api/test.c to handle read/write open modes.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:35:19 +00:00
Dave Wysochanski
ad534f790e Add tests for lvm_vg_name_list, lvm_vg_id_list and lvm_scan_vgs.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-24 12:51:32 +00:00
Dave Wysochanski
e9344c9174 Update test/api/test.c to not segfault if null lists of pvs/lvs returned.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-24 04:15:30 +00:00
Dave Wysochanski
a831b4920f Update test/api/test.c for simple tests involving pv/vg/lv name/uuid attributes.
Tests the following APIs:
- lvm_{pv|vg|lv}_get_{name|uuid}()
- lvm_{lvs|pvs}_in_vg()

Example:
lvm> vg_open VolGroup00
Success opening vg VolGroup00
lvm> vg_list_lvs VolGroup00
LVs in VG VolGroup00:
VolGroup00/LogVol00 (bFO4EU-UaDu-iuMm-N6BA-xcZc-nm3u-J5K5lu)
VolGroup00/LogVol01 (BHGsPK-PwzY-kye0-MEWa-a67z-BiYE-03ZjwM)
lvm> vg_list_pvs VolGroup00
PVs in VG VolGroup00:
/dev/sda2 (Be91pt-CqT0-4YJE-nGI6-Oisz-hy0N-l9CHgn)

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Thomas Woerner <twoerner@redhat.com>
2009-07-23 23:40:50 +00:00
Dave Wysochanski
eefacdfa04 Add a couple lvm_vg_open() calls to vgtest.c. 2009-07-22 22:25:30 +00:00
Dave Wysochanski
3d52ff1a75 Update api/test/vgtest.c error handling.
Reverts some of my 'cleanup' from last night.  For now we will use pass/fail
on API calls (either 'int' return or NULL/non-NULL handle), then use
lvm_errno() to get more specific errors.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-22 16:49:54 +00:00
Dave Wysochanski
ba15f0316a Update test/api/vgtest.c to use lvm_errno and lvm_errmsg.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-22 03:13:57 +00:00
Dave Wysochanski
41a3c26f07 Fix build environment of test/api: Make it usable for more than one test case.
Author: Thomas Woerner <twoerner@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-07-21 13:51:05 +00:00
Dave Wysochanski
3dcd5b3017 Rename test/api/vgcreate.c to vgtest.c to reduce filename conflicts in tree.
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-07-21 10:46:45 +00:00
Dave Wysochanski
2d5ba1f2d1 Fix compile warnings in vgcreate liblvm api unit test case.
Use const and PRIu64.

Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Thomas Woerner <twoerner@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-07-21 10:41:47 +00:00
Dave Wysochanski
867ff24616 Add liblvm test case for creating of a vg.
liblvm unit test case uses the following APIs:
- lvm_create, lvm_destroy
- lvm_vg_create, lvm_vg_extend, lvm_vg_set_extent_size, lvm_vg_write,
lvm_vg_remove, lvm_vg_close

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2009-07-14 03:08:56 +00:00
Alasdair Kergon
572fefeb90 Rename liblvm.so to liblvm2app.so and use configure --enable-applib. 2009-05-22 14:44:59 +00:00
Dave Wysochanski
4afec75e94 Use liblvm.so instead of .a 2009-04-28 19:08:25 +00:00
Dave Wysochanski
96bfa40b47 Add libdevmapper to test/api building. 2009-04-20 20:46:06 +00:00
Dave Wysochanski
4df86ce1ac Remove unnecessary linker flags for liblvm. 2009-03-08 17:29:26 +00:00
Dave Wysochanski
77986fa71a Add DSO generation for new LVM application library.
Fix test/api/test build.
2009-03-08 17:06:55 +00:00
Thomas Woerner
5f4b7a2644 Added files lib/lvm.h and lib/lvm_base.c:
New structure lvm (used as an alias to cmd_context), new type definition lvm_t
for the lvm handle. Added functions lvm_create, lvm_destroy and
lvm_reload_config using the new handle.

Modified test/api/test.c:
Use new lvm.h header file and lvm_t handle.

Removed lib/lvm2.h


Author: Thomas Woerner <twoerner@redhat.com>
2009-02-24 13:03:45 +00:00
Dave Wysochanski
c7e363f98a Add liblvm interactive test infrastructure to build. 2008-12-07 19:37:07 +00:00