aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-05-23 18:19:00 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-30 13:31:18 +0200
commit5ba141dc6f17ca0f250f107aace2df19558c8bc4 (patch)
treeceda3d0a265a6b31e0e08fdfa8dae879b0cb3bc7 /tests/qemu-iotests/iotests.py
parent00af19359e8d77e53a09de9a5d3ed6f6e149e0d2 (diff)
qemu-iotests: Rewrite 210 for blockdev-create job
This rewrites the test case 210 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index bc8f404ac2..fdbdd8b300 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -109,8 +109,16 @@ def qemu_img_pipe(*args):
sys.stderr.write('qemu-img received signal %i: %s\n' % (-exitcode, ' '.join(qemu_img_args + list(args))))
return subp.communicate()[0]
-def img_info_log(filename, filter_path=None):
- output = qemu_img_pipe('info', '-f', imgfmt, filename)
+def img_info_log(filename, filter_path=None, imgopts=False, extra_args=[]):
+ args = [ 'info' ]
+ if imgopts:
+ args.append('--image-opts')
+ else:
+ args += [ '-f', imgfmt ]
+ args += extra_args
+ args.append(filename)
+
+ output = qemu_img_pipe(*args)
if not filter_path:
filter_path = filename
log(filter_img_info(output, filter_path))