1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

1801 Commits

Author SHA1 Message Date
Zdenek Kabelac
6336b5dedf tests: reduce amount of pvcreates
Reduce number of evualted pvcreate commands.
Since 0 is default value used to fill missing params,
and 0 is also 1st. value in array, it's being tested.

Drop unused data_alignment_offset.
2016-07-11 15:29:28 +02:00
Zdenek Kabelac
8756297a8d tests: increase max lines for clvmd
Clvmd is a bit more verbose long time running process so
let it live with more logged lines.

Also fix typo in warn message from last commit.
2016-07-11 14:45:25 +02:00
Zdenek Kabelac
34c55d98ee tests: add LVM_LOG_FILE_MAX_LINES
When logging to epoch files we would like to prevent creating too large
log files otherwise a spining command could fulfill available space
very easily and quickly.

Limit for to 100000 per command.
2016-07-11 12:43:28 +02:00
Zdenek Kabelac
e5d1f3d6c5 tests: using mkfs config file
Use more predictable local config when creating ext4.
2016-07-04 17:41:10 +02:00
Zdenek Kabelac
2063d6bb06 tests: add line for mixing dmeventd with log
TODO: it might be better to log dmeventd messages with test output
just like we do with clvmd - maybe we will switch to this one
instead of extra  DMEVENTD log file in future....
2016-07-04 17:41:09 +02:00
Zdenek Kabelac
b91390c211 tests: add mke2fs.conf
Add config for mkfs to get more predicatable results
when using mkfs across variety of distributions.

In future maybe use this per all tests as default.
For now user has to specify in a test MKE2FS_CONFIG envvar to use it.
2016-07-04 17:40:25 +02:00
Zdenek Kabelac
2981d1e798 tests: try to force remove higher minor first
When force removing thin-pool we loose 'real' access to hidden device,
and if such pool is in suspended state, any thin volume cannot be
dropped. It likely should be also checked by dmsetup, but meanwhile
apply simple logic -  try to force remove first all higher minors first
with assumption we first create thin-pool and then thin volume
and there are usually not being released lower dm numbers to
get the order wrong.
2016-07-04 17:40:24 +02:00
Zdenek Kabelac
b0d8a524a2 tests: test foreign users of thin-pool
Note: dmeventd should not need any notification and automatically
try to resize again when there is some metadata change.
2016-07-01 00:44:49 +02:00
Zdenek Kabelac
458918b319 thin: fix link validation for unused thin-pool
This patch fixes link validation for used thin-pool.
Udev rules correctly creates symlinks only for unused new thin-pool.
Such thin-pool can be used by foreing apps (like Docker) thus
has  /dev/vg/lv link.
However when thin-pool becomes used by thinLV - this link is no
longer exposed to user - but internal verfication missed this
and caused messages like this to be printed upon 'vgchange -ay':

The link /dev/vg/pool should have been created by udev but it was not
found. Falling back to direct link creation.

And same with 'vgchange -an':
The link /dev/vg/pool should have been removed by udev but it is still
present. Falling back to direct link removal.

This patch ensures only unused thin-pool has this link.
2016-07-01 00:44:46 +02:00
David Teigland
2282f53ac7 lvconvert: rework routing of operations
Add new logic to identify each unique operation and route
it to the correct function to perform it.  The functions
that perform the conversions remain unchanged.

This new code checks every allowed combination of LV type
and requested operation, and for each valid combination
calls the function that performs that conversion.

The first stage of option validation which checks for
incompatible combinations of command line options, is done
done before process_each is called.  This is unchanged.
(This new code will allow that first stage validation to
be simplified in a future commit.)

The second stage of checking options against the specific
LV type is done by this new code.  For each valid combination
of operation + LV type, the new code calls an existing
function that implements it.

With this in place, the ad hoc checks for valid combinations
of LV types and operations can be removed from the existing
code in a future commit.

