]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd/test_notify.py: effect post object map rebuild assert 45297/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 8 Mar 2022 12:56:15 +0000 (13:56 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 8 Mar 2022 12:59:58 +0000 (13:59 +0100)
Instead of just optionally skipping update_features test, commit
9c0b239d70cd ("qa/upgrade: conditionally disable update_features
tests") moved it after rebuild_object_map test.  This isn't right
because update_features test invalidates the object map as a side
effect and rebuild_object_map test is what makes it valid again:

  assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) == 0)

Let's make this assert effective, at least when update_features
test isn't skipped.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/test/librbd/test_notify.py

index 25c5b3f4e4b7c2bbddbd3939c8c93e682a30c5ff..4e929d74fa46585aaec58242aa95b79e05e0bae1 100755 (executable)
@@ -140,11 +140,6 @@ def slave(ioctx):
         assert(not image.is_exclusive_lock_owner())
         assert(list(image.list_snaps()) == [])
 
-        print("rebuild object map")
-        image.rebuild_object_map()
-        assert(not image.is_exclusive_lock_owner())
-        assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) == 0)
-
         if 'RBD_DISABLE_UPDATE_FEATURES' not in os.environ:
             print("update_features")
             assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
@@ -155,6 +150,13 @@ def slave(ioctx):
             assert(not image.is_exclusive_lock_owner())
             assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
             assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
+        else:
+            print("skipping update_features")
+
+        print("rebuild object map")
+        image.rebuild_object_map()
+        assert(not image.is_exclusive_lock_owner())
+        assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) == 0)
 
         print("write")
         data = os.urandom(512)