aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-02-01 20:29:10 +0100
committerMax Reitz <mreitz@redhat.com>2019-02-25 15:11:25 +0100
commitf2ea0b2082ef2783abb5dfef0e8cab3d41ac6d5f (patch)
treefd2bc76b0fc0132c95ff8611b611e309f00eb9ee /tests/qemu-iotests
parent909936234c38d92921f055f8cf19a7dca1bd9aa1 (diff)
iotests.py: Add filter_imgfmt()
Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190201192935.18394-7-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rw-r--r--tests/qemu-iotests/iotests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index b461f53abf..d80fd7fc2a 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -304,6 +304,16 @@ def filter_img_info(output, filename):
lines.append(line)
return '\n'.join(lines)
+def filter_imgfmt(msg):
+ return msg.replace(imgfmt, 'IMGFMT')
+
+def filter_qmp_imgfmt(qmsg):
+ def _filter(key, value):
+ if is_str(value):
+ return filter_imgfmt(value)
+ return value
+ return filter_qmp(qmsg, _filter)
+
def log(msg, filters=[], indent=None):
'''Logs either a string message or a JSON serializable message (like QMP).
If indent is provided, JSON serializable messages are pretty-printed.'''