iotests: Add qemu_io_log()
authorKevin Wolf <kwolf@redhat.com>
Tue, 19 Nov 2019 17:36:09 +0000 (18:36 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 18 Dec 2019 10:21:16 +0000 (11:21 +0100)
Add a function that runs qemu-io and logs the output with the
appropriate filters applied.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/qemu-iotests/iotests.py

index df0708923d068e6acfc8630382d776b7337af67e..fc78852ae58f3636939af65ce8f62733ca01e614 100644 (file)
@@ -162,6 +162,11 @@ def qemu_io(*args):
         sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitcode, ' '.join(args)))
     return subp.communicate()[0]
 
+def qemu_io_log(*args):
+    result = qemu_io(*args)
+    log(result, filters=[filter_testfiles, filter_qemu_io])
+    return result
+
 def qemu_io_silent(*args):
     '''Run qemu-io and return the exit code, suppressing stdout'''
     args = qemu_io_args + list(args)