All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image
@ 2018-07-17 23:37 Philippe Mathieu-Daudé
  2018-07-18  7:25 ` Daniel P. Berrangé
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-07-17 23:37 UTC (permalink / raw)
  To: John Snow, Kevin Wolf, Fam Zheng, Max Reitz, Daniel P. Berrange,
	Eduardo Habkost
  Cc: qemu-block, qemu-devel, Alex Bennée

I noticed this while running "make docker-test-block@fedora":

$ make docker-test-block@fedora NETWORK=1
  BUILD   fedora
    RUN test-block in qemu:fedora
Configure options:
--enable-werror --prefix=/tmp/qemu-test/install
--python=/usr/bin/python3 --target-list=x86_64-softmmu
...
python            /usr/bin/python3 -B
...

194         - output mismatch (see 194.out.bad)
--- /tmp/qemu-test/src/tests/qemu-iotests/194.out       2018-07-17
22:51:10.000000000 +0000
+++ /tmp/qemu-test/build/tests/qemu-iotests/194.out.bad 2018-07-17
22:58:01.646916625 +0000
@@ -1,18 +1,18 @@
 Launching VMs...
 Launching NBD server on destination...
-{u'return': {}}
-{u'return': {}}
+{'return': {}}
+{'return': {}}

and many more errors, until:

Failures: 045 132 148 152 162 169 194 205 208 218 222
Failed 11 of 49 tests
Test failed: iotests raw

All failures are due to Python2 syntax.
I started to fix but noticed there are too many and this isn't to
correct fix for this release.

I suppose we don't want to use Py3 for iotests.

The bisect was obvious =)

  commit 356dc290f0ef930a24b6af3a0908b1cb58ad47c9
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Tue Jan 16 13:42:17 2018 +0000

    docker: change Fedora images to run with python3

    Fedora has switched to Python 3 by default, so it
    makes sense to use that for testing QEMU builds,
    so we get testing of Python 3 compatibility.

    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

which added:

ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3

I then figured out we can use EXTRA_CONFIGURE_OPTS:

$ make docker-test-block@fedora NETWORK=1 \
  EXTRA_CONFIGURE_OPTS=--python=/usr/bin/python2
  COPY    RUNNER
    RUN test-block in qemu:fedora
Configure options:
--enable-werror --prefix=/tmp/qemu-test/install
--python=/usr/bin/python3 --python=/usr/bin/python2
--target-list=x86_64-softmmu
...
python            /usr/bin/python2 -B
...
Passed all 48 tests
PLATFORM      -- Linux/aarch64 757be6ea0325 4.15.0-20-generic

So let's use this simple workaround :)

  EXTRA_CONFIGURE_OPTS=--python=/usr/bin/python2

Regards,

Phil.

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

* Re: [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image
  2018-07-17 23:37 [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image Philippe Mathieu-Daudé
@ 2018-07-18  7:25 ` Daniel P. Berrangé
  2018-07-18 13:45   ` Eduardo Habkost
  2018-07-18 13:51   ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2018-07-18  7:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: John Snow, Kevin Wolf, Fam Zheng, Max Reitz, Eduardo Habkost,
	qemu-block, qemu-devel, Alex Bennée

On Tue, Jul 17, 2018 at 08:37:58PM -0300, Philippe Mathieu-Daudé wrote:
> I noticed this while running "make docker-test-block@fedora":
> 
> $ make docker-test-block@fedora NETWORK=1
>   BUILD   fedora
>     RUN test-block in qemu:fedora
> Configure options:
> --enable-werror --prefix=/tmp/qemu-test/install
> --python=/usr/bin/python3 --target-list=x86_64-softmmu
> ...
> python            /usr/bin/python3 -B
> ...
> 
> 194         - output mismatch (see 194.out.bad)
> --- /tmp/qemu-test/src/tests/qemu-iotests/194.out       2018-07-17
> 22:51:10.000000000 +0000
> +++ /tmp/qemu-test/build/tests/qemu-iotests/194.out.bad 2018-07-17
> 22:58:01.646916625 +0000
> @@ -1,18 +1,18 @@
>  Launching VMs...
>  Launching NBD server on destination...
> -{u'return': {}}
> -{u'return': {}}
> +{'return': {}}
> +{'return': {}}
> 
> and many more errors, until:
> 
> Failures: 045 132 148 152 162 169 194 205 208 218 222
> Failed 11 of 49 tests
> Test failed: iotests raw
> 
> All failures are due to Python2 syntax.
> I started to fix but noticed there are too many and this isn't to
> correct fix for this release.

Were they all due to the unicode string prefix, or where there
difference failures too ?

The unicode string prefix could probably be fixed once by changing
the log() method in iotests.py to have a built-in filter that
chomps the leading 'u'


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 :|

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

* Re: [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image
  2018-07-18  7:25 ` Daniel P. Berrangé
