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>
This commit is contained in:
Kevin Wolf 2018-05-23 18:19:00 +02:00
parent 00af19359e
commit 5ba141dc6f
4 changed files with 286 additions and 262 deletions

View file

@ -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))