diff mbox series

[07/67] iotests.py: Filter data_file in filter_img_info

Message ID 20191001194715.2796-8-mreitz@redhat.com
State New
Headers show
Series iotests: Honor $IMGOPTS in Python tests | expand

Commit Message

Max Reitz Oct. 1, 2019, 7:46 p.m. UTC
If $IMGOPTS contains a data_file reference, let filter_img_info filter
all data_file information.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/iotests.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 280e6c2ec2..fb0a49372d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -380,9 +380,13 @@  def filter_generated_node_ids(msg):
 
 def filter_img_info(output, filename):
     lines = []
+    user_data_file = any('data_file' in opt for opt in imgopts)
     for line in output.split('\n'):
         if 'disk size' in line or 'actual-size' in line:
             continue
+        if user_data_file:
+            if 'data file' in line:
+                continue
         line = line.replace(filename, 'TEST_IMG') \
                    .replace(imgfmt, 'IMGFMT')
         line = re.sub('iters: [0-9]+', 'iters: XXX', line)