From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Fam Zheng <famz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-3.1] qemu-iotests: Adapt to moved location of StringIO module in py3
Date: Wed, 18 Jul 2018 08:27:42 +0100 [thread overview]
Message-ID: <20180718072742.GC9812@redhat.com> (raw)
In-Reply-To: <20180717234015.22700-1-f4bug@amsat.org>
On Tue, Jul 17, 2018 at 08:40:15PM -0300, Philippe Mathieu-Daudé wrote:
> Since 356dc290f the Fedora image default to Python3.
>
> This fixes:
>
> $ make docker-test-block@fedora
> [...]
> 045 [failed, exit status 1] - output mismatch (see 045.out.bad)
> --- /tmp/qemu-test/src/tests/qemu-iotests/045.out 2018-07-17 16:56:18.000000000 +0000
> +++ /tmp/qemu-test/build/tests/qemu-iotests/045.out.bad 2018-07-17 17:19:22.448409007 +0000
> @@ -1,5 +1,6 @@
> -...........
> -----------------------------------------------------------------------
> -Ran 11 tests
> -
> -OK
> +Traceback (most recent call last):
> + File "045", line 178, in <module>
> + iotests.main(supported_fmts=['raw'])
> + File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 682, in main
> + import StringIO
> +ModuleNotFoundError: No module named 'StringIO'
> 132 [failed, exit status 1] - output mismatch (see 132.out.bad)
> 148 [failed, exit status 1] - output mismatch (see 148.out.bad)
> 152 [failed, exit status 1] - output mismatch (see 152.out.bad)
>
> Failures: 045 132 148 152
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> tests/qemu-iotests/iotests.py | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 4e67fbbe96..2fc7165fb9 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -679,13 +679,17 @@ def main(supported_fmts=[], supported_oses=['linux'], supported_cache_modes=[],
>
> # We need to filter out the time taken from the output so that qemu-iotest
> # can reliably diff the results against master output.
> - import StringIO
> + try:
> + from StringIO import StringIO
> + except ImportError:
> + from io import StringIO
> +
> if debug:
> output = sys.stdout
> verbosity = 2
> sys.argv.remove('-d')
> else:
> - output = StringIO.StringIO()
> + output = StringIO()
>
> logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2018-07-18 7:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 23:40 [Qemu-devel] [PATCH for-3.1] qemu-iotests: Adapt to moved location of StringIO module in py3 Philippe Mathieu-Daudé
2018-07-18 7:27 ` Daniel P. Berrangé [this message]
2018-07-18 14:53 ` Eduardo Habkost
2018-07-18 15:02 ` Philippe Mathieu-Daudé
2018-07-18 15:05 ` Eduardo Habkost
2018-07-18 15:22 ` Philippe Mathieu-Daudé
2018-07-18 16:01 ` Eduardo Habkost
2018-07-18 15:28 ` [Qemu-devel] [Qemu-block] " John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180718072742.GC9812@redhat.com \
--to=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).