|
19 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20 | 20 | #
|
21 | 21 |
|
22 |
| -import os |
23 | 22 | import itertools
|
24 | 23 | import operator
|
| 24 | +import os |
25 | 25 | import re
|
| 26 | + |
26 | 27 | import iotests
|
27 | 28 | from iotests import qemu_img, qemu_img_create, Timeout
|
28 | 29 |
|
@@ -224,25 +225,6 @@ def inject_test_case(klass, suffix, method, *args, **kwargs):
|
224 | 225 | setattr(klass, 'test_' + method + suffix, lambda self: mc(self))
|
225 | 226 |
|
226 | 227 |
|
227 |
| -for cmb in list(itertools.product((True, False), repeat=5)): |
228 |
| - name = ('_' if cmb[0] else '_not_') + 'persistent_' |
229 |
| - name += ('_' if cmb[1] else '_not_') + 'migbitmap_' |
230 |
| - name += '_online' if cmb[2] else '_offline' |
231 |
| - name += '_shared' if cmb[3] else '_nonshared' |
232 |
| - if cmb[4]: |
233 |
| - name += '__pre_shutdown' |
234 |
| - |
235 |
| - inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', |
236 |
| - *list(cmb)) |
237 |
| - |
238 |
| -for cmb in list(itertools.product((True, False), repeat=2)): |
239 |
| - name = ('_' if cmb[0] else '_not_') + 'persistent_' |
240 |
| - name += ('_' if cmb[1] else '_not_') + 'migbitmap' |
241 |
| - |
242 |
| - inject_test_case(TestDirtyBitmapMigration, name, |
243 |
| - 'do_test_migration_resume_source', *list(cmb)) |
244 |
| - |
245 |
| - |
246 | 228 | class TestDirtyBitmapBackingMigration(iotests.QMPTestCase):
|
247 | 229 | def setUp(self):
|
248 | 230 | qemu_img_create('-f', iotests.imgfmt, base_a, size)
|
@@ -304,6 +286,30 @@ class TestDirtyBitmapBackingMigration(iotests.QMPTestCase):
|
304 | 286 | self.assert_qmp(result, 'return', {})
|
305 | 287 |
|
306 | 288 |
|
| 289 | +def main() -> None: |
| 290 | + for cmb in list(itertools.product((True, False), repeat=5)): |
| 291 | + name = ('_' if cmb[0] else '_not_') + 'persistent_' |
| 292 | + name += ('_' if cmb[1] else '_not_') + 'migbitmap_' |
| 293 | + name += '_online' if cmb[2] else '_offline' |
| 294 | + name += '_shared' if cmb[3] else '_nonshared' |
| 295 | + if cmb[4]: |
| 296 | + name += '__pre_shutdown' |
| 297 | + |
| 298 | + inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', |
| 299 | + *list(cmb)) |
| 300 | + |
| 301 | + for cmb in list(itertools.product((True, False), repeat=2)): |
| 302 | + name = ('_' if cmb[0] else '_not_') + 'persistent_' |
| 303 | + name += ('_' if cmb[1] else '_not_') + 'migbitmap' |
| 304 | + |
| 305 | + inject_test_case(TestDirtyBitmapMigration, name, |
| 306 | + 'do_test_migration_resume_source', *list(cmb)) |
| 307 | + |
| 308 | + iotests.main( |
| 309 | + supported_fmts=['qcow2'], |
| 310 | + supported_protocols=['file'] |
| 311 | + ) |
| 312 | + |
| 313 | + |
307 | 314 | if __name__ == '__main__':
|
308 |
| - iotests.main(supported_fmts=['qcow2'], |
309 |
| - supported_protocols=['file']) |
| 315 | + main() |
0 commit comments