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

540 Commits

Author SHA1 Message Date
Zdenek Kabelac
b38564b8dc tests: do not set zero interval in aux lvm.conf
0 interval leads as of now to a busy loop with lvmetad and command.

Avoid testing this patological case.

TODO: Code should possibly translate zero interval into some small
sleep. With lvmpolld it's already 1/10s
2016-11-11 16:58:20 +01:00
Heinz Mauelshagen
a9651adc84 test: add raid4 checks to respective tests
Add missing checks for valid raid4 mapping to tests.
2016-10-28 21:54:10 +02:00
Zdenek Kabelac
fe437a6e7d tests: notify dbus only for dbus test 2016-10-11 13:37:44 +02:00
Zdenek Kabelac
78e0fdb618 tests: correcting kernel version test
Debug force leaked in.
2016-09-20 22:50:43 +02:00
Zdenek Kabelac
994df22b60 tests: read messages instead of syslog
Since on those older system there is rather 'fight' over
syslog reading buffer - lets read output from /var/log/messages
intead.
2016-09-20 22:36:29 +02:00
Zdenek Kabelac
a9c2a62939 tests: kernel message for <3.5 kernels
Since /dev/kmsg is useless on kernel <3.5 user there automatically
syslog to obtain traces from kernel log buffer during test.
2016-09-20 17:09:46 +02:00
Zdenek Kabelac
561f773bb4 tests: add check grep_dmsetup
Add simple helper/wrapper check function to check result
of dmsetup call i.e.:

check grep_dmsetup table vg-lv  "grep_expected"
check grep_dmsetup status vg-lv -v "grep_unexpected"
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
629059ee84 tests: Revert "tests: not redirect strderr to stdout"
This reverts commit 5314d36f3d.

Ok - some tests do look for 'stderr' output of 'not' commands.
So let's keep existing functionality.
2016-09-13 13:23:47 +02:00
Zdenek Kabelac
d34e315b8d tests: use just single raid_leg_status
Simplify 'check' test actualy and correct printed tracing output
2016-09-13 12:25:36 +02:00
Zdenek Kabelac
5314d36f3d tests: not redirect strderr to stdout
Errors are 'wanted' and expected in this case.
2016-09-13 12:25:06 +02:00
Zdenek Kabelac
5b55f9616d tests: add check function for raid leg status
2 new check test functions:

raid_leg_status    - to just compare
raid_leg_status_is - to compare and die when different
2016-09-12 16:51:53 +02:00
Tony Asleson
756f51eac8 test/lib/aux.sh: Remove incorrect comment
The dbus service needs to use the system bus.  The test environment does
not allow work with session bus environment.
2016-08-29 15:26:56 -05:00
Tony Asleson
7c386bf4d4 test/lib/aux.sh: Remove '--udev' for lvmdbusd start
The service will start up with udev monitoring and disable it if lvm
starts calling ExternalEvent.
2016-08-29 15:26:56 -05:00
Heinz Mauelshagen
d2c3b23e6d lvchange: Allow device specification when requesting a repair
'lvchange --resync LV' or 'lvchange --syncaction repair LV' request the
RAID layout specific parity blocks in raid4/5/6 to be recreated or the
mirrored blocks to be copied again from the master leg/copy for raid1/10,
thus not allowing a rebuild of a particular PV.

Introduce repeatable option '--[raid]rebuild PV' to allow to request
rebuilds of specific PVs in a RaidLV which are known to contain corrupt
data (e.g. rebuild a raid1 master leg).

Add test lvchange-rebuild-raid.sh to test/shell doing rebuild
variations on raid1/10 and 5; add aux function check_status_chars
to support the new test.

 - Resolves rhbz1064592
2016-08-05 16:01:46 +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
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
a67a5d4655 tests: aux prepare_thin_metadata 2016-06-23 14:59:29 +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
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
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
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
David Teigland
662090e358 tests: fix check_lvmlockd_test 2016-04-15 12:35:20 -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
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
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
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
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
2cf13b701a test: Update kernels to skip thin-flags with
See ed5e5c38b5
2016-03-09 10:09:29 +01: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
45c82260db tests: add "get lvh_field" for "lvs -H" 2016-03-03 13:50:59 +01:00
Bryn M. Reeves
3dae416229 tests: add driver_at_least() to aux.sh
Add a function to test whether the running device-mapper driver
version is at least equal to some given version.
2016-02-25 16:40:58 +00:00
David Teigland
0236a34224 tests: updates for check_lvmlockd
Move the lvmlockd-related setup functions into aux.

