Until the kernel supports RBD exclusive locking, this test
has been updated to create shared images (exclusive locking
disabled).
Fixes: #10613
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Automatic locking hides the ESHUTDOWN from the caller, which is how
this test detects that blacklisting works.
Fixes: #10592
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
These can happen with split or with state changes due to reordering
results within the hash range requested. It's easy enough to filter
them out at this stage.
Backport: giant, firefly
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
The local filesytem may behave slightly differently. This isn't
foolproof, but seems to be reliable enough on rhel7 rootfs, where
exact comparison was failing.
Fixes: #10002
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
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>
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>
Modified qemu-iotests workunit script to check for versions
that use the latest qemu (currently only Trusty). Limit the
tests to those that are applicable to rbd.
Fixes: 7882
Signed-off-by: Warren Usui <warren.usui@inktank.com>
Listing objects isn't reliable with cache pools; skip that part of the
test if we see that rbd has tiering enabled.
Signed-off-by: Sage Weil <sage@inktank.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>
There's no guarantee the rbd module is loaded when this script is
run, so add a line that loads it if necessary.
Signed-off-by: Alex Elder <elder@inktank.com>
An rbd clone image can be created with an object order that differs
from that of its parent. This patch adds testing for that in
qa/workunits/rbd/image_read.sh. By default, clone images will be
created with an object size twice as big as that of its parent.
For simplicity, when a clone's object order differs from its parent
the order will be either one more than or one less than that of its
parent image, meaning its object size is either double or half of
the size of objects used in the parent.
Signed-off-by: Alex Elder <elder@inktank.com>
Add testing to verify that a snapshot of a clone and a clone of
that snapshot both produce the correct results when read.
Signed-off-by: Alex Elder <elder@inktank.com>
Move the dd command that touches the last byte in a local file
into create_image() where it belongs (out of fill_original()).
Signed-off-by: Alex Elder <elder@inktank.com>
The function boolean_toggle() in qa/workunits/rbd/image_read.sh is
defined but never used. My intentions were good though. Fix it and
use it for argument parsing.
Change the minimum supported object order so it matches what the
command line interface enforces.
Assign the initial value of TEST_CLONES from the environment if it's
available.
Change defaults to use format 2 and test clones.
Output details about the parameters of the run even if not being
verbose.
Make the order of assignment of argument variables consistent.
And fix a typo unmap_image().
Signed-off-by: Alex Elder <elder@inktank.com>
Since snapshots never change, it's safe to read from replicas for them.
A common use for this would be reading from a parent snapshot shared by
many clones.
Convert LibrbdWriteback and AioRead to use the ObjectOperation api
so we can set flags. Fortunately the external wrapper holds no data,
so its lifecycle doesn't need to be managed.
Include a simple workunit that sets the flags in various combinations
and looks for their presence in the logs from 'rbd export'.
Fixes: #3064
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This uses the old stand-alone qemu-iotests repo so it works with the
version of qemu in Ubuntu 12.04. The tests depend tightly on qemu
version, so to use later tests we'd need to install corresponding
versions of qemu.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This adds a new test script for validating data reads from a mapped
rbd image is what it's expected to be.
See the content of the file for a bit more explanation.
Signed-off-by: Alex Elder <elder@inktank.com>
Stress test that does io on an image while we are mirroring a diff from
earlier snaps to a second copy. At the end, verify that all snaps have
matching content.
Signed-off-by: Sage Weil <sage@inktank.com>
Export a diff of an image from a previous snapshot to a file (or stdout).
Import a diff and apply it to an image, and then create the ending
snapshot.
Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rbd/test_lock_fence.sh runs using test/rbdrw.py
rbdrw.py creates an image, locks it, and runs an I/O loop;
test_lock_fence.sh runs it, waits, and then blacklists that client,
which causes rbdrw.py to get ESHUTDOWN on operations thereafter.
Currently doesn't work with rbd caching enabled.
rbd.py gets new exception type for ESHUTDOWN
Fixes: #3190
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>