/bin/bash is a Linuxism. Other operating systems install bash to
different paths. Use /usr/bin/env in shebangs to find bash.
Signed-off-by: Alan Somers <asomers@gmail.com>
This is a followup to 38a572011d ("qa: rbd/map-snapshot-io.sh: don't
chown sysfs files") for the rest of the workunits:
- /sys/bus/rbd/add_single_major is used if present, so chown'ing
/sys/bus/rbd/add doesn't help. Use sudo on rbd map instead.
- Don't modprobe or udevadm settle - rbd CLI tool takes care of that.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
The sysfs entries for snapshots went away a while ago, and this
script used them to verify sizes matched what was expected.
Instead, look at the mapped size of the snapshot in the places
that used to look for the image's snapshot sysfs files.
Also, switch over to using "udevadm settle" rather than a delay to
wait for udev to do its thing. Insert them at more appropriate
places--right after "rmd map" commands and before and after the
"rbd unmap" calls.
Stop doing the manual refresh calls as well. The osd will trigger
refreshes whenever the image size or shapshot context changes.
Finally, the cleanup routine is called initially, when there really
isn't expected to be anything to clean up. Change the rbd commands
to run there conditionally, only if the target of the command
already exists.
Signed-off-by: Alex Elder <elder@inktank.com>
This is to handle TextTable output, which doesn't use tabs
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>