@ 2018-07-18 13:45   ` Eduardo Habkost
  2018-07-18 13:51   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 4+ messages in thread
From: Eduardo Habkost @ 2018-07-18 13:45 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Philippe Mathieu-Daudé,
	John Snow, Kevin Wolf, Fam Zheng, Max Reitz, qemu-block,
	qemu-devel, Alex Bennée

On Wed, Jul 18, 2018 at 08:25:48AM +0100, Daniel P. Berrangé wrote:
> On Tue, Jul 17, 2018 at 08:37:58PM -0300, Philippe Mathieu-Daudé wrote:
> > I noticed this while running "make docker-test-block@fedora":
> > 
> > $ make docker-test-block@fedora NETWORK=1
> >   BUILD   fedora
> >     RUN test-block in qemu:fedora
> > Configure options:
> > --enable-werror --prefix=/tmp/qemu-test/install
> > --python=/usr/bin/python3 --target-list=x86_64-softmmu
> > ...
> > python            /usr/bin/python3 -B
> > ...
> > 
> > 194         - output mismatch (see 194.out.bad)
> > --- /tmp/qemu-test/src/tests/qemu-iotests/194.out       2018-07-17
> > 22:51:10.000000000 +0000
> > +++ /tmp/qemu-test/build/tests/qemu-iotests/194.out.bad 2018-07-17
> > 22:58:01.646916625 +0000
> > @@ -1,18 +1,18 @@
> >  Launching VMs...
> >  Launching NBD server on destination...
> > -{u'return': {}}
> > -{u'return': {}}
> > +{'return': {}}
> > +{'return': {}}
> > 
> > and many more errors, until:
> > 
> > Failures: 045 132 148 152 162 169 194 205 208 218 222
> > Failed 11 of 49 tests
> > Test failed: iotests raw
> > 
> > All failures are due to Python2 syntax.
> > I started to fix but noticed there are too many and this isn't to
> > correct fix for this release.
> 
> Were they all due to the unicode string prefix, or where there
> difference failures too ?
> 
> The unicode string prefix could probably be fixed once by changing
> the log() method in iotests.py to have a built-in filter that
> chomps the leading 'u'

We can implement more consistent behavior by making the QMP
methods return a dictionary object with a custom __unicode__()
method.

Using JSON when printing QMP messages (instead of the default
repr() output) is probably a good idea everywhere (not just on
iotests).

-- 
Eduardo

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

* Re: [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image
  2018-07-18  7:25 ` Daniel P. Berrangé
  2018-07-18 13:45   ` Eduardo Habkost
@ 2018-07-18 13:51   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-07-18 13:51 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: John Snow, Kevin Wolf, Fam Zheng, Max Reitz, Eduardo Habkost,
	qemu-block, qemu-devel, Alex Bennée

Hi Daniel,

On 07/18/2018 04:25 AM, Daniel P. Berrangé wrote:
> On Tue, Jul 17, 2018 at 08:37:58PM -0300, Philippe Mathieu-Daudé wrote:
>> I noticed this while running "make docker-test-block@fedora":
>>
>> $ make docker-test-block@fedora NETWORK=1
>>   BUILD   fedora
>>     RUN test-block in qemu:fedora
>> Configure options:
>> --enable-werror --prefix=/tmp/qemu-test/install
>> --python=/usr/bin/python3 --target-list=x86_64-softmmu
>> ...
>> python            /usr/bin/python3 -B
>> ...
>>
>> 194         - output mismatch (see 194.out.bad)
>> --- /tmp/qemu-test/src/tests/qemu-iotests/194.out       2018-07-17
>> 22:51:10.000000000 +0000
>> +++ /tmp/qemu-test/build/tests/qemu-iotests/194.out.bad 2018-07-17
>> 22:58:01.646916625 +0000
>> @@ -1,18 +1,18 @@
>>  Launching VMs...
>>  Launching NBD server on destination...
>> -{u'return': {}}
>> -{u'return': {}}
>> +{'return': {}}
>> +{'return': {}}
>>
>> and many more errors, until:
>>
>> Failures: 045 132 148 152 162 169 194 205 208 218 222
>> Failed 11 of 49 tests
>> Test failed: iotests raw
>>
>> All failures are due to Python2 syntax.
>> I started to fix but noticed there are too many and this isn't to
>> correct fix for this release.
> 
> Were they all due to the unicode string prefix, or where there
> difference failures too ?

3 more kinds:

148         [failed, exit status 1] - output mismatch (see 148.out.bad)
--- /tmp/qemu-test/src/tests/qemu-iotests/148.out	2018-07-18
13:20:17.000000000 +0000
+++ /tmp/qemu-test/build/tests/qemu-iotests/148.out.bad	2018-07-18
13:25:58.649302935 +0000
@@ -1,5 +1,8 @@
-..
-----------------------------------------------------------------------
-Ran 2 tests
-
-OK
+Traceback (most recent call last):
+  File "148", line 139, in <module>
+    iotests.verify_quorum()
+  File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 657, in
verify_quorum
+    if not supports_quorum():
+  File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 653, in
supports_quorum
+    return 'quorum' in qemu_img_pipe('--help')
+TypeError: a bytes-like object is required, not 'str'

169         [failed, exit status 1] - output mismatch (see 169.out.bad)
--- /tmp/qemu-test/src/tests/qemu-iotests/169.out	2018-07-18
13:20:17.000000000 +0000
+++ /tmp/qemu-test/build/tests/qemu-iotests/169.out.bad	2018-07-18
13:26:49.594192720 +0000
@@ -1,5 +1,4 @@
-................
-----------------------------------------------------------------------
-Ran 16 tests
-
-OK
+Traceback (most recent call last):
+  File "169", line 26, in <module>
+    import new
+ModuleNotFoundError: No module named 'new'

205         [failed, exit status 1] - output mismatch (see 205.out.bad)
--- /tmp/qemu-test/src/tests/qemu-iotests/205.out	2018-07-18
13:20:17.000000000 +0000
+++ /tmp/qemu-test/build/tests/qemu-iotests/205.out.bad	2018-07-18
13:27:46.775187975 +0000
@@ -1,5 +1,97 @@
-.......
+EEEFFFF
+======================================================================
+ERROR: test_connect_after_remove_default (__main__.TestNbdServerRemove)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "205", line 96, in test_connect_after_remove_default
+    self.do_test_connect_after_remove()
+  File "205", line 87, in do_test_connect_after_remove
+    self.assertReadOk(qemu_io(*args))
+  File "205", line 71, in assertReadOk
+    filter_qemu_io(qemu_io_output).strip(),
+  File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 218, in
filter_qemu_io
+    msg = filter_win32(msg)
+  File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 214, in
filter_win32
+    return win32_re.sub("", msg)
+TypeError: cannot use a string pattern on a bytes-like object

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

end of thread, other threads:[~2018-07-18 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 23:37 [Qemu-devel] qemu-iotests: workaround to avoid Python3 while running tests on Fedora Docker image Philippe Mathieu-Daudé
2018-07-18  7:25 ` Daniel P. Berrangé
2018-07-18 13:45   ` Eduardo Habkost
2018-07-18 13:51   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.