For check_lvmlockd_test, start a new instance of
lvmlockd --test for each shell test.
2016-02-23 14:00:28 -06:00
David Teigland
f54253d396 tests: add SKIP_WITH_LVMLOCKD
to all tests that don't already used vgcreate $SHARED
2016-02-23 09:28:48 -06:00
David Teigland
161ae36363 test: add make check_lvmlockd_test
Which runs lvmlockd in --test mode, without
any lock manager.

Also make some adjustments to the check_lvmlockd
variations using the lock managds.
2016-02-22 09:36:35 -06:00
Zdenek Kabelac
ed5e5c38b5 tests: skip thin-flags test on 32bit el6 kernel
Until kernel is fixed, stop running test always hitting OOPS there.
2016-02-22 14:59:28 +01:00
Zdenek Kabelac
fcbef05aae doc: change fsf address
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Peter Rajnoha
04d1a8a5e4 cleanup: rename 'invisible devices' to 'hidden devices' 2016-01-13 16:43:25 +01:00
Peter Rajnoha
c66a83fdc3 tests: update tests to deal with invisible devices consistently 2016-01-13 13:55:24 +01:00
Zdenek Kabelac
8d86c5db03 tests: improve teardown
Do not try to execute vgremove, when test has left suspended devices.
2015-11-24 11:29:28 +01:00
Marian Csontos
6f002c29a5 tests: stacktrace on skip if message is empty 2015-11-19 12:18:33 +01:00
Marian Csontos
2a23550cf3 tests: add missing --skip option and S env.variable 2015-11-19 12:00:59 +01:00
Zdenek Kabelac
ab4773671b tests: do not skip test when delay is missing
Rather then skipping whole test - just do not use it.

Failing tests that have required delay need to deal with reality
and shell either check for HAVE_DM_DELAY and skip portion
of test or using should when needed.
2015-11-09 12:21:17 +01:00
Zdenek Kabelac
6e1e0e8813 tests: using matching type
Compare time_t.
2015-10-27 16:00:10 +01:00
Zdenek Kabelac
76cff10a73 tests: avoid reading utils when skipping
Save even more CPU/time and avoid reading utils, when skipping test.
2015-10-27 16:00:09 +01:00
Zdenek Kabelac
a2dd1f6e19 tests: support skip flags 2015-10-26 23:57:47 +01:00
Zdenek Kabelac
c301cc5d38 tests: extend timer for 4 hours
Extend max time for test suite to 4 hours.
Also replace some 'non-ascii' chars from source files
and keep them plain ascii.
2015-10-26 23:57:47 +01:00
Zdenek Kabelac
2786cd27da tests: enable raid test on 4.3
With kernel -rc6 it's passing our raid tests again - so enable
it in tests.

Note: related only to Fedora rawhide kernels...
2015-10-22 22:46:10 +02:00
Zdenek Kabelac
c4cc5eabfe tests: start logging dmeventd output
Log dmeventd output from test - keep output logging in test
and avoid sending messages to syslog.
2015-10-13 16:02:21 +02:00
Zdenek Kabelac
8cc21354c2 tests: better regex check
Enhance check for matching prefix.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
2cb1f6eafe tests: show status in in_sync
Make visible actual status line when returing 'raid' is in sync.
Useful to prove when kernel is wrong.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
277dd0aa7a tests: check devices with prefix aren't in use
Avoid running tests, when prefix already exist in the system.
As prefix just uses  PID number, we may hit a case for long
running tests, where devices from some previous runs were not
properly cleared away - detect this and fail early.
(Such machine should be inspected and fixed).
2015-10-06 15:23:55 +02:00
Marian Csontos
efcb3bbc8d test: Fix timeout handling
Timeouts were considered as warnings only. Signalling failure is
preferred.
2015-10-01 13:19:29 +02:00
Zdenek Kabelac
7e63364529 tests: check for block device
Need to detect if block device exist.
2015-09-22 00:08:44 +02:00
Zdenek Kabelac
9b8c876293 tests: remove only existing loops
If loop device meanwhile dissapered, skip 'losetup -d' call.
2015-09-10 17:28:47 +02:00
Zdenek Kabelac
e94ab01940 tests: fix check lv_not_exist
Use 'not' to set proper 'expected return status'
so we do not 'leak' debug logs printed for failing case.
2015-09-10 17:28:47 +02:00
Zdenek Kabelac
596ec5c74b tests: skip raid testing on 4.[1,2] fc24 kernels
Hopefull 4.3 will be fixed and test will be updated to let
raid test running again.

