From: Ilya Dryomov Date: Tue, 8 Mar 2022 12:56:15 +0000 (+0100) Subject: test/librbd/test_notify.py: effect post object map rebuild assert X-Git-Tag: v18.0.0~1278^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5b94f080a359a70883ba34e5bd03e0e4601a6c6a;p=ceph.git test/librbd/test_notify.py: effect post object map rebuild assert 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 --- diff --git a/src/test/librbd/test_notify.py b/src/test/librbd/test_notify.py index 25c5b3f4e4b7c..4e929d74fa465 100755 --- a/src/test/librbd/test_notify.py +++ b/src/test/librbd/test_notify.py @@ -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)