Skip to content

Commit 5ada82b

Browse files
authored
Merge pull request ceph#62727 from idryomov/wip-70831
test/librbd/test_notify.py: force line-buffered output Reviewed-by: Mykola Golub <[email protected]> Reviewed-by: Vinay Bhaskar Varada <[email protected]>
2 parents 43369eb + bfc0b4f commit 5ada82b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/test/librbd/test_notify.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/python3
2+
import functools
23
import os
34
import sys
45
import time
@@ -13,6 +14,8 @@
1314
RBD_FEATURE_FAST_DIFF,
1415
RBD_FLAG_OBJECT_MAP_INVALID)
1516

17+
print = functools.partial(print, flush=True)
18+
1619
POOL_NAME='rbd'
1720
PARENT_IMG_NAME='test_notify_parent'
1821
CLONE_IMG_NAME='test_notify_clone'
@@ -140,18 +143,15 @@ def slave(ioctx):
140143
assert(not image.is_exclusive_lock_owner())
141144
assert(list(image.list_snaps()) == [])
142145

143-
if 'RBD_DISABLE_UPDATE_FEATURES' not in os.environ:
144-
print("update_features")
145-
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
146-
image.update_features(RBD_FEATURE_OBJECT_MAP, False)
147-
assert(not image.is_exclusive_lock_owner())
148-
assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
149-
image.update_features(RBD_FEATURE_OBJECT_MAP, True)
150-
assert(not image.is_exclusive_lock_owner())
151-
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
152-
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
153-
else:
154-
print("skipping update_features")
146+
print("update_features")
147+
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
148+
image.update_features(RBD_FEATURE_OBJECT_MAP, False)
149+
assert(not image.is_exclusive_lock_owner())
150+
assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
151+
image.update_features(RBD_FEATURE_OBJECT_MAP, True)
152+
assert(not image.is_exclusive_lock_owner())
153+
assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
154+
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
155155

156156
print("rebuild object map")
157157
image.rebuild_object_map()

0 commit comments

Comments
 (0)