Meanwhile using md-raid may effectively kill kernel,
so leave at least other tests running.
2015-09-08 12:12:38 +02:00
David Teigland
e53758c5f6 tests: add lib function to test hidden LVs with lvs -a 2015-08-21 15:09:38 -05:00
Marian Csontos
b785a50da4 test: Help, default and relative paths in runner
Add help message.
Handle relative paths first.
Use `.` for OUTDIR instead of `/` if empty.
2015-07-17 20:36:50 +02:00
Marian Csontos
2bc0525e93 test: Fix hardcoded /usr/share in testsuite 2015-07-17 20:36:50 +02:00
Marian Csontos
47ac6a1a2e test: Fix syntax error in prepare_devs 2015-07-10 16:15:15 +02:00
David Teigland
fe70b03de2 Add lvmlockd 2015-07-02 15:42:26 -05:00
Zdenek Kabelac
9c86d33e68 cleanup: avoid printing gcc warning
Casting to (void) with gcc doesn't remove unused_result warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
2015-06-23 11:06:02 +02:00
Zdenek Kabelac
778b66a719 tests: check for idle only for raid type 2015-05-27 11:59:10 +02:00
Zdenek Kabelac
d3abc25e76 tests: check for clmvd socket
A bit hacky since it expects PID_DIR == DEFAULT_RUN_DIR for now,
just to check whether it fixes startup clvmd sync problem.
2015-05-27 11:10:43 +02:00
Zdenek Kabelac
f0a4955eb1 tests: better check for array in sync
Update check for raid array being in sync - getting somewhat complex.
It's another way to fight with problems in:
https://bugzilla.redhat.com/show_bug.cgi?id=1210637
2015-05-27 11:10:43 +02:00
Zdenek Kabelac
c254743ef3 tests: drop debug print 2015-05-27 11:10:43 +02:00
Ondrej Kozina
f5199a1cbd tests: remove forgotten set -v in aux 2015-05-11 19:08:19 +02:00
Zdenek Kabelac
3eb2d4d2ce tests: typo in aux
Ooops editor grabbed q in test.
2015-05-11 16:14:24 +02:00
Zdenek Kabelac
fabc19b73c tests: disable lvmetad and lvmpolld
Since now we enable those by default when compiled with those daemons,
explicitely disable them in tests when needed.

Alphabetically sort configurables.
2015-05-11 15:53:21 +02:00
Zdenek Kabelac
abcab54cca tests: avoid clobering dmesg
Restore old harness access to /dev/kmsg.
2015-05-09 09:17:26 +02:00
Ondrej Kozina
e587b0677b lvmpolld: Add standalone polldaemon.
See doc/lvmpolld_overview.txt
2015-05-09 00:59:18 +01:00
Zdenek Kabelac
53aff9322e tests: better filter
Filter $PREFIX rather then just LVMTEST.
2015-05-08 21:00:10 +02:00
Zdenek Kabelac
7a5a4f952e tests: play better with mdadm
Manage mdadm devices on older distros is a challange.
2015-05-04 13:11:41 +02:00
Zdenek Kabelac
3f05e662bb tests: validate passed LVM_TEST_DEVDIR
Quit test early if passed LVM_TEST_DEVDIR dir does not exists.
2015-05-04 10:15:56 +02:00
Zdenek Kabelac
b09ac72624 tests: wait for scsi device to appear
Continue with test as soon as device appear (avoid 2s delay)
2015-05-04 10:14:52 +02:00
Zdenek Kabelac
abdfb1e75b tests: configure use_lvmetad when needed 2015-05-01 22:49:38 +02:00
Zdenek Kabelac
9c7063ef89 tests: free -h is quite new option
Stay with -g and and ignore failure.
2015-05-01 15:40:04 +02:00
Zdenek Kabelac
79844b9066 tests: minor simplifications
minor updates
2015-05-01 15:07:59 +02:00
Zdenek Kabelac
fee09f0964 tests: disable usage of fuser
Seems we captured problems with debug.log overwrite,
so avoid quite expensive usage of fuser tool with each lvm command.
2015-05-01 15:07:59 +02:00
Zdenek Kabelac
4ce5b5fdf3 tests: run api tests from startup dir 2015-05-01 15:07:59 +02:00
Zdenek Kabelac
a3473e60db tests: no lvmetad reload for debugless output
Introduce LVM_TEST_LVMETAD_DEBUG_OPTS to allow to override
default debug opts for lvmetad.

