yeahuh / rpms / qemu-kvm

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