[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/30] iotests: Create VM.blockdev_create()
From: |
Kevin Wolf |
Subject: |
[PULL 18/30] iotests: Create VM.blockdev_create() |
Date: |
Thu, 19 Dec 2019 18:24:29 +0100 |
We have several almost identical copies of a blockdev_create() function
in different test cases. Time to create one unified function in
iotests.py.
To keep the diff managable, this patch only creates the function and
follow-up patches will convert the individual test cases.
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/iotests.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index b46d298766..8739ec6613 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -643,6 +643,22 @@ class VM(qtest.QEMUQtestMachine):
elif status == 'null':
return error
+ # Returns None on success, and an error string on failure
+ def blockdev_create(self, options, job_id='job0', filters=None):
+ if filters is None:
+ filters = [filter_qmp_testfiles]
+ result = self.qmp_log('blockdev-create', filters=filters,
+ job_id=job_id, options=options)
+
+ if 'return' in result:
+ assert result['return'] == {}
+ job_result = self.run_job(job_id)
+ else:
+ job_result = result['error']
+
+ log("")
+ return job_result
+
def enable_migration_events(self, name):
log('Enabling migration QMP events on %s...' % name)
log(self.qmp('migrate-set-capabilities', capabilities=[
--
2.20.1
- [PULL 09/30] iotests: Add qemu_io_log(), (continued)
- [PULL 09/30] iotests: Add qemu_io_log(), Kevin Wolf, 2019/12/19
- [PULL 10/30] iotests: Fix timeout in run_job(), Kevin Wolf, 2019/12/19
- [PULL 08/30] qcow2: Declare BDRV_REQ_NO_FALLBACK supported, Kevin Wolf, 2019/12/19
- [PULL 11/30] iotests: Support job-complete in run_job(), Kevin Wolf, 2019/12/19
- [PULL 13/30] MAINTAINERS: fix qcow2-bitmap.c under Dirty Bitmaps header, Kevin Wolf, 2019/12/19
- [PULL 14/30] iotests: Add more "_require_drivers" checks to the shell-based tests, Kevin Wolf, 2019/12/19
- [PULL 15/30] iotests/273: Filter format-specific information, Kevin Wolf, 2019/12/19
- [PULL 16/30] iotests: Fix IMGOPTSSYNTAX for nbd, Kevin Wolf, 2019/12/19
- [PULL 17/30] qcow2: Move error check of local_err near its assignment, Kevin Wolf, 2019/12/19
- [PULL 12/30] qcow2: Use offset_into_cluster(), Kevin Wolf, 2019/12/19
- [PULL 18/30] iotests: Create VM.blockdev_create(),
Kevin Wolf <=
- [PULL 19/30] iotests: 255: Drop blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 21/30] iotests: 210: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 22/30] iotests: 212: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 23/30] iotests: 213: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 20/30] iotests: 206: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 25/30] iotests: 266: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 24/30] iotests: 237: Convert to VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 30/30] iotests: Test external snapshot with VM state, Kevin Wolf, 2019/12/19
- [PULL 27/30] iotests: 211: Remove duplication with VM.blockdev_create(), Kevin Wolf, 2019/12/19
- [PULL 29/30] hmp: Allow using qdev ID for qemu-io command, Kevin Wolf, 2019/12/19