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

683 Commits

Author SHA1 Message Date
Marian Csontos
9cd05d1f1e test: Check flavour is used and exists 2018-07-26 15:01:50 +02:00
Zdenek Kabelac
c47655f231 tests: initial vdo tests
Basic functionality of lvcreate, lvchange.
2018-07-09 15:29:16 +02:00
David Teigland
ae961a192a Remove python bindings for liblvm2app 2018-06-08 10:33:47 -05:00
David Teigland
dbc3e62cc0 tests: don't look for liblvm 2018-06-08 09:36:03 -05:00
David Teigland
063d065388 tests: add missing file 2018-05-30 09:25:45 -05:00
David Teigland
595196bc29 tests: enable lvmlockd for passing tests 2018-05-30 09:25:45 -05:00
David Teigland
cd369d8a7f tests: separate lvmlockd tests with or without lvmetad 2018-05-30 09:25:45 -05:00
David Teigland
5ac9f8d631 tests: fix skipping logic for lvmpolld and lvmlockd 2018-05-30 09:25:45 -05:00
Zdenek Kabelac
f865e1bf87 tests: passthrough args with extend_filter_LVMTEST
Don't rebuild config twice.
2018-05-24 11:22:59 +02:00
Zdenek Kabelac
76a45424a7 tests: aux improve for mdadm support
Correcting some symlink handling.
2018-05-24 11:03:47 +02:00
Heinz Mauelshagen
a39eaea27d tests: fix kernal_at_least argument in aux.sh 2018-05-17 14:41:47 +02:00
Zdenek Kabelac
550380c1a4 tests: aux fixes
Properly check for kernel version.
Also detect sysfs throttling support.
2018-05-15 22:02:41 +02:00
Zdenek Kabelac
0217c53b24 tests: dont try to use DAX based brd device
Unfortunatelly on kernels <4.16 lvm2 can't user brd ramdisks
for backend device as number of test is failing with this kernel
message:

device-mapper: ioctl: can't change device type after initial table load.

caused by DAX request-based handling, and lvm2 tries to replace device
with backend 'error' bio-based device and such table reload is being
rejected.

So ATM keep ramdisk only on most recent kernel to experiment a bit,
for older machines just stay safe and keep old slower loop backend.
2018-05-15 16:07:13 +02:00
Zdenek Kabelac
ca87674ea4 tests: fix check sysfs
Commit 810f856c24 missed to move
assign of P after setting maj & min.
2018-05-12 23:01:52 +02:00
Zdenek Kabelac
7b8b13c62b tests: aux detecs supported segments
Replace previous compilation detection of present supported segtypes
with runtime check.
2018-05-12 22:50:36 +02:00
Zdenek Kabelac
0b465d1543 tests: drop cache checking
Just like 52656c89fd
when now cache is compiled in 'unditionally'.

This patch is actually enforce by changes in
commit: 2bc896f2a3
where CACHE value is not set anymore.
2018-05-12 18:18:23 +02:00
Zdenek Kabelac
d38a2d64f0 tests: add support to run unit test 2018-05-12 18:18:23 +02:00
Zdenek Kabelac
cbe81a0b05 tests: inittest may run without root
If the test does not need root, it can use 'SKIP_ROOT_DM_CHECK'.

For such test no actions needed root to initilize DM devices and
nodes will be take and test can check i.e. functional unit tests.
2018-05-12 18:05:50 +02:00
Zdenek Kabelac
0221ebfd64 tests: inittest compare string
Avoid logging warning when compared string is empty with -eq.
2018-05-12 18:05:50 +02:00
Zdenek Kabelac
a7a23e7dd2 tests: aux extra protection for rm -rf 2018-05-12 18:05:50 +02:00
Zdenek Kabelac
7362ed68be tests: move device discard 2018-05-12 17:48:31 +02:00
Zdenek Kabelac
172d8fb355 tests: aux support throttling of dm mirror
Usage of dm_delay looks to be slowing not just 'delayed' portion
of device, but due to the fact it's also slows down ANY flush
operation on such device it's overal speed impact is huge.

