From: Jason Dillaman Date: Thu, 26 Oct 2017 14:52:16 +0000 (-0400) Subject: test/librbd: updated test_notify to handle new release lock semantics X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ed13287dd6981589542688bf995307ae4be7bd6;p=ceph.git test/librbd: updated test_notify to handle new release lock semantics Fixes: http://tracker.ceph.com/issues/21912 Signed-off-by: Jason Dillaman (cherry picked from commit 66d8a4443687f6ad7295c94065272f443ac3a9c3) --- diff --git a/src/test/librbd/test_notify.py b/src/test/librbd/test_notify.py index b44ef0cab30..bf7aa712fa1 100755 --- a/src/test/librbd/test_notify.py +++ b/src/test/librbd/test_notify.py @@ -68,6 +68,12 @@ def master(ioctx): RBD().clone(ioctx, PARENT_IMG_NAME, 'snap1', ioctx, CLONE_IMG_NAME, features=features) with Image(ioctx, CLONE_IMG_NAME) as image: + print("enabling object map") + assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0) + image.update_features(RBD_FEATURE_OBJECT_MAP, True) + assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0) + assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0) + print("acquiring exclusive lock") offset = 0 data = os.urandom(512) @@ -102,7 +108,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") @@ -142,8 +147,7 @@ def slave(ioctx): assert(list(image.list_snaps()) == []) print("rebuild object map") - assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0) - image.update_features(RBD_FEATURE_OBJECT_MAP, True) + assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0) assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0) image.rebuild_object_map() assert(not image.is_exclusive_lock_owner())