RBD store uses common utils for reading file chunks

Prevents cases where the image_size passed to the RBD store is larger
than the actual image_file which attempts to write 0 bytes of data
causing image.write to hang indefinitely.

Fixes LP Bug #1146830

Change-Id: I56216437a212c0c802d2ed349d88b3bd0d3bb4d7
rbd: return image size when asked

Implement get_size(), and use it for the second part of the return
value of get().

Convert the old-style functional tests into tests using the store test
base class. These test the store api directly, and are more up to date
than the old functional tests that went through the api. The store tests
base class already includes tests for get() and get_size().

Fixes bug 1180565

Change-Id: I85ca0a0ab3155d1a25607ba9dc210be5719bf85c
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: remove extra str() conversions and test with unicode

librbd doesn't handle unicode, so strings passed to it must be plain
ascii. Originally the rbd store did this before each call, but since
3aea9320d20d0291c5b4b027a585370d8e658a95 it only needed to convert to
ascii in StoreLocation and add(). Remove the extraneous calls to
str(), and add a test that uses a unicode image_id and uri to make
sure unicode isn't passed to librbd anywhere.

Change-Id: Ib7656126e044775f516fa6665e28f6d474820665
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Improve unit tests for glance.api.v1 module

Add test for glance.api.v1:
* tests for glance.api.v1.filters.validator
* tests for glance api add member method
* tests for glance api replace member method
* tests for glance api delete member method
* tests for registry api image details method
* tests for registry api image delete method
* tests for registry api add/delete/update/get member methods

Fixes: bug #1152230
Change-Id: I79d06b2281ba0c9b8d10b9300fffe6cc3c69c4ee
Prevent '500' error when using forbidden marker

If an existing image id was used as a marker, but
the user didn't have access to that image a '500'
error occurred. Return '400' instead.

Fixes bug 1178307.

Change-Id: Ib632297d944a19e18694fff154307a3bc6d5b625
Respond with 412 after upload if image was deleted.

When updating the image after upload, we should return an
HTTPPreconditionFailed instead of a 500 error if the image cannot
be found.

This will also provide more information to nova when this occurs
during snapshotting.

Fixes bug 1176174

Change-Id: I270ee129470323dae3919ed0a8c335eae7c24061
Merge "Respond with 412 after upload if image was deleted."
Merge "rbd: return image size when asked"
Merge "rbd: remove extra str() conversions and test with unicode"
Merge "Improve unit tests for glance.api.v1 module"
Merge "RBD store uses common utils for reading file chunks"
Merge "Prevent '500' error when using forbidden marker"