In some case we can however user other methods to slowdown disk writes,
in case of old dm 'mirror'  target we can throttle  I/O of mirror
synchronisation giving the next commands enough time to test couple
race conditions.

Usage:

throttle_dm_mirror [percentage]

Thtrottle down sync speed (lowest is '1' which is also default when
unspecified)

restore_dm_mirror

Restores the value of throttling before call of  'throttle_dm_mirror'
Usually it should '100'
2018-05-12 17:48:31 +02:00
Zdenek Kabelac
0cadfdd69d tests: try running tests over ramdisk
Currently usage of loop device over backend file in ramdisk (tmpfs)
is actually causing unnecassary memory consution, since just
reading such loop device is causing RAM provisioning.

This patch add another possible way how to use ramdisk directly
through 'brd' device when possible (and allowed).

This however has it's limitation as well -  brd does not support
TRIM, so the only way how to erase is to remove brd module ??

Alse there is 4K sector size limitation imposed by ramdisk.

Anyway - for some mirror test that were using large amount of
disk space (tens of MB) this brings noticable speed boost.
(But could be worth to solve the slowness of loop in kernel?)

To prevent using 'brd' for testing set LVM_TEST_PREFER_BRD=0
like this:

make check_local LVM_TEST_PREFER_BRD=0
2018-05-12 17:48:31 +02:00
Joe Thornber
52656c89fd functional tests: Update have_raid function
No need to check if it's built in.
2018-05-03 14:22:24 +01:00
David Teigland
c365d7de4f tests: fix THIN built-in check 2018-04-30 13:12:17 -05:00
Zdenek Kabelac
dd7ac793a0 aux: enhance teardown to better handle weird names
When 'dmsetup' reports result with --nameprefixes it currently
incorrectly 'escapes' problematic characters.

Letting pass such string though shell 'eval' function is hard task.
So instead cut away substring.

