* [Qemu-devel] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc
@ 2019-07-26 7:18 sathnaga
2019-07-26 8:36 ` Cédric Le Goater
2019-07-26 11:49 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
0 siblings, 2 replies; 4+ messages in thread
From: sathnaga @ 2019-07-26 7:18 UTC (permalink / raw)
To: qemu-devel; +Cc: Satheesh Rajendran, qemu-ppc, clg
From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Current acceptance test will not run in powerpc Little endian
environment due the arch name does not match the qemu binary path,
let's handle it.
Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
---
tests/acceptance/avocado_qemu/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index aee5d820ed..a05f0bb530 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -19,6 +19,7 @@ sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
from qemu.machine import QEMUMachine
+
def is_readable_executable_file(path):
return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
@@ -39,6 +40,9 @@ def pick_default_qemu_bin(arch=None):
"""
if arch is None:
arch = os.uname()[4]
+ # qemu binary path does not match arch for powerpc, handle it
+ if 'ppc64le' in arch:
+ arch = 'ppc64'
qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
"qemu-system-%s" % arch)
if is_readable_executable_file(qemu_bin_relative_path):
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc
2019-07-26 7:18 [Qemu-devel] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc sathnaga
@ 2019-07-26 8:36 ` Cédric Le Goater
2019-07-26 11:49 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
1 sibling, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2019-07-26 8:36 UTC (permalink / raw)
To: sathnaga, qemu-devel; +Cc: qemu-ppc, David Gibson
On 26/07/2019 09:18, sathnaga@linux.vnet.ibm.com wrote:
> From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
>
> Current acceptance test will not run in powerpc Little endian
> environment due the arch name does not match the qemu binary path,
> let's handle it.
>
> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> tests/acceptance/avocado_qemu/__init__.py | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index aee5d820ed..a05f0bb530 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -19,6 +19,7 @@ sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
>
> from qemu.machine import QEMUMachine
>
> +
extra new line ^
> def is_readable_executable_file(path):
> return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
>
> @@ -39,6 +40,9 @@ def pick_default_qemu_bin(arch=None):
> """
> if arch is None:
> arch = os.uname()[4]
> + # qemu binary path does not match arch for powerpc, handle it
> + if 'ppc64le' in arch:
> + arch = 'ppc64'
> qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
> "qemu-system-%s" % arch)
> if is_readable_executable_file(qemu_bin_relative_path):
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc
2019-07-26 7:18 [Qemu-devel] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc sathnaga
2019-07-26 8:36 ` Cédric Le Goater
@ 2019-07-26 11:49 ` Greg Kurz
2019-07-29 5:52 ` Satheesh Rajendran
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2019-07-26 11:49 UTC (permalink / raw)
To: sathnaga; +Cc: qemu-ppc, qemu-devel, clg
On Fri, 26 Jul 2019 12:48:09 +0530
sathnaga@linux.vnet.ibm.com wrote:
> From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
>
> Current acceptance test will not run in powerpc Little endian
> environment due the arch name does not match the qemu binary path,
> let's handle it.
>
They do not match because "arch" as returned by uname() is
something different from the "target" in QEMU. This usually
matches, except with bi-endian architectures like ppc64.
Uname "arch" may be ppc64 or ppc64le but "target" is always
ppc64.
> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> ---
> tests/acceptance/avocado_qemu/__init__.py | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index aee5d820ed..a05f0bb530 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -19,6 +19,7 @@ sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
>
> from qemu.machine import QEMUMachine
>
> +
empty line damage
> def is_readable_executable_file(path):
> return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
>
> @@ -39,6 +40,9 @@ def pick_default_qemu_bin(arch=None):
> """
> if arch is None:
> arch = os.uname()[4]
> + # qemu binary path does not match arch for powerpc, handle it
> + if 'ppc64le' in arch:
> + arch = 'ppc64'
We also have other bi-endian targets (arm and aarch64). I'm not
sure teaching pick_default_qemu_bin() about all of them is the
way to go.
What about passing the right target in the first place ?
ie, this in patch 2:
+ def test_ppc64le_pseries(self):
+ """
+ :avocado: tags=arch:ppc64
> qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
> "qemu-system-%s" % arch)
> if is_readable_executable_file(qemu_bin_relative_path):
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc
2019-07-26 11:49 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
@ 2019-07-29 5:52 ` Satheesh Rajendran
0 siblings, 0 replies; 4+ messages in thread
From: Satheesh Rajendran @ 2019-07-29 5:52 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, sathnaga, qemu-devel, clg
On Fri, Jul 26, 2019 at 01:49:00PM +0200, Greg Kurz wrote:
> On Fri, 26 Jul 2019 12:48:09 +0530
> sathnaga@linux.vnet.ibm.com wrote:
>
> > From: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> >
> > Current acceptance test will not run in powerpc Little endian
> > environment due the arch name does not match the qemu binary path,
> > let's handle it.
> >
>
> They do not match because "arch" as returned by uname() is
> something different from the "target" in QEMU. This usually
> matches, except with bi-endian architectures like ppc64.
> Uname "arch" may be ppc64 or ppc64le but "target" is always
> ppc64.
Yes, instead I would reword the commit message to sound like that.
Thanks!
>
> > Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> > ---
> > tests/acceptance/avocado_qemu/__init__.py | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> > index aee5d820ed..a05f0bb530 100644
> > --- a/tests/acceptance/avocado_qemu/__init__.py
> > +++ b/tests/acceptance/avocado_qemu/__init__.py
> > @@ -19,6 +19,7 @@ sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
> >
> > from qemu.machine import QEMUMachine
> >
> > +
>
> empty line damage
>
Sure, I did as pylint complained about, probably can be sent
as seperate commit.
> > def is_readable_executable_file(path):
> > return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
> >
> > @@ -39,6 +40,9 @@ def pick_default_qemu_bin(arch=None):
> > """
> > if arch is None:
> > arch = os.uname()[4]
> > + # qemu binary path does not match arch for powerpc, handle it
> > + if 'ppc64le' in arch:
> > + arch = 'ppc64'
>
> We also have other bi-endian targets (arm and aarch64). I'm not
> sure teaching pick_default_qemu_bin() about all of them is the
> way to go.
>
It is good for the tests where have explicit arch mentioned
but it will not work for platform generic tests like below one
for example,
avocado run version.py
JOB ID : ef3d99cf0232d38e5eb34c1552a8ab44ac77c45c
JOB LOG : /home/sath/tests/results/job-2019-07-29T01.45-ef3d99c/job.log
(1/1) version.py:Version.test_qmp_human_info_version: CANCEL: No QEMU binary defined or found in the source tree (0.00 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1
JOB TIME : 0.35 s
and more over we can preserve arch:ppc64 to run Big Endian guest
image.
> What about passing the right target in the first place ?
>
> ie, this in patch 2:
>
> + def test_ppc64le_pseries(self):
> + """
> + :avocado: tags=arch:ppc64
>
> > qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
> > "qemu-system-%s" % arch)
> > if is_readable_executable_file(qemu_bin_relative_path):
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-29 5:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 7:18 [Qemu-devel] [PATCH 1/2] tests.acceptance.avocado_qemu: Add support for powerpc sathnaga
2019-07-26 8:36 ` Cédric Le Goater
2019-07-26 11:49 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2019-07-29 5:52 ` Satheesh Rajendran
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.