mirror of https://github.com/xemu-project/xemu.git
iotests: 212: Convert to VM.blockdev_create()
Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
e55c24138b
commit
08b171380c
|
@ -26,15 +26,6 @@ from iotests import imgfmt
|
||||||
iotests.verify_image_format(supported_fmts=['parallels'])
|
iotests.verify_image_format(supported_fmts=['parallels'])
|
||||||
iotests.verify_protocol(supported=['file'])
|
iotests.verify_protocol(supported=['file'])
|
||||||
|
|
||||||
def blockdev_create(vm, options):
|
|
||||||
result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
|
|
||||||
filters=[iotests.filter_qmp_testfiles])
|
|
||||||
|
|
||||||
if 'return' in result:
|
|
||||||
assert result['return'] == {}
|
|
||||||
vm.run_job('job0')
|
|
||||||
iotests.log("")
|
|
||||||
|
|
||||||
with iotests.FilePath('t.parallels') as disk_path, \
|
with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
iotests.VM() as vm:
|
iotests.VM() as vm:
|
||||||
|
|
||||||
|
@ -47,16 +38,16 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
size = 128 * 1024 * 1024
|
size = 128 * 1024 * 1024
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': 'file',
|
vm.blockdev_create({ 'driver': 'file',
|
||||||
'filename': disk_path,
|
'filename': disk_path,
|
||||||
'size': 0 })
|
'size': 0 })
|
||||||
|
|
||||||
vm.qmp_log('blockdev-add', driver='file', filename=disk_path,
|
vm.qmp_log('blockdev-add', driver='file', filename=disk_path,
|
||||||
node_name='imgfile', filters=[iotests.filter_qmp_testfiles])
|
node_name='imgfile', filters=[iotests.filter_qmp_testfiles])
|
||||||
|
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'imgfile',
|
'file': 'imgfile',
|
||||||
'size': size })
|
'size': size })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
iotests.img_info_log(disk_path)
|
iotests.img_info_log(disk_path)
|
||||||
|
@ -71,16 +62,16 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
size = 64 * 1024 * 1024
|
size = 64 * 1024 * 1024
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': 'file',
|
vm.blockdev_create({ 'driver': 'file',
|
||||||
'filename': disk_path,
|
'filename': disk_path,
|
||||||
'size': 0 })
|
'size': 0 })
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': {
|
'file': {
|
||||||
'driver': 'file',
|
'driver': 'file',
|
||||||
'filename': disk_path,
|
'filename': disk_path,
|
||||||
},
|
},
|
||||||
'size': size,
|
'size': size,
|
||||||
'cluster-size': 1048576 })
|
'cluster-size': 1048576 })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
iotests.img_info_log(disk_path)
|
iotests.img_info_log(disk_path)
|
||||||
|
@ -95,16 +86,16 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
size = 32 * 1024 * 1024
|
size = 32 * 1024 * 1024
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': 'file',
|
vm.blockdev_create({ 'driver': 'file',
|
||||||
'filename': disk_path,
|
'filename': disk_path,
|
||||||
'size': 0 })
|
'size': 0 })
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': {
|
'file': {
|
||||||
'driver': 'file',
|
'driver': 'file',
|
||||||
'filename': disk_path,
|
'filename': disk_path,
|
||||||
},
|
},
|
||||||
'size': size,
|
'size': size,
|
||||||
'cluster-size': 65536 })
|
'cluster-size': 65536 })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
iotests.img_info_log(disk_path)
|
iotests.img_info_log(disk_path)
|
||||||
|
@ -116,9 +107,9 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
iotests.log("")
|
iotests.log("")
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': "this doesn't exist",
|
'file': "this doesn't exist",
|
||||||
'size': size })
|
'size': size })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -129,9 +120,9 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
|
|
||||||
vm.add_blockdev('driver=file,filename=%s,node-name=node0' % (disk_path))
|
vm.add_blockdev('driver=file,filename=%s,node-name=node0' % (disk_path))
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': 0 })
|
'size': 0 })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
iotests.img_info_log(disk_path)
|
iotests.img_info_log(disk_path)
|
||||||
|
@ -143,9 +134,9 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
iotests.log("")
|
iotests.log("")
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': 4503599627369984})
|
'size': 4503599627369984})
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
iotests.img_info_log(disk_path)
|
iotests.img_info_log(disk_path)
|
||||||
|
@ -171,9 +162,9 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
vm.launch()
|
vm.launch()
|
||||||
for size in [ 1234, 18446744073709551104, 9223372036854775808,
|
for size in [ 1234, 18446744073709551104, 9223372036854775808,
|
||||||
9223372036854775296, 4503599627370497 ]:
|
9223372036854775296, 4503599627370497 ]:
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': size })
|
'size': size })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -185,12 +176,12 @@ with iotests.FilePath('t.parallels') as disk_path, \
|
||||||
vm.launch()
|
vm.launch()
|
||||||
for csize in [ 1234, 128, 4294967296, 9223372036854775808,
|
for csize in [ 1234, 128, 4294967296, 9223372036854775808,
|
||||||
18446744073709551104, 0 ]:
|
18446744073709551104, 0 ]:
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': 67108864,
|
'size': 67108864,
|
||||||
'cluster-size': csize })
|
'cluster-size': csize })
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': 281474976710656,
|
'size': 281474976710656,
|
||||||
'cluster-size': 512 })
|
'cluster-size': 512 })
|
||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
|
|
Loading…
Reference in New Issue