Once dmsetup will start to properly escape backslash and apostrophe
this function may need further tuning.
2018-04-30 10:41:51 +02:00
David Teigland
d75aa55784 disable LVM1 tests 2018-04-20 11:22:46 -05:00
Zdenek Kabelac
d51429254f tests: improve mirror_images_redundant
Use only passed VG for lvs and avoid 1 extra uneeded use of lvs.
2018-04-20 12:17:01 +02:00
Zdenek Kabelac
3a48fb47b7 tests: shellcheck misc
Few more minor complains from ShellCheck.
2018-03-23 17:25:00 +01:00
Zdenek Kabelac
1507956383 tests: shellcheck split assing
Keep possibly error unmasked by assign
2018-03-23 17:25:00 +01:00
Zdenek Kabelac
397b7891ff tests: shellcheck liter 2018-03-23 17:25:00 +01:00
Zdenek Kabelac
410c992744 tests: shellcheck use grep -E
Replace egrep with grep -E
2018-03-23 17:25:00 +01:00
Zdenek Kabelac
14abe1e87b tests: shellcheck prevention check
Always make sure variable is set to something else the /dev/*
2018-03-23 17:25:00 +01:00
Zdenek Kabelac
fe69731d31 tests: handle setting better
When using 'make check...  LVM_TEST_AUX_TRACE=0'  make it behaving
like other supported VARS in use so it's like disabled.
2018-03-23 17:25:00 +01:00
Zdenek Kabelac
f6f8f0c7fd tests: skip test when not enough space
Make the test skipped instead of failing when there was not
enough space.
2018-03-15 11:01:04 +01:00
Zdenek Kabelac
bed869a8a0 tests: use DM_DEBUG_WITH_LINE_NUMBERS
Use src:line also for debugging of tools like dmsetup.
2018-03-15 11:01:04 +01:00
Zdenek Kabelac
750fc2e876 tests: fix running tests on systems without udevd
Variable was unbound on systems without running udevd.
2018-03-15 11:01:04 +01:00
Zdenek Kabelac
90512910e5 tests: try unfreezeing raids
With problematic kernels raid devices can be occasionaly left with
'frozen' status - try to 'unfreeze' them with idle message on teardown.

Also replace couple greps with 'built-in' dmsetup --select feature.

Note: dmsetup --select  currently reports 'No devices found' on stdout
and return success - looks like a bug to fix.
2018-03-13 12:58:57 +01:00
Zdenek Kabelac
8e5305f630 tests: correct usage of pipe
This is somewhat tricky - for test suite we keep using
'set -e -o pipefail'  - the effect here is - we get error report
from any 'failing' command in whole pipeline - thus when something
like this:   'lvs | head -1'  is used - and  'head' finishes before
lead 'lvs' is done - it recieves SIGPIPE and exits with error,
and somewhat misleading gets occasionally reported depending
of speed of commands.

For this case we have to avoid using standard pipes and rather
switch to using streamed results with temporary output file.
This is all nicely handled with bash feature '< <()'.

For more info:
https://stackoverflow.com/questions/41516177/bash-zcat-head-causes-pipefail
2018-02-19 16:45:10 +01:00
Zdenek Kabelac
5baf2de898 tests: longer startup timeout for daemons with valgrind
It's getting noticable somewhat slower...
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
0bf1cc2320 tests: sleep first
Sleep a bit before checking /sys/block dir so the kernel has a moment to
actually put scsi debug device in it...

Some quite old kernels are in troubles with this plain searching grep
without sleep (namely 2.6.32)

modprobe scsi_debug
 <sleep .1>
grep -H scsi_debug /sys/block/*/device/model
modprobe -r scsi_debug
2017-12-19 15:28:07 +01:00
Marian Csontos
15ccea7111 test: Fix condition when detecting lvmdbusd 2017-12-12 14:19:22 +01:00
Marian Csontos
2f4c2a43d4 test: lvmdbusd is used for process name
lvmdbusd was started, but the process was not recognized by pgrep.

- configure does not make the script executable - set the flag
  explicitly when running make check,
- process name changed to lvmdbusd. The previous python3 value
  originated from the use of /usr/bin/env.
2017-12-12 13:17:07 +01:00
Marian Csontos
b8caca4652 tests: Fix common_dev_ argument handling
from[:[len]] arguments with missing colon assigned from to len, instead
of till_the_end_of_device.
2017-11-28 12:03:35 +01:00
Zdenek Kabelac
fe69a8d215 tests: use nonflusing status
Avoid being blocked when reporting status with flushing on some stacked
device tree.
2017-11-11 01:00:35 +01:00
Zdenek Kabelac
1e80ec8926 tests: allow override of LVM_LOG_FILE_MAX_LINES
Just like with other vars support this:

make check_local T=xyz LVM_LOG_FILE_MAX_LINES=10000000

Allows easily to override existing line limit.
Also increase limiting size of logs per command since some of
our commands are becoming very verbose....
2017-10-26 14:04:58 +02:00
Zdenek Kabelac
d9f9ce1268 tests: use portable df output
For awk parsing more 'predictable' format of output line is needed.
2017-09-20 15:34:02 +02:00
Zdenek Kabelac
2fd2b197ab tests: check for free space in test dir
Avoid starting test, when test dir has less then 50M of free space.
Better to crash early before letting die machine on weird crash
in OOM cases...

Also show free disk space when test starts
2017-09-20 15:14:16 +02:00
Zdenek Kabelac
7b048f6b43 tests: aus.sh fix md teardown
Commit 8a912d6dbc missed the wrong logic,
we use 2 vars 'dev' & 'mddev' and their usage can't be mixed.

