]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: updated test_notify to handle new release lock semantics 28441/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 26 Oct 2017 14:52:16 +0000 (10:52 -0400)
committerYuri Weinstein <yweinste@redhat.com>
Thu, 6 Jun 2019 21:56:44 +0000 (14:56 -0700)
Fixes: http://tracker.ceph.com/issues/21912
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 66d8a4443687f6ad7295c94065272f443ac3a9c3)

src/test/librbd/test_notify.py

index b44ef0cab302bf88050fe6b89b8983fe48c03542..bf7aa712fa1cef94e1d69010950ecce007fa6695 100755 (executable)
@@ -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())