(The #if 0 is used to keep the patch clean, and the
disabled code will be removed by a following patch.)
2016-06-29 16:55:27 -05:00
Tony Asleson
6f216692b4 lvmdbustest: Comment out refresh check for LV create
When we test Vg.LvCreateRaid some of the hidden LVs volume type go from
'I' to 'i' between the time it takes us to create the LV and
the time it takes to call into refresh to verify the service is up to date.
This is a fairly rare occurance.
2016-06-28 13:36:32 -05:00
Zdenek Kabelac
5070e7fcf7 tests: update test for modified output
We now print  vg/lv  for lv resized volume
2016-06-24 00:39:15 +02:00
Zdenek Kabelac
fc174f6b74 tests: smaller number of devs created to fill metadata 2016-06-24 00:39:14 +02:00
Zdenek Kabelac
a67a5d4655 tests: aux prepare_thin_metadata 2016-06-23 14:59:29 +02:00
David Teigland
ebd2758dab vgimportclone: add native command
This is cleaner and more efficient than the script.
The args and usage are unchanged.
2016-06-22 13:13:10 -05:00
Tony Asleson
2d384954ad lvmdbusd: Remove duplicate test code 2016-06-10 16:05:03 -05:00
Tony Asleson
a1febff857 lvmdbusd: Add test for DataLv & MetaDataLv
Added tests which expose an issue found with these properties.
2016-06-10 16:05:03 -05:00
Zdenek Kabelac
a5d65b4a51 tests: check losetup -P is correctly handled
Validate pvcreate will not overwrite partitioned loop device.
2016-06-01 17:37:52 +02:00
Zdenek Kabelac
d73a83e8cf tests: extend prepare_loop
Treat args after size  as 'extra' params for losetup.
2016-06-01 17:37:52 +02:00
Peter Rajnoha
cfe7d2368c tests: add dmstats to CLEAN_TARGETS for make clean 2016-05-31 09:14:23 +02:00
Zdenek Kabelac
7d4d0ff606 tests: check thin is not flushed for status
We finally approach a moment where we generally avoid
flushing thin-pool with every lvs command...
2016-05-27 17:25:52 +02:00
Zdenek Kabelac
43dfc2011c tests: stacked snapshot merge 2016-05-27 15:47:24 +02:00
Zdenek Kabelac
a67adbfe2e tests: check cache_mode change on cachepool 2016-05-27 15:47:24 +02:00
David Teigland
757f7d5508 test: lvmetad-disabled 2016-05-23 12:01:11 -05:00
David Teigland
3d3efd7ab8 test: lvmetad-pvscan-filter
update for pvscan changes
2016-05-23 12:00:25 -05:00
David Teigland
9b640c3684 pvscan: use process_each_vg for autoactivate
This refactors the code for autoactivation.  Previously,
as each PV was found, it would be sent to lvmetad, and
the VG would be autoactivated using a non-standard VG
processing function (the "activation_handler") called via
a function pointer from within the lvmetad notification path.

Now, any scanning that the command needs to do (scanning
only the named device args, or scanning all devices when
there are no args), is done first, before any activation
is attempted.  During the scans, the VG names are saved.
After scanning is complete, process_each_vg is used to do
autoactivation of the saved VG names.  This makes pvscan
activation much more similar to activation done with
vgchange or lvchange.

The separate autoactivate phase also means that if lvmetad
is disabled (either before or during the scan), the command
can continue with the activation step by simply not using
lvmetad and reverting to disk scanning to do the
activation.
2016-05-23 11:57:32 -05:00
Zdenek Kabelac
6247364caf tests: test change of cache mode 2016-05-19 18:40:14 +02:00
Zdenek Kabelac
197066c863 lvchange: allow change of cache mode
Add support for active cache LV.
Handle --cachemode args validation during command line processing.
Rework some lvm2 internal to use lvm2 defined  CACHE_MODE  enums
indepently on libdm defines and use enum around the code instead
of passing and comparing strings.
2016-05-19 18:40:14 +02:00
David Teigland
f3d508630d test: process-each-duplicate-pvs
skip on RHEL5 where DEV_USED_FOR_LV doesn't work
because it depends on a newer bit of sysfs.
2016-05-11 09:35:42 -05:00
David Teigland
fa130722cb test: vgcfgbackup-lvm1
The lvm1 part of vgcfgbackup-usage.
2016-05-06 09:00:00 -05:00
David Teigland
f194d5f169 test: vgcfgbackup-usage
Split the lvm1 part into a separate test.
2016-05-06 09:00:00 -05:00
David Teigland
4c5ad5a04c test: vgsplit-usage
Restart clvmd between testing each mdatype to
avoid a problem with dev state being kept from
one test to the next.
2016-05-06 09:00:00 -05:00
David Teigland
29a8012724 test: lvmetad-ambiguous
update for duplicate changes
2016-05-06 09:00:00 -05:00
David Teigland
d4d1d5ac3e test: pv-duplicate-uuid
update for duplicate changes
2016-05-06 09:00:00 -05:00
David Teigland
708eca39ea test: process-each-duplicate-pvs
Update for new duplicate processing.
2016-05-06 09:00:00 -05:00
Zdenek Kabelac
08aeea6a12 tests: do not use EPOCH for get wrapper
Avoid poluting filesystem with debug.log_DEBUG for get wrapper
2016-05-05 23:55:20 +02:00
Zdenek Kabelac
07c1694ff5 tests: update aux raid support
For raid1  use chunksize as bitmap-chunk specification.
Always enforce usage of bitmap - getting comparable outcome
as lvm2 raid support uses.
Add udev_wait after stopping  md array - as in fact leg-device
are still in use by target even command has finished.

