diff --git a/tests/qemu-iotests/235 b/tests/qemu-iotests/235 index e5d1ae6593..c5264972b9 100755 --- a/tests/qemu-iotests/235 +++ b/tests/qemu-iotests/235 @@ -21,7 +21,7 @@ import sys import os import iotests -from iotests import qemu_img_create, qemu_io, file_path +from iotests import qemu_img_create, qemu_io, file_path, log sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts')) @@ -38,22 +38,34 @@ from qemu import QEMUMachine # for me) # 4. add iothread -size = '1G' +size = 1 * 1024 * 1024 * 1024 iotests.verify_image_format(supported_fmts=['raw', 'qcow2']) -disk, target = file_path('disk', 'target') +disk = file_path('disk') # prepare source image -qemu_img_create('-f', iotests.imgfmt, disk, size) -qemu_io('-f', iotests.imgfmt, '-c', 'write 0 ' + size, disk) +qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk, + str(size)) vm = QEMUMachine(iotests.qemu_prog) vm.add_args('-machine', 'pc,accel=kvm') vm.add_args('-drive', 'id=src,file=' + disk) vm.launch() -print(vm.qmp('drive-mirror', device='src', target=target, sync='full')) +log(vm.qmp('object-add', qom_type='throttle-group', id='tg0', + props={ 'x-bps-total': 64 * 1048576 })) + +log(vm.qmp('blockdev-add', + **{ 'node-name': 'target', + 'driver': 'throttle', + 'throttle-group': 'tg0', + 'file': { + 'driver': 'null-co', + 'size': size + } })) + +log(vm.qmp('blockdev-mirror', device='src', target='target', sync='full')) vm.event_wait('BLOCK_JOB_READY') vm.shutdown() diff --git a/tests/qemu-iotests/235.out b/tests/qemu-iotests/235.out index d6ccbad8fa..39db621e04 100644 --- a/tests/qemu-iotests/235.out +++ b/tests/qemu-iotests/235.out @@ -1 +1,3 @@ -{u'return': {}} +{"return": {}} +{"return": {}} +{"return": {}}