[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] iotests: 211: Remove duplication with VM.blockdev_create()
From: |
Kevin Wolf |
Subject: |
[PATCH 10/10] iotests: 211: Remove duplication with VM.blockdev_create() |
Date: |
Mon, 16 Dec 2019 18:08:57 +0100 |
The blockdev_create() function in this test case adds an error check
that skips the test in case of failure because of memory shortage, but
provides otherwise the same functionality as VM.blockdev_create() from
iotests.py. Make it a thin wrapper around the iotests.py function.
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/211 | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211
index 6afc894f76..8834ebfe85 100755
--- a/tests/qemu-iotests/211
+++ b/tests/qemu-iotests/211
@@ -27,15 +27,9 @@ iotests.verify_image_format(supported_fmts=['vdi'])
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'] == {}
- error = vm.run_job('job0')
- if error and 'Could not allocate bmap' in error:
- iotests.notrun('Insufficient memory')
- iotests.log("")
+ error = vm.blockdev_create(options)
+ if error and 'Could not allocate bmap' in error:
+ iotests.notrun('Insufficient memory')
with iotests.FilePath('t.vdi') as disk_path, \
iotests.VM() as vm:
--
2.20.1
- [PATCH 00/10] iotests: Remove duplicated blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 01/10] iotests: Create VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 02/10] iotests: 255: Drop blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 03/10] iotests: 206: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 05/10] iotests: 212: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 06/10] iotests: 213: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 04/10] iotests: 210: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 07/10] iotests: 237: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 09/10] iotests: 207: Remove duplication with VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 08/10] iotests: 266: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/16
- [PATCH 10/10] iotests: 211: Remove duplication with VM.blockdev_create(),
Kevin Wolf <=