(mdadm --stop causes WATCH rule wakeup, and
ioctl(STOP_ARRAY) returns IMHO to early - it should finish
and fsync work on leg devices first).
2016-05-05 23:55:20 +02:00
Zdenek Kabelac
7bb39af036 tests: check default policy is used when unspecified
If the policy is not given with policy settings we assume
the default one is going to be used - it's users responsibility
to pair them properly.
2016-05-05 23:55:20 +02:00
Zdenek Kabelac
95f0e25601 tests: check for thin tools
Test needs repair utils to be available.
2016-05-05 23:55:20 +02:00
Zdenek Kabelac
31b11d0228 tests: drop cluster testing with pvmove
Unwanteadly enabled in previous check-in.
2016-04-22 14:15:36 +02:00
Zdenek Kabelac
2dc6b97856 tests: make test independent on usage [] for hidden LVs 2016-04-22 12:53:09 +02:00
Zdenek Kabelac
69c2f56005 tests: keep using [] for hidden volumes
Figure out which test needs to see hidden volumes without [].
But normally use [] for debug printing in tests.
It's confusing otherwise.
2016-04-22 01:14:56 +02:00
Zdenek Kabelac
11dd362454 tests: GLIBC decided to obsolete readdir_r
Keep the code compilatible without warnings on newer glibc.
2016-04-21 17:48:19 +02:00
Zdenek Kabelac
7ce486e881 tests: minor update 2016-04-21 00:34:01 +02:00
Zdenek Kabelac
545b58542c tests: still show systems stas when command has not produced debug.log file
When no debug.log* file is present whole stacktracking was skipped.
Add extra test the file exists to catch this case.
2016-04-21 00:34:01 +02:00
Zdenek Kabelac
22a71e1119 tests: document make parametr for tracing aux scripts 2016-04-21 00:34:01 +02:00
David Teigland
9553260673 test: lvmetad-override
Fix test case where a warning appears when it's not expected.
2016-04-19 14:26:05 -05:00
David Teigland
fa904a844f test: lvmetad-warning
The test was a weak attempt at verifying the special
combination of lvchange/vgchange -aay --sysinit, but
was only looking for lvmetad connection warnings.

Update the warning checks, and check the LV activation
state directly which is the main point.

Rename the test to reflect its purpose of checking
the -aay --sysinit combination.
2016-04-19 11:45:24 -05:00
David Teigland
6b1c0a4190 test: lvmetad-override 2016-04-19 11:45:24 -05:00
David Teigland
c5cd5b4b69 test: lvmetad-no-cluster
Update warning message check
2016-04-19 11:45:24 -05:00
David Teigland
a5722ed7e7 test: update lvmetad-disabled
Update the check about lvmetad running but not used.

Also add tests related to the new lvmetad disabled state.
lvm1 metadata is used here to test the disabled state
because lvm1 metadata is the first condition using the
disabled state.
2016-04-19 11:45:24 -05:00
David Teigland
c9cf85f606 test: update lvm1 test
Make it a generic lvm1 test, which should work
with or without lvmetad now that lvmetad is just
disabled when lvm1 is used.
2016-04-19 11:45:19 -05:00
Zdenek Kabelac
50633039bf tests: use should for failing test
It's better to use 'should' for failing test before it gets fixed,
when we ignore failing result.
2016-04-18 23:12:05 +02:00
Zdenek Kabelac
59b0bd7b64 tests: use bigger raid size
To avoid problem with report of array in-sync use for now bigger
raid size 64M.
2016-04-18 23:09:17 +02:00
David Teigland
662090e358 tests: fix check_lvmlockd_test 2016-04-15 12:35:20 -05:00
David Teigland
9a299d2d7a tests: lvmetad-lvm1 fix
workaround this test failure until the proper
lvmetad/lvm1 fixes arrive shortly.
2016-04-13 15:07:53 -05:00
Marian Csontos
e6768997e1 test: Fix testing of installed lvmdbusd
If lvmdbusd is missing expression triggers ERR trap instead of skipping
the test.
2016-04-08 16:26:25 +02:00
Zdenek Kabelac
248f47d489 tests: require newer cache target
Older cache target is likely not updating status at all...
2016-04-08 00:04:26 +02:00
Zdenek Kabelac
9ab53dddf5 tests: use mkfs.ext3
mkfs.ext4 is not really needed so use more widespread mkfs.ext3
so test runs on older system.
2016-04-07 22:32:09 +02:00
Zdenek Kabelac
307ab2c179 tests: do not break teardown on failing losetup
Ignore failing 'losetup -d' - i.e. device may have disappeared...
2016-04-06 11:54:37 +02:00
Zdenek Kabelac
07c25429e2 tests: verify repair of failing mirror
Improved test script to verify lost mirror image does not
cause mirror corruption while mirror is in use.

