|
1 | 1 | #!/usr/bin/python3 |
| 2 | +import functools |
2 | 3 | import os |
3 | 4 | import sys |
4 | 5 | import time |
|
13 | 14 | RBD_FEATURE_FAST_DIFF, |
14 | 15 | RBD_FLAG_OBJECT_MAP_INVALID) |
15 | 16 |
|
| 17 | +print = functools.partial(print, flush=True) |
| 18 | + |
16 | 19 | POOL_NAME='rbd' |
17 | 20 | PARENT_IMG_NAME='test_notify_parent' |
18 | 21 | CLONE_IMG_NAME='test_notify_clone' |
@@ -140,18 +143,15 @@ def slave(ioctx): |
140 | 143 | assert(not image.is_exclusive_lock_owner()) |
141 | 144 | assert(list(image.list_snaps()) == []) |
142 | 145 |
|
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) |
155 | 155 |
|
156 | 156 | print("rebuild object map") |
157 | 157 | image.rebuild_object_map() |
|
0 commit comments