diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-12-16 17:57:19 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-12-19 14:32:43 +0100 |
commit | de1ff674a0f56e97d944ba66a8bbc89e2769d8c1 (patch) | |
tree | 7c32188ee138087d079985207d224a8128f91a79 /tests/qemu-iotests/266 | |
parent | 59f61afa7e1800ee513a7ba8ef03bec0a370438c (diff) |
iotests: 266: 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>
Diffstat (limited to 'tests/qemu-iotests/266')
-rwxr-xr-x | tests/qemu-iotests/266 | 69 |
1 files changed, 30 insertions, 39 deletions
diff --git a/tests/qemu-iotests/266 b/tests/qemu-iotests/266 index 5b35cd67e4..c353cf88ee 100755 --- a/tests/qemu-iotests/266 +++ b/tests/qemu-iotests/266 @@ -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', |