TODO: add more cases (lost mlog...), lost image from 3leg mirror...
2016-04-06 11:54:36 +02:00
Zdenek Kabelac
c577984630 tests: fixed cache target reacts faster
After kernel fixed in 4.6 cache target reacts promptly
and switches to Fail-ed state when disk error is detected.

Handle both cases in test...
2016-03-31 12:21:40 +02:00
Zdenek Kabelac
bc5376b151 tests: do not test settings when MQ is emulated by SMQ 2016-03-31 12:21:40 +02:00
Peter Rajnoha
fe7ae37f5e tests: vg-check-devs-used requires driver version 4.15 at least 2016-03-31 10:38:05 +02:00
Marian Csontos
bc0372cf9d test: Add missing directory
Fix commit bb93a28bc1
2016-03-29 08:24:52 +02:00
Marian Csontos
82d92009ae test: Move bus configuration to prepare function 2016-03-23 12:27:34 +01:00
Marian Csontos
1b0775916b test: Remove pidfile after killing the process
Though unlikely keeping files in place may result in random process
killed.
2016-03-23 12:25:18 +01:00
Marian Csontos
bb93a28bc1 test: Fix lvmdbusd tests to work with installed testsuite 2016-03-23 11:59:04 +01:00
Marian Csontos
c1d376b1ab test: Fix checks to skip lvmdbusd tests
The executable is always present in the tree, need to check the
runtime dependencies.
2016-03-23 11:58:48 +01:00
Peter Rajnoha
3d26d283ea tests: update vg-check-devs-used.sh
Snapshot needs to be activated exclusively in cluster...
2016-03-22 11:18:22 +01:00
Peter Rajnoha
6a915270fc tests: update vg-check-devs-used.sh 2016-03-22 11:13:28 +01:00
Peter Rajnoha
cc57cd39ab tests: add vg-check-devs-used.sh 2016-03-21 16:21:30 +01:00
Marian Csontos
ca7bac53cf test: Turn on dbus test
(cherry picked from commit f1ea96c6c1dc6414169bda1a18cf14cd9ebb1493)
2016-03-21 15:22:58 +01:00
Zdenek Kabelac
464ebe04db tests: stacked resize of thin on raid 2016-03-15 23:22:52 +01:00
Zdenek Kabelac
746f8af2a8 tests: update lvconvert test 2016-03-14 23:46:08 +01:00
Zdenek Kabelac
0d5b9deff2 tests: use own PID path for lvmetad checking
Do not try to check PID of running lvmetad and use own path.
2016-03-14 23:45:45 +01:00
Zdenek Kabelac
5bfc0edd12 tests: uncache with missing PV
For now repair of cache with missing PVs via usage of --uncache.
More will follow later.
2016-03-10 18:38:54 +01:00
Marian Csontos
18291fd016 test: Remove work-in-progress code from dbustest
(cherry picked from commit 3189d4d50492f5b78cf3920a7f499fd1020983c6)
2016-03-09 14:04:28 +01:00
Ondrej Kozina
55d1105fc9 test: skip unrelated tests while testing lvmpolld 2016-03-09 12:59:45 +01:00
Ondrej Kozina
5434e9f5ea test: fix inverted condition 2016-03-09 12:59:42 +01:00
Marian Csontos
e655ccb418 test: Add prepare_lvmdbusd
- Check for running lvmdbusd at start
- Add teardown for lvmdbusd
2016-03-09 10:58:21 +01:00
Marian Csontos
cb968ee875 test: Comment out incorrect lockd setup 2016-03-09 10:58:21 +01:00
Marian Csontos
c6e1845f76 test: Move udev-lvmlockd-test to check_system 2016-03-09 10:58:21 +01:00
Marian Csontos
2cf13b701a test: Update kernels to skip thin-flags with
See ed5e5c38b5
2016-03-09 10:09:29 +01:00
Marian Csontos
f94fe2c91f dbustest.sh: Get dbus test to work on buildbot
- stdout/stderr for test output
- debug.log* for daemon output
- use install instead of cp for DBus config
- use system bus
- DBus reloads on new file. Better having it created with correct
  permissions.

