All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	qemu-ppc@nongnu.org
Subject: Re: [PATCH v2 5/7] tests/functional: skip memaddr tests on 32-bit builds
Date: Wed, 5 Mar 2025 11:45:36 +0000	[thread overview]
Message-ID: <Z8g5YC6_zkQXBv_z@redhat.com> (raw)
In-Reply-To: <a6f68dd5-379b-4868-959a-5b4b9a7e97ba@redhat.com>

On Wed, Mar 05, 2025 at 12:32:31PM +0100, Thomas Huth wrote:
> On 28/02/2025 11.27, Daniel P. Berrangé wrote:
> > If the QEMU binary was built for a 32-bit ELF target we cannot run the
> > memory address space tests as they all require ability to address more
> > RAM that can be represented on 32-bit.
> > 
> > We can't use a decorator to skip the tests as we need setUp() to run to
> > pick the QEMU binary, thus we must call a method at the start of each
> > test to check and skip it. The functional result is effectively the
> > same as using a decorator, just less pretty. This code will go away when
> > 32-bit hosts are full dropped from QEMU.
> > 
> > The code allows any non-ELF target since all macOS versions supported
> > at 64-bit only and we already dropped support for 32-bit Windows.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   tests/functional/test_mem_addr_space.py | 34 +++++++++++++++++++++++++
> >   1 file changed, 34 insertions(+)
> > 
> > diff --git a/tests/functional/test_mem_addr_space.py b/tests/functional/test_mem_addr_space.py
> > index bb0cf062ca..c8bde77e51 100755
> > --- a/tests/functional/test_mem_addr_space.py
> > +++ b/tests/functional/test_mem_addr_space.py
> > @@ -20,6 +20,25 @@ class MemAddrCheck(QemuSystemTest):
> >       # this reason.
> >       DELAY_Q35_BOOT_SEQUENCE = 1
> > +    # This helper can go away when the 32-bit host deprecation
> > +    # turns into full & final removal of support.
> > +    def ensure_64bit_binary(self):
> > +        with open(self.qemu_bin, "rb") as fh:
> > +            ident = fh.read(4)
> > +
> > +            # "\x7fELF"
> > +            if ident != bytes([0x7f, 0x45, 0x4C, 0x46]):
> > +                # Non-ELF file implies macOS or Windows which
> > +                # we already assume to be 64-bit only
> > +                return
> > +
> > +            # bits == 1 -> 32-bit; bits == 2 -> 64-bit
> > +            bits = int.from_bytes(fh.read(1))
> 
> This unfortunately fails in the Centos CI job (so I guess there's something
> different with Python 3.8):
> 
>  https://gitlab.com/thuth/qemu/-/jobs/9316861212#L131
> 
> Looking at the test log:
> 
> Traceback (most recent call last):
>   File "/builds/thuth/qemu/tests/functional/test_mem_addr_space.py", line
> 335, in test_phybits_ok_tcg_q35_intel_cxl
>     self.ensure_64bit_binary()
>   File "/builds/thuth/qemu/tests/functional/test_mem_addr_space.py", line
> 36, in ensure_64bit_binary
>     bits = int.from_bytes(fh.read(1))
> TypeError: from_bytes() missing required argument 'byteorder' (pos 2)
> 
> Could you please have a look?

It will want

     bits = int.from_bytes(fh.read(1), byteorder='little')

From the docs

  https://docs.python.org/3/library/stdtypes.html#int.from_bytes

'byteorder' gained  default value only in py 3.11, so that explains the
cnetos failure with 3.8

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



  reply	other threads:[~2025-03-05 11:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 10:27 [PATCH v2 0/7] tests/functional: a few misc cleanups and fixes Daniel P. Berrangé
2025-02-28 10:27 ` [PATCH v2 1/7] tests/functional: remove unused 'bin_prefix' variable Daniel P. Berrangé
2025-02-28 16:52   ` Richard Henderson
2025-02-28 10:27 ` [PATCH v2 2/7] tests/functional: set 'qemu_bin' as an object level field Daniel P. Berrangé
2025-02-28 16:53   ` Richard Henderson
2025-02-28 10:27 ` [PATCH v2 3/7] tests/functional: remove all class level fields Daniel P. Berrangé
2025-02-28 16:53   ` Richard Henderson
2025-03-05 11:51   ` Thomas Huth
2025-03-05 11:55     ` Daniel P. Berrangé
2025-02-28 10:27 ` [PATCH v2 4/7] tests/functional: reduce tuxrun maxmem to work on 32-bit hosts Daniel P. Berrangé
2025-02-28 16:54   ` Richard Henderson
2025-03-05  8:59   ` Thomas Huth
2025-02-28 10:27 ` [PATCH v2 5/7] tests/functional: skip memaddr tests on 32-bit builds Daniel P. Berrangé
2025-02-28 17:06   ` Richard Henderson
2025-03-05  9:02   ` Thomas Huth
2025-03-05 11:32   ` Thomas Huth
2025-03-05 11:45     ` Daniel P. Berrangé [this message]
2025-02-28 10:27 ` [PATCH v2 6/7] tests/functional: drop unused 'get_tag' method Daniel P. Berrangé
2025-03-05  9:04   ` Thomas Huth
2025-02-28 10:27 ` [PATCH v2 7/7] tests/functional: stop output from zstd command when uncompressing Daniel P. Berrangé
2025-03-05  9:05   ` Thomas Huth

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=Z8g5YC6_zkQXBv_z@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=danielhb413@gmail.com \
    --cc=harshpb@linux.ibm.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /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 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.