So correctly separate them so mddev keeps name of MD device.
2017-07-20 12:16:27 +02:00
Zdenek Kabelac
86d7adc2a5 tests: aux.sh fix wait_pvmove_lv_ready
Ignore error if the 'queried' LV is still not available
(since 'get' now properly returns failure when LV is missing)
2017-07-19 12:15:39 +02:00
Zdenek Kabelac
43dbfee32a tests: aus.sh better defaults 2017-07-18 21:25:03 +02:00
Zdenek Kabelac
9599645bb6 tests: aux.sh limit device
During test do a more close selection of visible devices.
If some test leaks a device with LVMTEST prefix, next
test should not be influnced (or parallel running one).

If the test is running in non-/dev  dir - it's already protected
by full path with $PREFIX in it - however it test is running
in real /dev dir - there was no such protection and test
were confused when they have seen such leaked device.
2017-07-18 13:14:02 +02:00
Zdenek Kabelac
fde23f7ce1 tests: better support for unbound vars for older shell 2017-07-17 20:32:48 +02:00
Zdenek Kabelac
5a5553bcec tests: aux.sh some backward compatible updates
Older bash does not take empty array as bounded variable
(except for $@)
2017-07-17 15:01:44 +02:00
Zdenek Kabelac
f293d46946 tests: aux.sh correcting bounder values
grep for defined PREFIX.
use 'dev' instead of undefined mddev.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
84b56872fb tests: aux.sh also uses increseed hardening protection
Also use similar incresed hardeing of script correctness
for standalone aux scripts - so there is one common
logic for pipe failures.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
bd2a0fe2ec tests: utils.sh look for more coredump places
Quoting helps to anyone storing coredumps inside dir with spaces....
Also add default dir for coredumps with systemd coredumpctl.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
413209f3f8 tests: utils.sh looks for more dumps
Check for core in  sysctl kernel.core_pattern
(assuming core prefix still)
2017-07-15 00:12:07 +02:00
Zdenek Kabelac
2154f30a99 tests: add udev_wait before tearing scsi_debug
Make less probably there will be some udev work going while we try
to remove scsi_debug target.
2017-07-14 20:30:04 +02:00
Zdenek Kabelac
ac0945bc4a tests: aux.sh fix double quote
Patch 72a58ce4b0 was wronly placing
double quotes around this variable which we want to pass expanded,
as it's just set of 'space' device args ATM.

TODO consider using array[@] to make this cleaner.
Add shellcheck directive to skip warning here
2017-07-14 20:29:38 +02:00
Marian Csontos
1c95cf8c6f tests: utils.sh six stacktrace
Changes:

- BASH_SOURCE index was one off.
- The first line of stacktrace was pure confusion displaying executed
  script together with innermost line number (which was either 125 when
  STACKTRACE or 229 when skip was called.)
- We can safely ignore innermost call, as stack trace is always produced
  by stacktrace function.
- It is safer to test for array length, instead of testing FUNCNAME is
  main - if main function were introduced.
- Bashishm is safe to use as this function as a whole is relying on bash.
2017-07-14 20:18:42 +02:00
Zdenek Kabelac
cd4e6c9b17 tests: aux.sh integrate both teardown loops
Use 1 logic for 2 loops tearing down left device.
First loops tries to remove all closed devices with 'normal' remove.
Second loop tries to replace those left devices with 'error' target.
2017-07-14 13:22:15 +02:00
Zdenek Kabelac
e682af7878 tests: aux.sh better teardown loop
We can't really sleep that much in teardown as it slows test too much.
So do a nested loop (similar to 'dmsetup remove_all') and keep
removing devices with open count == 0 as long as it works.
2017-07-14 00:27:55 +02:00
Zdenek Kabelac
490e6e9ef1 tests: add some delay after dmsetup
When we want to squash as much device as possible,
it's better to give it some delay, so devices have
some time to release it's resouces for next removal.

