]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: updated test_notify to handle new release lock semantics 18560/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 26 Oct 2017 14:52:16 +0000 (10:52 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 26 Oct 2017 16:51:39 +0000 (12:51 -0400)
Fixes: http://tracker.ceph.com/issues/21912
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_notify.py

index 41a07c56ec5b17428a72f7f6fe27a42fa5c3febd..308c3f14320c0a445c2cb2b44ec96db51f174533 100755 (executable)
@@ -65,6 +65,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)
@@ -99,7 +105,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")
@@ -138,8 +143,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())