|
@@ -22,15 +22,6 @@ import iotests
|
|
|
from iotests import imgfmt
|
|
|
|
|
|
|
|
|
-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')
|
|
|
-
|
|
|
-
|
|
|
# Successful image creation (defaults)
|
|
|
def implicit_defaults(vm, file_path):
|
|
|
iotests.log("=== Successful image creation (defaults) ===")
|
|
@@ -40,9 +31,9 @@ def implicit_defaults(vm, file_path):
|
|
|
# (Close to 64 MB)
|
|
|
size = 8 * 964 * 17 * 512
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': size })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': size })
|
|
|
|
|
|
|
|
|
# Successful image creation (explicit defaults)
|
|
@@ -54,11 +45,11 @@ def explicit_defaults(vm, file_path):
|
|
|
# (Close to 128 MB)
|
|
|
size = 16 * 964 * 17 * 512
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': size,
|
|
|
- 'subformat': 'dynamic',
|
|
|
- 'force-size': False })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': size,
|
|
|
+ 'subformat': 'dynamic',
|
|
|
+ 'force-size': False })
|
|
|
|
|
|
|
|
|
# Successful image creation (non-default options)
|
|
@@ -69,11 +60,11 @@ def non_defaults(vm, file_path):
|
|
|
# Not representable in CHS (fine with force-size=True)
|
|
|
size = 1048576
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': size,
|
|
|
- 'subformat': 'fixed',
|
|
|
- 'force-size': True })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': size,
|
|
|
+ 'subformat': 'fixed',
|
|
|
+ 'force-size': True })
|
|
|
|
|
|
|
|
|
# Size not representable in CHS with force-size=False
|
|
@@ -84,10 +75,10 @@ def non_chs_size_without_force(vm, file_path):
|
|
|
# Not representable in CHS (will not work with force-size=False)
|
|
|
size = 1048576
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': size,
|
|
|
- 'force-size': False })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': size,
|
|
|
+ 'force-size': False })
|
|
|
|
|
|
|
|
|
# Zero size
|
|
@@ -95,9 +86,9 @@ def zero_size(vm, file_path):
|
|
|
iotests.log("=== Zero size===")
|
|
|
iotests.log("")
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': 0 })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': 0 })
|
|
|
|
|
|
|
|
|
# Maximum CHS size
|
|
@@ -105,9 +96,9 @@ def maximum_chs_size(vm, file_path):
|
|
|
iotests.log("=== Maximum CHS size===")
|
|
|
iotests.log("")
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': 16 * 65535 * 255 * 512 })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': 16 * 65535 * 255 * 512 })
|
|
|
|
|
|
|
|
|
# Actual maximum size
|
|
@@ -115,10 +106,10 @@ def maximum_size(vm, file_path):
|
|
|
iotests.log("=== Actual maximum size===")
|
|
|
iotests.log("")
|
|
|
|
|
|
- blockdev_create(vm, { 'driver': imgfmt,
|
|
|
- 'file': 'protocol-node',
|
|
|
- 'size': 0xff000000 * 512,
|
|
|
- 'force-size': True })
|
|
|
+ vm.blockdev_create({ 'driver': imgfmt,
|
|
|
+ 'file': 'protocol-node',
|
|
|
+ 'size': 0xff000000 * 512,
|
|
|
+ 'force-size': True })
|
|
|
|
|
|
|
|
|
def main():
|
|
@@ -132,9 +123,9 @@ def main():
|
|
|
vm.launch()
|
|
|
|
|
|
iotests.log('--- Creating empty file ---')
|
|
|
- blockdev_create(vm, { 'driver': 'file',
|
|
|
- 'filename': file_path,
|
|
|
- 'size': 0 })
|
|
|
+ vm.blockdev_create({ 'driver': 'file',
|
|
|
+ 'filename': file_path,
|
|
|
+ 'size': 0 })
|
|
|
|
|
|
vm.qmp_log('blockdev-add', driver='file', filename=file_path,
|
|
|
node_name='protocol-node',
|