[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/67] iotests.py: Add @hide_fields to img_info_log
From: |
Max Reitz |
Subject: |
[PATCH 09/67] iotests.py: Add @hide_fields to img_info_log |
Date: |
Tue, 1 Oct 2019 21:46:17 +0200 |
You can specify fields here that should be hidden from the output.
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 9737dd881b..f3c80ba4e9 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -201,7 +201,8 @@ def qemu_img_log(*args):
log(result, filters=[filter_testfiles])
return result
-def img_info_log(filename, filter_path=None, imgopts=False, extra_args=[]):
+def img_info_log(filename, filter_path=None, imgopts=False, extra_args=[],
+ hide_fields=[]):
args = [ 'info' ]
if imgopts:
args.append('--image-opts')
@@ -210,7 +211,13 @@ def img_info_log(filename, filter_path=None,
imgopts=False, extra_args=[]):
args += extra_args
args.append(filename)
- output = qemu_img_pipe(*args)
+ output = qemu_img_pipe(*args).splitlines(keepends=True)
+
+ output = [line for line in output
+ if not any(line.strip().startswith(field)
+ for field in hide_fields)]
+ output = ''.join(output)
+
if not filter_path:
filter_path = filename
log(filter_img_info(output, filter_path))
--
2.21.0
- [PATCH 03/67] iotests.py: Add unsupported_imgopts, (continued)
- [PATCH 05/67] iotests.py: Add ImagePaths, Max Reitz, 2019/10/01
- [PATCH 08/67] iotests.py: Add filter_json_filename(), Max Reitz, 2019/10/01
- [PATCH 09/67] iotests.py: Add @hide_fields to img_info_log,
Max Reitz <=
- [PATCH 07/67] iotests.py: Filter data_file in filter_img_info, Max Reitz, 2019/10/01
- [PATCH 06/67] iotests.py: Add image_path(), Max Reitz, 2019/10/01
- [PATCH 12/67] iotests/228: Filter json:{} filenames, Max Reitz, 2019/10/01
- [PATCH 11/67] iotests/224: Filter json:{} from commit command, Max Reitz, 2019/10/01
- [PATCH 13/67] iotests/242: Hide refcount bit information, Max Reitz, 2019/10/01
- [PATCH 14/67] iotests: Use unsupported_imgopts in Python tests, Max Reitz, 2019/10/01
- [PATCH 15/67] iotests/030: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 10/67] iotests/169: Skip persistent cases for compat=0.10, Max Reitz, 2019/10/01
- [PATCH 18/67] iotests/044: Honor $IMGOPTS, Max Reitz, 2019/10/01
- [PATCH 16/67] iotests/040: Honor $IMGOPTS, Max Reitz, 2019/10/01