However could be still overloaded on command line:

make check_lvmetad LVM_TEST_LVMETAD_DEBUG_OPTS="-l all"...
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
dd4e6b4e7e tests: lower version of dm-delay
Let's see what will break with lower version 1.1.

Also avoid repeated check of target version.
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
16e8006eb0 tests: rename kill_tagged_processes
Better name for aux function.
First use normal -TERM, and only after a while use -KILL
(leaving some time to correctly finish)
Print INFO about killed processes.
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
c18e969e30 tests: move conf preparing
If the test in the middle is restarting lvmetad
avoid conf regenerating.
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
0eea780bce tests: hide error message
Hide error about missing declare -A  support.
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
4daede06e5 tests: move kernel_at_least to aux
Hide func processing and reuse existing
version_at_least().
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
f48a4c391c tests: watch out for RAM size
Reduce mem-requirements on low memory boxes,
activate less volumes if machine is below 0.5G.

Also print mem size at test header.
2015-05-01 15:07:58 +02:00
Zdenek Kabelac
3706abde5e tests: lvmconf update
New lvmconf function is using bash associative arrays - however
older systems like RHEL5 doesn't provide this feature. In this case
stay with older variant.

Restore support for use case like this:
aux lvmconf 'tags/@foo {}'
2015-04-30 11:16:14 +02:00
Zdenek Kabelac
244ca7ee77 tests: minimize teardown when uneeded
If test has not yet initilized any device,
make teardown a bit faster.
2015-04-29 15:09:58 +02:00
Zdenek Kabelac
c5b4327f3d tests: bash-fu for lvmconf
Sqeeze about 0.1s out of every created conf and use internal
bash associative arrays instead of lot of command forking
2015-04-29 15:09:58 +02:00
Ondrej Kozina
8c9ab2a4dd tests: simplify removal of dangling bg procs
some tests left dangling bg processes originating in
lvm2 commands being able to spawn any bg polling process
(lvchange, vgchange, pvmove, lvconvert...)

