yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
77c23f
From 2be333e847c01397bb6a92b2e4c60e904957675d Mon Sep 17 00:00:00 2001
77c23f
From: Kevin Wolf <kwolf@redhat.com>
77c23f
Date: Mon, 8 Jun 2020 15:01:37 +0100
77c23f
Subject: [PATCH 09/17] iotests: Add qemu_io_log()
77c23f
77c23f
RH-Author: Kevin Wolf <kwolf@redhat.com>
77c23f
Message-id: <20200608150140.38218-9-kwolf@redhat.com>
77c23f
Patchwork-id: 97451
77c23f
O-Subject: [RHEL-AV-8.2.1 qemu-kvm PATCH 08/11] iotests: Add qemu_io_log()
77c23f
Bugzilla: 1780574
77c23f
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
77c23f
RH-Acked-by: Eric Blake <eblake@redhat.com>
77c23f
RH-Acked-by: Max Reitz <mreitz@redhat.com>
77c23f
77c23f
Add a function that runs qemu-io and logs the output with the
77c23f
appropriate filters applied.
77c23f
77c23f
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
77c23f
Reviewed-by: Eric Blake <eblake@redhat.com>
77c23f
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
77c23f
Reviewed-by: Alberto Garcia <berto@igalia.com>
77c23f
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
77c23f
(cherry picked from commit a96f0350e3d95c98f2bff1863d14493af5c1d360)
77c23f
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
77c23f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
77c23f
---
77c23f
 tests/qemu-iotests/iotests.py | 5 +++++
77c23f
 1 file changed, 5 insertions(+)
77c23f
77c23f
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
77c23f
index be20d56..7a9c779 100644
77c23f
--- a/tests/qemu-iotests/iotests.py
77c23f
+++ b/tests/qemu-iotests/iotests.py
77c23f
@@ -162,6 +162,11 @@ def qemu_io(*args):
77c23f
         sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitcode, ' '.join(args)))
77c23f
     return subp.communicate()[0]
77c23f
 
77c23f
+def qemu_io_log(*args):
77c23f
+    result = qemu_io(*args)
77c23f
+    log(result, filters=[filter_testfiles, filter_qemu_io])
77c23f
+    return result
77c23f
+
77c23f
 def qemu_io_silent(*args):
77c23f
     '''Run qemu-io and return the exit code, suppressing stdout'''
77c23f
     args = qemu_io_args + list(args)
77c23f
-- 
77c23f
1.8.3.1
77c23f