Merge pull request #41514 from ideepika/wip-49592-upgrade

qa/upgrade: conditionally disable update_features tests

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2021-05-31 19:34:53 +03:00 committed by GitHub
commit 109f0b3c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,21 +140,22 @@ def slave(ioctx):
assert(not image.is_exclusive_lock_owner())
assert(list(image.list_snaps()) == [])
print("update_features")
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
image.update_features(RBD_FEATURE_OBJECT_MAP, False)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
image.update_features(RBD_FEATURE_OBJECT_MAP, True)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
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)
image.update_features(RBD_FEATURE_OBJECT_MAP, False)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
image.update_features(RBD_FEATURE_OBJECT_MAP, True)
assert(not image.is_exclusive_lock_owner())
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
print("write")
data = os.urandom(512)
image.write(data, 0)