diff options
-rwxr-xr-x | tests/qemu-iotests/234 | 8 | ||||
-rwxr-xr-x | tests/qemu-iotests/262 | 4 | ||||
-rwxr-xr-x | tests/qemu-iotests/280 | 2 | ||||
-rw-r--r-- | tests/qemu-iotests/iotests.py | 6 |
4 files changed, 12 insertions, 8 deletions
diff --git a/tests/qemu-iotests/234 b/tests/qemu-iotests/234 index 34c818c485..59a7f949ec 100755 --- a/tests/qemu-iotests/234 +++ b/tests/qemu-iotests/234 @@ -69,9 +69,9 @@ with iotests.FilePath('img') as img_path, \ iotests.log(vm_a.qmp('migrate', uri='exec:cat >%s' % (fifo_a))) with iotests.Timeout(3, 'Migration does not complete'): # Wait for the source first (which includes setup=setup) - vm_a.wait_migration() + vm_a.wait_migration('postmigrate') # Wait for the destination second (which does not) - vm_b.wait_migration() + vm_b.wait_migration('running') iotests.log(vm_a.qmp('query-migrate')['return']['status']) iotests.log(vm_b.qmp('query-migrate')['return']['status']) @@ -98,9 +98,9 @@ with iotests.FilePath('img') as img_path, \ iotests.log(vm_b.qmp('migrate', uri='exec:cat >%s' % (fifo_b))) with iotests.Timeout(3, 'Migration does not complete'): # Wait for the source first (which includes setup=setup) - vm_b.wait_migration() + vm_b.wait_migration('postmigrate') # Wait for the destination second (which does not) - vm_a.wait_migration() + vm_a.wait_migration('running') iotests.log(vm_a.qmp('query-migrate')['return']['status']) iotests.log(vm_b.qmp('query-migrate')['return']['status']) diff --git a/tests/qemu-iotests/262 b/tests/qemu-iotests/262 index 0963daa806..bbcb5260a6 100755 --- a/tests/qemu-iotests/262 +++ b/tests/qemu-iotests/262 @@ -71,9 +71,9 @@ with iotests.FilePath('img') as img_path, \ iotests.log(vm_a.qmp('migrate', uri='exec:cat >%s' % (fifo))) with iotests.Timeout(3, 'Migration does not complete'): # Wait for the source first (which includes setup=setup) - vm_a.wait_migration() + vm_a.wait_migration('postmigrate') # Wait for the destination second (which does not) - vm_b.wait_migration() + vm_b.wait_migration('running') iotests.log(vm_a.qmp('query-migrate')['return']['status']) iotests.log(vm_b.qmp('query-migrate')['return']['status']) diff --git a/tests/qemu-iotests/280 b/tests/qemu-iotests/280 index 0b1fa8e1d8..85e9114c5e 100755 --- a/tests/qemu-iotests/280 +++ b/tests/qemu-iotests/280 @@ -45,7 +45,7 @@ with iotests.FilePath('base') as base_path , \ vm.qmp_log('migrate', uri='exec:cat > /dev/null') with iotests.Timeout(3, 'Migration does not complete'): - vm.wait_migration() + vm.wait_migration('postmigrate') iotests.log('\nVM is now stopped:') iotests.log(vm.qmp('query-migrate')['return']['status']) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 13fd8b5cd2..0b62c42851 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -668,12 +668,16 @@ class VM(qtest.QEMUQtestMachine): } ])) - def wait_migration(self): + def wait_migration(self, expect_runstate): while True: event = self.event_wait('MIGRATION') log(event, filters=[filter_qmp_event]) if event['data']['status'] == 'completed': break + # The event may occur in finish-migrate, so wait for the expected + # post-migration runstate + while self.qmp('query-status')['return']['status'] != expect_runstate: + pass def node_info(self, node_name): nodes = self.qmp('query-named-block-nodes') |