Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/librbd: added update_features RPC message to test_notify #18561

Merged
merged 1 commit into from
Oct 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/test/librbd/test_notify.py
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 @@ -102,7 +102,6 @@ def slave(ioctx):

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 +140,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