On 08/23/2017 09:05 AM, Stefan Hajnoczi wrote:
> Non-shared storage migration with NBD and drive-mirror is currently not
> tested by qemu-iotests.  This test case covers the basic migration
> scenario.
> 
> Signed-off-by: Stefan Hajnoczi <[email protected]>
> Based-on: <[email protected]>
> ---
>  tests/qemu-iotests/194        | 73 
> +++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/194.out    | 13 ++++++++
>  tests/qemu-iotests/group      |  1 +
>  tests/qemu-iotests/iotests.py | 13 ++++++++
>  4 files changed, 100 insertions(+)
>  create mode 100755 tests/qemu-iotests/194
>  create mode 100644 tests/qemu-iotests/194.out
> 

> +iotests.log('Waiting for drive-mirror to complete...')
> +iotests.log(source_vm.event_wait('BLOCK_JOB_READY'),
> +            filters=[iotests.filter_qmp_event])
> +
> +iotests.log('Starting migration...')
> +source_vm.qmp('migrate-set-capabilities',
> +              capabilities=[{'capability': 'events', 'state': True}])
> +dest_vm.qmp('migrate-set-capabilities',
> +            capabilities=[{'capability': 'events', 'state': True}])
> +iotests.log(source_vm.qmp('migrate', 
> uri='unix:{0}'.format(migration_sock_path)))
> +
> +while True:
> +    event = source_vm.event_wait('MIGRATION')
> +    iotests.log(event, filters=[iotests.filter_qmp_event])
> +    if event['data']['status'] in ('completed', 'failed'):
> +        break

As a followup patch for 2.11, we could extend this test to also issue a
block-job-cancel (to further imitate the sequence of commands issued by
libvirt).  But that enhancement is not a show-stopper for what got
committed for 2.10-rc4.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to