[PATCH] tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode

Thomas Huth posted 1 patch 2 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220223124353.3273898-1-thuth@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
tests/qemu-iotests/testrunner.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH] tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode
Posted by Thomas Huth 2 years, 2 months ago
In TAP mode, the stdout is reserved for the TAP protocol, so we
have to make sure to mark other lines with a comment '#' character
at the beginning to avoid that the TAP parser at the other end
gets confused.

To test this condition, run "configure" for example with:

 --block-drv-rw-whitelist=copy-before-write,qcow2,raw,file,host_device,blkdebug,null-co,copy-on-read

so that iotest 041 will report that some tests are not run due to
the missing "quorum" driver. Without this change, "make check-block"
fails since the meson tap parser gets confused by these messages.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/testrunner.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 9a94273975..0c7dc34a9e 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -365,7 +365,10 @@ def run_test(self, test: str,
                                  description=res.description)
 
         if res.casenotrun:
-            print(res.casenotrun)
+            if self.tap:
+                print('#' + res.casenotrun.replace('\n', '\n#'))
+            else:
+                print(res.casenotrun)
 
         return res
 
-- 
2.27.0


Re: [PATCH] tests/qemu-iotests/testrunner: Quote "case not run" lines in TAP mode
Posted by Hanna Reitz 2 years, 2 months ago
On 23.02.22 13:43, Thomas Huth wrote:
> In TAP mode, the stdout is reserved for the TAP protocol, so we
> have to make sure to mark other lines with a comment '#' character
> at the beginning to avoid that the TAP parser at the other end
> gets confused.
>
> To test this condition, run "configure" for example with:
>
>   --block-drv-rw-whitelist=copy-before-write,qcow2,raw,file,host_device,blkdebug,null-co,copy-on-read
>
> so that iotest 041 will report that some tests are not run due to
> the missing "quorum" driver. Without this change, "make check-block"
> fails since the meson tap parser gets confused by these messages.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/testrunner.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)

Thanks, applied to my block branch:

https://gitlab.com/hreitz/qemu/-/commits/block

Hanna