Also drop surrounding cookie processing and let each
dmsetup call run on its own.
2017-07-13 21:11:16 +02:00
Zdenek Kabelac
c4b6df94b4 tests: properly check variables were defined
When test suite is installed some vars are not defined.
2017-07-12 13:51:16 +02:00
Zdenek Kabelac
5a91b0a2e2 tests: fix detection of running dmeventd after test
The checking order here has happend after TESTDIR was removed
resulting in weird further error on trap path.

Properly check for unexpected dmeventd before removing TESTDIR
since  'trap' codepath is still using it.

Also try to kill this unexpected dmeventd so testing is
not skipping all next  dmeventd tests.

(Downside would be - if user would be accidentally starting
dmeventd by some regular system admin work - such dmeventd
might be killd if it's unused. It can't kill dmeventd in-use.
2017-07-12 13:38:07 +02:00
Zdenek Kabelac
d9ef564e42 tests: utils.sh drop gdb_commands.txt
Remove file after use (fixes recursive STACKTRACE calls)
2017-07-12 01:50:06 +02:00
Zdenek Kabelac
8387f4efc9 tests: more vars bounded 2017-07-12 01:21:44 +02:00
Zdenek Kabelac
2baac408fc tests: aux.sh better loop logic
Instead of using pipe for read and haveing no chance
to modify shell vars inside such loop  use  <( )
and keep using bash arrays.
2017-07-12 01:21:44 +02:00
Zdenek Kabelac
a87860965e tests: hardening - no unbound vars
Dissallow usage of any unbound shell variable in tests.
All vars needs to have some defined value.
2017-07-11 16:48:25 +02:00
Zdenek Kabelac
41e11e0f21 tests: check.sh simplify in_sync
Avoid calling sed.
2017-07-11 16:26:12 +02:00
Zdenek Kabelac
e9a544b942 tests: avoid using readarray
Real bashman can live without readarray.

Support older tested machines with bash <4.0....
2017-07-10 17:40:31 +02:00
Zdenek Kabelac
1c9789b0cc tests: use well defined test
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

Apparently && and || "short-circuit" while -a and -o do not.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
fdbb680531 tests: check mirror_images_on fixed
Fix mirror_images_on() to actually report something useful (thought
it might be tuned later).

So for now the function got through all '_mimages_' and compares
where the order of them is matching given list of devices.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
72e82b42a9 tests: aux.sh tweaks
Some improvements.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
73cb5b486a tests: aus.sh avoid duplicating arg list 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
f612fdd1dd tests: aux.sh common pattern for starting daemons 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
4fc0166ca9 tests: aux.sh move corosyn 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
408e3b84f6 tests: cleanup msg 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
73bbd5528c tests: scripts double quote 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
24751b45bd tests: double quote 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
d12c0ae163 tests: utils.sh assign directly
Assign properly quoted vars in eval directly.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
f21d812127 tests: get.sh use simplier tr 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
d426d7e709 tests: aux.sh check for already present config
'aux lvmconf' detects if new config needs to be regenerated.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
32c0dc3549 tests: aux.sh double quote 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
84e83ac37e tests: aux.sh replace sed call
Use internal shell vars manips
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
928a49a7c8 tests: aux.sh use grep -E
egrep is nonstandard.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
5bd09cb79d tests: aux.sh drop useless echo
Simply trim on space.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
6be61bf044 tests: aux.sh check cd result
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
c87e1afa03 tests: export many shell vars with 1 command 2017-07-10 14:23:53 +02:00
Heinz Mauelshagen
70c340dbc2 test: return 0 if ignoring 'a' device health chars is requested
This allows lvconvert-raid-reshape-striped_to_linear.sh to succeed when
it reduces raid5 to two stripes before converting to raid1 and linear.
2017-07-04 19:34:10 +02:00
Zdenek Kabelac
006a9eaada tests: aux.sh fix pattern
Commit 72a58ce4b0 fixed 'translation' of
pattern by bash by using "" - so we need to drop '\' here to get
wanted behavior.
2017-06-30 21:13:07 +02:00
Zdenek Kabelac
c31614eccc tests: aux.sh use subshell for simple redirection 2017-06-30 17:08:47 +02:00
Zdenek Kabelac
57779e39ec tests: correcting globbing usage
Ensure globbing uses current dir.
Break loop when no match is found.
Let STACKTRACE finish its output when gdb fails.
2017-06-30 14:40:50 +02:00
Zdenek Kabelac
9348ad4f16 tests: aux prepares lvmdbusd
Correctly skip the test when lvmdbusd is found already running.
For pgrep usage we need to add '-f -l' options to get python3 name
printed.
Remove no longer used 'pids' local var.
2017-06-30 12:12:16 +02:00
Zdenek Kabelac
674a93ffe3 tests: aux do not specify bitmap for raid0 2017-06-30 12:09:10 +02:00
Zdenek Kabelac
e84a145cf4 tests: check.sh uses array for list
For properly quoted args, switch to use arrays for arg list.
2017-06-30 12:09:10 +02:00
Zdenek Kabelac
3d90c7fffc tests: get.sh declare and assign separately
Declare and assign separately to avoid masking return values.

Also comment-out currently unused  orig variable.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
834b82b0cd tests: get.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
d7b3815223 tests: utils.sh separately assign
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
cf4b671acd tests: utils.sh avoid iterating over ls output 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
4697937af4 tests: utils.sh arithmetic
expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
$ is unnecessary on arithmetic variables.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
00957450eb tests: utils.sh no mixed string array
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
c396053955 tests: utils.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b442861f50 tests: lvm-wrapper.sh legacy syntax 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b1f80512c8 tests: lvm-wrapper.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
32be18959d tests: inittest.sh double quote and mixing string 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b45ca523ec tests: check.sh eliminate useless cat
Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
51237cb504 tests: check.sh better if
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
db338c2b42 tests: check.sh drop unnecessary $
$/${} is unnecessary on arithmetic variables.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
c0197040a5 tests: check.sh using grep -F
fgrep is non-standard and deprecated. Use grep -F instead.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
824db54128 tests: check.sh no mixing string
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
810f856c24 tests: check.sh assign separately
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
02729202f3 tests: check.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
491fcd2a92 tests: aux.sh fix pid handling
Modification of pids is local (to subshell caused by pipeline).
pids was modified in a subshell. That change might be lost.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
96fcf82ddd tests: aux.sh add -r to read 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
ec02307e95 tests: aux.sh array assing
Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
8a912d6dbc tests: aux.sh separately assign
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
4f63b7e9c1 tests: aux.sh using grep -c
Consider using grep -c instead of grep|wc -l.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b16ca76260 tests: aux.sh no mixing string
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
44e530b919 tests: aux.sh drop unnecessary $
$/${} is unnecessary on arithmetic variables.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
474e3cd66d tests: aux.sh use pgrep 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
72a58ce4b0 tests: aux.sh double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
f48d1bf147 tests: require also no 'a' for in-sync
Raid easily reports  'idle' with 'a', so in this case
we will not report in-sync.
2017-06-23 23:32:44 +02:00
Zdenek Kabelac
3d591ac376 tests: avoid double lines
Skip showing same line twice in test's verbose log.
2017-06-20 18:24:52 +02:00
Heinz Mauelshagen
a004cceed2 test: Adjust previous commit
Change have_single_core to  have_multi_core and go back to || logic in related test scripts.
2017-04-21 01:21:24 +02:00
Alasdair G Kergon
c7fb0cb861 test: Skip some reshape tests that hang on single core machines
Skip hanging raid reshape tests until https://bugzilla.redhat.com/1443999
is fixed
2017-04-20 20:05:07 +01:00
Zdenek Kabelac
aa25cfe084 test: correcting binary usage
Ensure 'test suite' run uses fsadm and dmeventd from compiled dir,
while for 'rpm' installed test use binaries installed in system.
2017-04-14 01:03:18 +02:00
David Teigland
0ea9a15612 tests: use raid_region_size 512
given the new default from 5ae7a016b8
2017-04-13 14:21:34 -05:00
Zdenek Kabelac
59d54d70e7 tests: aux defines fsadm path 2017-04-12 23:05:50 +02:00
Zdenek Kabelac
fb1f38a6f6 tests: fix LD_LIBRARY_PATH
Use only selected paths for finding .so in builddir.
So if builddir constains some embeded subdirs with some more
occurences of project (i.e.  'make rpm' build subdir)
those library paths will not get into list.
2017-03-31 17:12:00 +02:00
Zdenek Kabelac
c717011f8e tests: use LVM_SYSTEM_DIR for etc
Instead of hardcoding etc/ dir  use $LVM_SYSTEM_DIR.
2017-03-10 19:33:01 +01:00
Heinz Mauelshagen
34caf83172 lvconvert: add infrastructure for RaidLV reshaping support
In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces the changes to call the reshaping infratructure
from lv_raid_convert().

Changes:
- add reshaping calls from lv_raid_convert()
- add command definitons for reshaping to tools/command-lines.in
- fix raid_rimage_extents()
- add 2 new test scripts lvconvert-raid-reshape-linear_to_striped.sh
  and lvconvert-raid-reshape-striped_to_linear.sh to test
  the linear <-> striped multi-step conversions
- add lvconvert-raid-reshape.sh reshaping tests
- enhance lvconvert-raid-takeover.sh with new raid10 tests

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978
2017-02-24 05:20:58 +01:00
Zdenek Kabelac
aa72caca5a tests: support zero_dev
When the test would need to try to write some large amount of data
we can give it 'zero' segments - for obvious reason such written data
can't be verified but in some test cases it doesn't really matter.

Usage follows  'error_dev' style.

For now test suite is not supporting any combination of
error/delay/zero segments so only 1 type could be used per PV.
2017-02-22 15:40:59 +01:00
Zdenek Kabelac
1c1ce2739e tests: some debug code
Checking if --deferred would make it any faster - but it's as slow
as without this new optional flag anyway (4.10).
2017-02-21 09:40:21 +01:00
Zdenek Kabelac
2a65e2d49e tests: ensure first call is version test
Check 'dmsetup version'  is called before starting any more
advanced logic in $DM_DEV_DIR.

Call also replaces mkdir as it creates needed path with control node.
2017-02-21 09:38:49 +01:00
Zdenek Kabelac
d409fec079 tests: paralelize creation and teardown
To speedup initial construction and destruction of test devices
(mainly in case more then 1 is needed)  call dmsetup
in parallel.
2017-02-21 00:52:05 +01:00
Heinz Mauelshagen
55eaabd118 lvreduce/lvresize: add ability to reduce the size of a RaidLV
- support shrinking of raid0/1/4/5/6/10 LVs
- enhance lvresize-raid.sh tests: add raid0* and raid10
- fix have_raid4 in aux.sh to allow lv_resize-raid.sh
  and other scripts to test raid4

Resolves: rhbz1394048
2017-02-09 22:42:03 +01:00
Zdenek Kabelac
b92a9c3e1a tests: slow down devs for raid more
Since we still experience occasiaonal test failure - slow
things down even more to avoid race.

Add support for 'quick' table changes between normal & delayed tables.
2017-01-05 15:54:14 +01:00
Zdenek Kabelac
e1943fc07f tests: add device holding function
Hold device open with sleep and wait till sleep really opens
given devices.
2016-12-22 23:37:07 +01:00
Zdenek Kabelac
8c9c6ab660 tests: no left devices check for skipped test 2016-12-12 11:22:10 +01:00
Zdenek Kabelac
56e4e2ce2b tests: track leaked devices in tests
When test calls teardown, no devices created by test are expected
to be left in table. Trap such orphans and make the test fail.
2016-12-11 23:24:19 +01:00
Zdenek Kabelac
3f6ade4b0d tests: apostrof 2016-12-05 17:12:42 +01:00
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