Skip to content

Commit

Permalink
test/librbd: added update_features RPC message to test_notify
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/21936
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Oct 26, 2017
1 parent fb48989 commit ed636a3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/test/librbd/test_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def master(ioctx):
image.create_snap('snap1')
image.protect_snap('snap1')

features = features & ~(RBD_FEATURE_OBJECT_MAP | RBD_FEATURE_FAST_DIFF)
features = features & ~(RBD_FEATURE_FAST_DIFF)
RBD().clone(ioctx, PARENT_IMG_NAME, 'snap1', ioctx, CLONE_IMG_NAME,
features=features)
with Image(ioctx, CLONE_IMG_NAME) as image:
Expand Down Expand Up @@ -100,9 +100,10 @@ def slave(ioctx):

print("detected master")

print("rename")
RBD().rename(ioctx, CLONE_IMG_NAME, CLONE_IMG_RENAME);
assert(not image.is_exclusive_lock_owner())
with Image(ioctx, CLONE_IMG_NAME) as image:
print("rename")
RBD().rename(ioctx, CLONE_IMG_NAME, CLONE_IMG_RENAME);
assert(not image.is_exclusive_lock_owner())

with Image(ioctx, CLONE_IMG_RENAME) as image:
print("flatten")
Expand Down Expand Up @@ -141,10 +142,17 @@ def slave(ioctx):
assert(not image.is_exclusive_lock_owner())
assert(list(image.list_snaps()) == [])

print("rebuild object map")
print("update_features")
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
image.update_features(RBD_FEATURE_OBJECT_MAP, False)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
image.update_features(RBD_FEATURE_OBJECT_MAP, True)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)

print("rebuild object map")
image.rebuild_object_map()
assert(not image.is_exclusive_lock_owner())
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) == 0)
Expand Down

0 comments on commit ed636a3

Please sign in to comment.