qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR
@ 2017-09-27 21:13 Max Reitz
  2017-09-27 21:30 ` Eric Blake
  2017-09-29 12:48 ` Max Reitz
  0 siblings, 2 replies; 3+ messages in thread
From: Max Reitz @ 2017-09-27 21:13 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Kevin Wolf

do_run_qemu() in iotest 195 first applies _filter_imgfmt when printing
qemu's command line and _filter_testdir only afterwards.  Therefore, if
the image format is part of the test directory path, _filter_testdir
will no longer apply and the actual output will differ from the
reference output even in case of success.

For example, TEST_DIR might be "/tmp/test-qcow2", in which case
_filter_imgfmt first transforms this to "/tmp/test-IMGFMT" which is no
longer recognized as the TEST_DIR by _filter_testdir.

Fix this by not applying _filter_imgfmt in do_run_qemu() but in
run_qemu() instead, and only after _filter_testdir.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/195 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195
index 05a239cbf5..e7a403ded2 100755
--- a/tests/qemu-iotests/195
+++ b/tests/qemu-iotests/195
@@ -44,15 +44,16 @@ _supported_os Linux
 
 function do_run_qemu()
 {
-    echo Testing: "$@" | _filter_imgfmt
+    echo Testing: "$@"
     $QEMU -nographic -qmp-pretty stdio -serial none "$@"
     echo
 }
 
 function run_qemu()
 {
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp \
-                          | _filter_qemu_io | _filter_generated_node_ids
+    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qemu \
+                          | _filter_qmp | _filter_qemu_io \
+                          | _filter_generated_node_ids
 }
 
 size=64M
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR
  2017-09-27 21:13 [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR Max Reitz
@ 2017-09-27 21:30 ` Eric Blake
  2017-09-29 12:48 ` Max Reitz
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-09-27 21:30 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]

On 09/27/2017 04:13 PM, Max Reitz wrote:
> do_run_qemu() in iotest 195 first applies _filter_imgfmt when printing
> qemu's command line and _filter_testdir only afterwards.  Therefore, if
> the image format is part of the test directory path, _filter_testdir
> will no longer apply and the actual output will differ from the
> reference output even in case of success.
> 
> For example, TEST_DIR might be "/tmp/test-qcow2", in which case
> _filter_imgfmt first transforms this to "/tmp/test-IMGFMT" which is no
> longer recognized as the TEST_DIR by _filter_testdir.
> 
> Fix this by not applying _filter_imgfmt in do_run_qemu() but in
> run_qemu() instead, and only after _filter_testdir.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/195 | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR
  2017-09-27 21:13 [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR Max Reitz
  2017-09-27 21:30 ` Eric Blake
@ 2017-09-29 12:48 ` Max Reitz
  1 sibling, 0 replies; 3+ messages in thread
From: Max Reitz @ 2017-09-29 12:48 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Kevin Wolf

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

On 2017-09-27 23:13, Max Reitz wrote:
> do_run_qemu() in iotest 195 first applies _filter_imgfmt when printing
> qemu's command line and _filter_testdir only afterwards.  Therefore, if
> the image format is part of the test directory path, _filter_testdir
> will no longer apply and the actual output will differ from the
> reference output even in case of success.
> 
> For example, TEST_DIR might be "/tmp/test-qcow2", in which case
> _filter_imgfmt first transforms this to "/tmp/test-IMGFMT" which is no
> longer recognized as the TEST_DIR by _filter_testdir.
> 
> Fix this by not applying _filter_imgfmt in do_run_qemu() but in
> run_qemu() instead, and only after _filter_testdir.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/195 | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Applied to my block branch.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-29 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27 21:13 [Qemu-devel] [PATCH] iotests: Fix 195 if IMGFMT is part of TEST_DIR Max Reitz
2017-09-27 21:30 ` Eric Blake
2017-09-29 12:48 ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).