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