Commit Graph

5 Commits

Author SHA1 Message Date
Ilya Dryomov
9bcc19de58 map-unmap.sh: fail if 'rbd rm' fails
Fail if 'rbd rm' fails - most probably it'd fail with "image still has
watchers" and in that case it's a bug in the kernel client which we do
want to notice.  Also nuke the trap-based error handling - cleanup() is
half-baked and not really necessary here.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-06-29 21:58:15 +04:00
Ilya Dryomov
16b14ea123 map-unmap.sh: drop the get_id() logic
Take advantage of the fact that 'rbd map' will now talk to udev and
output the device that got assigned by the kernel to the newly created
mapping.  Drop the get_id() cruft, udevadm settle and chown calls.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-06-29 21:58:15 +04:00
Alex Elder
bf01b7b2e2 map-unmap.sh: use udevadm settle for synchronization
This script was heuristically using short sleep commands in order to
give udev activity time to complete.

There's a command "udevadm settle" which actually looks at the udev
queue and waits until its processing is done.  Much, much better.

This rearranges the get_id function a bit too, breaking it into one
function that gets the id and another that loops back and tries
again after a short delay in the event the get_id fails.

Signed-off-by: Alex Elder <elder@inktank.com>
2012-12-14 15:58:39 -06:00
Josh Durgin
e6dd0681d1 qa: echo commands run by rbd map-unmap workunit
It's hard to figure out what failed without this.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-12-13 08:29:10 -08:00
Alex Elder
dd3a24a647 create qa/workunits/rbd/map-unmap.sh
This adds a bash script that creates an rbd image, then repeatedly
maps and unmaps it for a specified duration (5 minutes by default).

Signed-off-by: Alex Elder <elder@inktank.com>
2012-11-28 17:22:49 -06:00