diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-08-01 13:14:09 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-08-16 10:25:16 +0200 |
commit | 980448f17a24573fea53ceec3fa66353e9fd4092 (patch) | |
tree | 3f04996a3bcc7f8b7d7d4df06dee668f35c459d0 /tests/qemu-iotests/iotests.py | |
parent | 19462c4bdd3bab7d277aafbdc178daa6ca074c9c (diff) |
iotests: Move migration helpers to iotests.py
234 implements functions that are useful for doing migration between two
VMs. Move them to iotests.py so that other test cases can use them, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ce74177ab1..91172c39a5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -583,6 +583,22 @@ class VM(qtest.QEMUQtestMachine): elif status == 'null': return error + def enable_migration_events(self, name): + log('Enabling migration QMP events on %s...' % name) + log(self.qmp('migrate-set-capabilities', capabilities=[ + { + 'capability': 'events', + 'state': True + } + ])) + + def wait_migration(self): + while True: + event = self.event_wait('MIGRATION') + log(event, filters=[filter_qmp_event]) + if event['data']['status'] == 'completed': + break + def node_info(self, node_name): nodes = self.qmp('query-named-block-nodes') for x in nodes['return']: |