mirror of https://github.com/xemu-project/xemu.git
iotests: 237: 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
5568933840
commit
59f61afa7e
|
@ -26,15 +26,6 @@ from iotests import imgfmt
|
||||||
|
|
||||||
iotests.verify_image_format(supported_fmts=['vmdk'])
|
iotests.verify_image_format(supported_fmts=['vmdk'])
|
||||||
|
|
||||||
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.vmdk') as disk_path, \
|
with iotests.FilePath('t.vmdk') as disk_path, \
|
||||||
iotests.FilePath('t.vmdk.1') as extent1_path, \
|
iotests.FilePath('t.vmdk.1') as extent1_path, \
|
||||||
iotests.FilePath('t.vmdk.2') as extent2_path, \
|
iotests.FilePath('t.vmdk.2') as extent2_path, \
|
||||||
|
@ -50,14 +41,14 @@ with iotests.FilePath('t.vmdk') as disk_path, \
|
||||||
size = 5 * 1024 * 1024 * 1024
|
size = 5 * 1024 * 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()
|
||||||
|
@ -74,11 +65,11 @@ with iotests.FilePath('t.vmdk') 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,
|
||||||
|
@ -103,11 +94,11 @@ with iotests.FilePath('t.vmdk') 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,
|
||||||
|
@ -128,7 +119,7 @@ with iotests.FilePath('t.vmdk') 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()
|
||||||
|
@ -148,7 +139,7 @@ with iotests.FilePath('t.vmdk') as disk_path, \
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
for adapter_type in [ 'ide', 'buslogic', 'lsilogic', 'legacyESX' ]:
|
for adapter_type in [ 'ide', 'buslogic', 'lsilogic', 'legacyESX' ]:
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': size,
|
'size': size,
|
||||||
'adapter-type': adapter_type })
|
'adapter-type': adapter_type })
|
||||||
|
@ -160,7 +151,7 @@ with iotests.FilePath('t.vmdk') as disk_path, \
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
for adapter_type in [ 'foo', 'IDE', 'legacyesx', 1 ]:
|
for adapter_type in [ 'foo', 'IDE', 'legacyesx', 1 ]:
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': size,
|
'size': size,
|
||||||
'adapter-type': adapter_type })
|
'adapter-type': adapter_type })
|
||||||
|
@ -185,7 +176,7 @@ with iotests.FilePath('t.vmdk') 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': size,
|
'size': size,
|
||||||
'subformat': 'monolithicFlat' })
|
'subformat': 'monolithicFlat' })
|
||||||
|
@ -196,7 +187,7 @@ with iotests.FilePath('t.vmdk') 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': size,
|
'size': size,
|
||||||
'subformat': 'monolithicFlat',
|
'subformat': 'monolithicFlat',
|
||||||
|
@ -208,7 +199,7 @@ with iotests.FilePath('t.vmdk') 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': 512,
|
'size': 512,
|
||||||
'subformat': 'monolithicFlat',
|
'subformat': 'monolithicFlat',
|
||||||
|
@ -228,7 +219,7 @@ with iotests.FilePath('t.vmdk') as disk_path, \
|
||||||
extents = [ "ext%d" % (i) for i in range(1, num_extents + 1) ]
|
extents = [ "ext%d" % (i) for i in range(1, num_extents + 1) ]
|
||||||
|
|
||||||
vm.launch()
|
vm.launch()
|
||||||
blockdev_create(vm, { 'driver': imgfmt,
|
vm.blockdev_create({ 'driver': imgfmt,
|
||||||
'file': 'node0',
|
'file': 'node0',
|
||||||
'size': size,
|
'size': size,
|
||||||
'subformat': subfmt,
|
'subformat': subfmt,
|
||||||
|
|
Loading…
Reference in New Issue