Initial fn 'add_to_kill_list' should collect processes with
specific parameters (proc's command line and parent processes ID).
After testing finishes the fn kill_listed_processes should remove these
listed by 'add_to_kill_list'.

Unfortunately it proved to be prone to an error especially in scenarios
where cmd line of initiating command contained characters required to
be espaced before passing to shell script to make it work correctly.
(Or if cmd spawned more than one bg process with same cmd line. i.e.:
vgchange or lvchange).

The new implementation is much simpler. It uses env. variable (LVM_TEST_TAG)
for marking a process desired to be killed later or during test env. teardown.
(i.e.: LVM_TEST_TAG=kill_me_$PREFIX to kill only processes related to
current test environment)
2015-04-28 22:31:40 +02:00
Zdenek Kabelac
3fbb7b6e35 tests: always zero disk header
It appear that older wipefs doesn't wipe partition table.
So ensure there is no partition on LVM_TEST_BACKING_DEVICE.
2015-04-28 11:32:52 +02:00
Zdenek Kabelac
1bb5b498f0 tests: more descriptive aux
Tell what's reason of aux fail here.
2015-04-28 11:23:16 +02:00
Zdenek Kabelac
1e3c135d71 tests: aux for mdadm
Implement aux helper fce for mdadm.
2015-04-25 00:40:02 +02:00
Zdenek Kabelac
f50229041b tests: allow add printable skip message 2015-04-25 00:40:02 +02:00
Zdenek Kabelac
a939857a63 tests: check sysfs more generically
Allow to access more files in device sysfs subtree.
2015-04-25 00:40:02 +02:00
Zdenek Kabelac
d7888e8316 tests: try more advanced clean
When test is executed on real device - lets try a more complete
cleanup - discard whole device first and try to wipe any
headers it might be left from previous test.
2015-04-25 00:39:43 +02:00
Zdenek Kabelac
4b161de2e5 tests: aux works better with installed_testsuite
When test suite is used from installed rpm package
we need to handle things better.

This patch is rather first approach - expecting few more
tweaks needed.
2015-04-22 11:18:31 +02:00
Zdenek Kabelac
7a64a157e1 tests: simplify teardown
If TESTNAME has not been created yet, avoid running complex teardown.
2015-04-22 11:18:31 +02:00
Zdenek Kabelac
3f8da60079 tests: notify drops log always
Even on success remove debug.log here.
2015-04-22 09:09:26 +02:00
Zdenek Kabelac
afdff40542 tests: explicitely ignore result code 2015-04-22 09:09:26 +02:00
Zdenek Kabelac
30e8b284a7 tests: allow to use sysfs filter
Current filtering logic in lvm2 needs some rework.
For now at least enable it in test suite.
2015-04-22 09:09:26 +02:00
Zdenek Kabelac
caa9223c85 tests: update to renamed envvars
Enhance 'not' so 'should' now shows log trace from
command which has failed but should not.
2015-04-20 19:18:56 +02:00
Zdenek Kabelac
85e833c172 tests: add extra keyword for timing control
Control logging of timer with
"## timing off"  and "## timing on"
2015-04-20 19:18:56 +02:00
Zdenek Kabelac
cf4df9e349 tests: use new debug logging feature
Enhance 'not' to manage autodeletion of log files in right cases.
Use separately marked epoch log files for clvmd and dmeventd.
Properly manage stack tracing for new debug.log names.
2015-04-20 12:12:22 +02:00
Zdenek Kabelac
43a6f9e726 tests: move print of replaced vars 2015-04-15 15:09:45 +02:00
Zdenek Kabelac
53c2c45625 tests: align test result in batch mode 2015-04-15 13:35:42 +02:00
Zdenek Kabelac
e478471dd5 tests: move stamp handling
Shift stamp handling into TimedBuffer,
so it's same everywhere.
2015-04-15 13:35:42 +02:00
Zdenek Kabelac
5d4695569d tests: hide error output
Hide error message if pid is already away.
2015-04-15 13:35:42 +02:00
Zdenek Kabelac
930f0aae84 tests: fix aux have test
Previous commit has made have_cache & have_thin producing
false return value.

Fix it and at the some time provide much better reconfiguring
warning message.

If the test machine is missing needed and configured binaries
it will produce TEST WARNING result.
2015-04-15 13:35:42 +02:00
Zdenek Kabelac
1a7dd13e70 tests: no tables for no devices
If dm table does't contain any PREFIX device, don't bother
to call other commands

No tracing if test is skipped.
2015-04-15 13:35:42 +02:00
Petr Rockai
7e58ae7dac test: Show all lvmetad messages (errors, warnings), not just debug+wire. 2015-04-14 20:18:27 +02:00
Zdenek Kabelac
d1a770107d tests: update pvmove tests
Put in pvmove background process into list quickly.
Update API for aux add_to_kill_list()/kill_listed_processes().
Run on 'background' (&) only non-background pvmoves.
2015-04-14 13:29:43 +02:00
Zdenek Kabelac
75454c2b32 tests: rusage skipped only for skipped 2015-04-14 13:29:43 +02:00
Zdenek Kabelac
a084b3122f tests: integrate default thin/cache tool paths
If the system is correctly configure (cache & thin tools are present)
avoid 'extra' rebuild of configuration.

On the other hand - if some tool is missing - duplicate ##LVMCONF should
make it more straighforward to see.
2015-04-14 10:11:36 +02:00
Zdenek Kabelac
c6bcfcba85 tests: stacktrace understands fullpath
$0 as name of script could be either relative or full path.
When it's fullpath don't prepend $TESTOLDPWD.
2015-04-14 10:11:36 +02:00
Zdenek Kabelac
c969e05aab tests: avoid dup of lvm.conf
When running lvmetad test - avoid duplicate create of lvm.conf
Also as lvmetad cannot be used with cluster make it as 2 code paths.
2015-04-14 10:11:35 +02:00
Ondrej Kozina
96124c6c0b tests: [new] check pvmove resume works as expected
various methods of resuming interrupted pvmove are tested:
- pvmove
- pvmove -b
- lvchange
- vgchange

tests for commits:
- c26d81d6e6
- fe30658a4d
2015-04-13 20:53:18 +02:00
Zdenek Kabelac
e4261ba037 tests: update runner
Reenable TESTDIR  & PREFIX replacement.
Since we need to replace string in proper order (1st. @TESTDIR@,
2nd. @PREFIX@), drop map and use plain string.

Drop timestamp logging when 'stacktracing'
2015-04-13 16:38:32 +02:00
Zdenek Kabelac
0aef2b719f tests: log parallel debug.log usage as problem 2015-04-13 16:38:32 +02:00
Zdenek Kabelac
0457224feb tests: sections in test separated
Use  <========  to separate sections.
Use ##  to prefix these outputs.
Drop $top_srcdir from sed  (it's been replacing '..')
Hide more /dev  dirs.
2015-04-13 16:38:31 +02:00
Zdenek Kabelac
f080ebc123 tests: hide unwanted output 2015-04-13 16:38:31 +02:00
Zdenek Kabelac
1a7c9ce3bd tests: handle debug.log from clvmd
When clvmd starts, it starts it's own command logging into debug.log.
This is interferring with our other command debug.log.
As as sideeffect we may experience log from command,
followed but lots of zeros and continued with clvmd log.

Fix it by renaming debug.log and now we could also print this trace
to get full list of clvmd activity nicely.

Also improve some post-mortem prints from udevadm and dmsetup to
make the output more usable.
2015-04-09 13:13:36 +02:00
Zdenek Kabelac
ebde60beab tests: use single lvmconf call 2015-04-08 23:19:37 +02:00
Zdenek Kabelac
a5b34f0f1b tests: put "" around dev path 2015-04-08 23:19:37 +02:00
Zdenek Kabelac
8fdca0de79 tests: check scsi_debug support opt_blks
Some older kernels (i.e. lenny) do not have such options.
2015-04-07 14:59:13 +02:00
Zdenek Kabelac
64353ff74b tests: when test fails collect more info
In some case it might be worth to know some more surrouding info
when command has crashed.

So collect  tables and some udev db content in this case.
2015-04-07 13:40:15 +02:00
Zdenek Kabelac
87cb0a3e9f tests: change default to 30s.
Keep rather the default lower and avoid to pass it with every call.
2015-04-03 19:40:43 +02:00
Zdenek Kabelac
93ab6d5184 tests: better check for empty set
Even when no arg is passed - there is still one "" arg there...
So taky it easy and check for empty string instead.
2015-04-03 16:38:05 +02:00
Zdenek Kabelac
d3a591a7b3 tests: hide unwanted output 2015-04-03 14:54:22 +02:00
Zdenek Kabelac
dc41859220 tests: enhance delay_dev
Use common code for error_dev & delay_dev.
Both functions now take list of sectors.

From now on we could delay just 'extent' section, while
keeping running  lvm commands fast (having native metadata area).
2015-04-03 14:53:36 +02:00
Zdenek Kabelac
bd84389c68 tests: add get first_extent_sector
Trvial function to figure out sector position of 1st. extent.
2015-04-03 14:20:03 +02:00
Zdenek Kabelac
308f9bcc18 tests: simplify check sysfs_queue
Pass just device name and let figure out
sysfs path inside the function.
2015-04-03 10:27:00 +02:00
Zdenek Kabelac
a16324b0d3 tests: drop check for awk 2015-04-02 13:38:41 +02:00
Zdenek Kabelac
7a6e3838e9 tests: add check sysfs_queue
Add check function for content of /sys/block/$1/queue/$2 == $3
2015-04-02 13:38:41 +02:00
Ondrej Kozina
7c66850ce5 tests: add helper routine for pvmove status check 2015-03-30 18:38:50 +02:00
Zdenek Kabelac
f08154cc7b tests: update aux
When we use /dev/loopX device - shift first PV1 sector by 1M
so /dev/loop0 and dm device do not appear as same device.

Also notify lvmetad once 'devs' are created - so in case this
command is called in the middle of test - lvmetad properly
drops its metadata for these devices.

Drop used test.img file between reuse so the 'prepare_vg'
always starts with zeroed disks.

When LVM_TEST_AUX_TRACE is set, allow shell tracing of aux commands.
2015-03-26 15:10:31 +01:00
Zdenek Kabelac
21343ffbfe tests: start clvmd without lib/ 2015-03-20 11:08:21 +01:00
Zdenek Kabelac
e4fa756385 tests: export shell vars
Export vars so they are visible in  'aux' calls as well.
(reenables cluster testing)
2015-03-19 11:23:44 +01:00
Zdenek Kabelac
eded54df7b tests: avoid loop on older system
Cleanup overload of 'push'.
Don't busy-loop when reading is finished.
2015-03-12 00:07:45 +01:00
Zdenek Kabelac
26f5ec0e98 tests: update runner
Avoid busy-looping on CPU while reading socket pipe
and always call read only when select tells there is
something for read.

Change the batch output to old nicer output.
2015-03-11 21:17:23 +01:00