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

2130 Commits

Author SHA1 Message Date
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
8a2448a4ed tests: skip test for non dirty cache
Seems some cache LV can't be made dirty easily with older
cache policy implementations....
2017-07-14 00:42:40 +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
f64f6c5e70 tests: wait for udev to minize race windows
mkfs can complain about volume in use when meets udev rule processing.
2017-07-13 21:11:16 +02:00
Zdenek Kabelac
870c7bc76c tests: bound variables 2017-07-13 21:11:16 +02:00
Zdenek Kabelac
e88534b680 tests: delay read of cache pool data
It's better to delay read of cached data.
Limit loop checking for cleaner policy.
2017-07-13 21:11:16 +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
c838e79cd2 tests: fix for new hardened bash
Add missing get_devs.
When $7 is not given use empty string.
See if we can live with less RAM disk for PVs.
Drop limitation on single core as presence 1.12 should address this.
2017-07-12 18:05:56 +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
1daa1cc3a9 tests: use properly quoted device list 2017-07-12 13:50:25 +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
0f2dccc601 tests: bounds still more vars 2017-07-12 01:37:29 +02:00
Zdenek Kabelac
ec9b845aaa tests: drop type
Assuming test wanted to check $lv3 does not exists.
2017-07-12 01:21:44 +02:00
Zdenek Kabelac
a1ed9bc145 tests: more exact test
Check there is really just linear.

Also short-circuit mimages_are_on_ when file is empty
(avoids unbound  mimages[@] access on older bash)
2017-07-12 01:21:44 +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
b97f75b133 tests: improve logic for a race to catch abortion 2017-07-11 17:21:25 +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
5ab2676bac tests: double quote 2017-07-11 16:26:12 +02:00
Zdenek Kabelac
21e0e98665 tests: correct typo
Use defined MARKED_AS_USED_MSG shell var.
2017-07-11 16:26:12 +02:00
Zdenek Kabelac
429e613ba8 tests: avoid unbound shell var usage 2017-07-11 16:26:12 +02:00
Zdenek Kabelac
f11e74ae3d tests: improve test logic
Use existing vars.
Reduce extra lvchange -an and use directly activation with lvcreate.
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
d23a475c98 tests: using prepare_vg 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
dafeb0274a tests: assign path 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
f818a83a1d tests: fix array usage
Use bash arrays to pass devs.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
85e5a8803c tests: simplify and doublequote 2017-07-10 14:23:53 +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
9c0a92ee8d tests: cleaner written eval
Although code work this coding style is better.
This \c will be a regular 'c' in this context.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
ec05890026 tests: mixes string and array
Argument mixes string and array. Use * or separate argument
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
4e2fd6f6ab tests: fix caller of mirror_images_on
Missed vg name.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
bc10d0373a tests: fix working with devs in array
Also fixes one instance of invalid  'mirror_image_on' test
and places there correct indexed set of PVs.
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
91d6a62fc5 tests: correcting usage of $@
Use "$@" (with quotes) to prevent whitespace problems.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
f161c6ee9f tests: assign as string
Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
2e47ab9b8c tests: secure rm call
Use "${var:?}" to ensure this never expands to / .
(Should never happen as 'dir' was supposed to exist from preceding
test.)
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
4ed3f1bee3 tests: improve loop 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
e68d986cd5 tests: check result directly 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
160cb1e713 tests: replace cat usage 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
e11de5847d tests: add space to split words
Fixing shellcheck warning:
This word is outside of quotes. Did you intend to 'nest '"'single quotes'"' instead'?
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
270e526734 tests: fix tests variable
Actually check $r instead or 'r' for test failure.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
38917ee51c tests: replace legacy code
Use $(..) instead of legacy `..`.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
d606891e4a tests: fix quoting 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
494d819a6f tests: drop extra sourcing of utils
This sourceing is automatic by . lib/inittest
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
ff2242036b tests: drop useless literal
Here was usage of '\' unneeded.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
5214e62f09 tests: drop unneeded ; 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
c3d8ee4da2 tests: drop unneeded check
Test should actually fail in this condition as it's testing lvmetad.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
4a5eea7758 tests: drop unneeded echo 2017-07-10 14:23:53 +02:00