summary refs log tree commit diff stats
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2025-02-04 22:14:05 +0100
committerKevin Wolf <kwolf@redhat.com>2025-02-06 14:47:42 +0100
commited26db83673f4a190332d2a378e2f6e342b8904d (patch)
tree040e258ba8817de8d9edceb21c0fcd39c8daa94d /tests/qemu-iotests/iotests.py
parent2e73a17c68f4d80023dc616e596e8c1f3ea8dd75 (diff)
downloadfocaccia-qemu-ed26db83673f4a190332d2a378e2f6e342b8904d.tar.gz
focaccia-qemu-ed26db83673f4a190332d2a378e2f6e342b8904d.zip
iotests: Add filter_qtest()
The open-coded form of this filter has been copied into enough tests
that it's better to move it into iotests.py.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20250204211407.381505-15-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 19817c7353..9c9c908983 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -701,6 +701,10 @@ def filter_qmp_imgfmt(qmsg):
 def filter_nbd_exports(output: str) -> str:
     return re.sub(r'((min|opt|max) block): [0-9]+', r'\1: XXX', output)
 
+def filter_qtest(output: str) -> str:
+    output = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', output)
+    output = re.sub(r'\n?\[I \+\d+\.\d+\] CLOSED\n?$', '', output)
+    return output
 
 Msg = TypeVar('Msg', Dict[str, Any], List[Any], str)