Notes:
- Squashed commits from mcsontos development branch
- Still disabled at this time

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2016-03-04 10:11:03 -06:00
David Teigland
ad9cbe2714 tests: direct control of lvm1 usage in tests
Using lvm1 metadata with lvmetad is not generally allowed,
but nothing has prevented creating new lvm1 metadata with
lvmetad (missing error checking in pvcreate/vgcreate.)
Various tests are using lvm1 with lvmetad and happen to
work because of the missing error checks.

This commit fixes the tests so they won't fail when the
lvm1/lvmetad error checking is fixed.  A new variable
LVM_TEST_LVM1 is defined and is used in the scripts to
decide if lvm1 metadata should be tested.  LVM_TEST_LVM1
is not defined when lvmetad is being tested, and the
combination of LVM_TEST_LVM1 and LVM_TEST_LVMETAD can
be used to verify the desired lvmetad+lvm1 behavior.
2016-03-03 14:43:19 -06:00
Peter Rajnoha
9a78c258ba tests: add lv-ancestry.sh test 2016-03-03 13:50:59 +01:00
Peter Rajnoha
45c82260db tests: add "get lvh_field" for "lvs -H" 2016-03-03 13:50:59 +01:00
Zdenek Kabelac
5e718ec666 tests: drop check for md5sum 2016-03-03 10:17:03 +01:00
Zdenek Kabelac
49839b6d96 tests: check kernel_cache_ funcs 2016-03-03 10:17:03 +01:00
Zdenek Kabelac
058eb3739d makefile: handle dm-version-expected 2016-03-01 16:03:02 +01:00
David Teigland
e3b904fd08 tests: check [unknown] in lvmetad-pvscan-cache
Update test for new [unknown] VG name from
commit 250b9153.
2016-02-29 12:43:07 -06:00
Alasdair G Kergon
9898126596 report: Shift (u)sed pv_attr under (a)llocatable.
Showing 'u' in the pv_attr reporting field is mostly unnecessary because
most PVs are allocatable, and being allocatable implies it is (u)sed,
and this is already obvious from other fields in the default 'pvs'
output like the VG name.

So move the new (u)sed pv_attr from character position 4 to 1, and only
show it in those rare cases when the PV is not (a)llocatable or the
relevant metadata is missing.

(Scripts should not be using pv_attr, but rather pv_allocatable,
pv_exported, pv_missing, pv_in_use etc.)
2016-02-26 15:46:37 +00:00
Zdenek Kabelac
183bd8ca03 tests: skip on older version
Skip with older driver version.
Update address.
2016-02-26 10:21:36 +01:00
Tony Asleson
26b826ccf5 lvmdbusd testing: Add validatestate.py utility
This simple tool calls the Manager.Refresh method on the dbus service
to check and see if the dbus service has the most up to date state.
This is to be used for testing to ensure that event driven updates are
working as planned.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2016-02-25 16:43:55 -06:00
Tony Asleson
0d620e681f lvmdbustest.py: Move helper code to testlib.py
This will allow us to re-use in other client programs for testing.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2016-02-25 16:43:55 -06:00
Zdenek Kabelac
23a4801dbc tests: lvresize with zero arg 2016-02-25 23:30:26 +01:00
David Teigland
172bad0d56 Use a common message for a used PV
Change some inconsistent messages and adopt
the new wording "PV %s is used by" in place
of "PV %s is marked as belonging to"
or "PV %s belongs to".
2016-02-25 14:23:41 -06:00
Bryn M. Reeves
79f2596215 tests: add simple dmstats report tests
Add tests for the "dmstats report" command:

  * report
  * report --count
  * report --histogram

So far the tests just check the command runs as expected when a
correctly configured stats region exists: validation of output
can be added later.
2016-02-25 16:40:59 +00:00
Bryn M. Reeves
3d3b132d9a tests: add dmstats create tests
Add tests for the "dmstats create" command:

  * simple whole-device region
  * region using --start/--len options
  * region using --segments option
  * region with precise timestamps (--precise)
  * region with histogram bounds (--bounds)
2016-02-25 16:40:59 +00:00