iotests: 211: Remove duplication with VM.blockdev_create()
authorKevin Wolf <kwolf@redhat.com>
Mon, 16 Dec 2019 17:02:08 +0000 (18:02 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 19 Dec 2019 13:32:43 +0000 (14:32 +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 <kwolf@redhat.com>
tests/qemu-iotests/211

index 6afc894f769f98e6e8abe0dfb65e71768abcd091..8834ebfe85399a9f0807e54a43b5eed55a7ec118 100755 (executable)
@@ -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: