On Fri, 26 Jul 2019 12:48:09 +0530 sathn...@linux.vnet.ibm.com wrote: > From: Satheesh Rajendran <sathn...@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 <sathn...@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):