[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU bin
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU binary target |
Date: |
Wed, 29 Jan 2020 22:23:23 +0100 |
We already use the 'arch' tag in Avocado tests. Tests can set
it to restrict their use on a particular target architecture.
If the QEMU binary does not target the required architecture,
the tests will be cancelled (skipped):
$ avocado --show=app run tests/acceptance/boot_linux_console.py
...
(14/19) BootLinuxConsole.test_arm_cubieboard_initrd: CANCEL: Test expects
arch 'arm' while QEMU binary is targetting 'mips' (0.16 s)
(15/19) BootLinuxConsole.test_arm_cubieboard_sata: CANCEL: Test expects arch
'arm' while QEMU binary is targetting 'mips' (0.18 s)
(16/19) BootLinuxConsole.test_s390x_s390_ccw_virtio: CANCEL: Test expects
arch 's390x' while QEMU binary is targetting 'mips' (0.14 s)
(17/19) BootLinuxConsole.test_alpha_clipper: CANCEL: Test expects arch
'alpha' while QEMU binary is targetting 'mips' (0.16 s)
(18/19) BootLinuxConsole.test_ppc64_pseries: CANCEL: Test expects arch
'ppc64' while QEMU binary is targetting 'mips' (0.18 s)
(19/19) BootLinuxConsole.test_m68k_q800: CANCEL: Test expects arch 'm68k'
while QEMU binary is targetting 'mips' (0.17 s)
RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 1 | WARN 0 | INTERRUPT 0 |
CANCEL 16
JOB TIME : 19.18 s
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index 67c75822d5..e7d5affe24 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -19,6 +19,7 @@ import avocado
SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
+from qemu.binutils import binary_get_arch
from qemu.binutils import binary_get_version
from qemu.machine import QEMUMachine
@@ -142,6 +143,14 @@ class Test(avocado.Test):
if bin_v[0] < min_v[0] or bin_v[1] < min_v[1] or bin_v[2] <
min_v[2]:
self.cancel(fmt.format(min_version, bin_v[0], bin_v[1],
bin_v[2]))
+ # Verify architecture
+ if self.arch:
+ fmt = "Test expects arch '{}' while QEMU binary is targetting '{}'"
+ bin_arch = binary_get_arch(self.qemu_bin)
+ logger.debug('arch: {}'.format(bin_arch))
+ if bin_arch != self.arch:
+ self.cancel(fmt.format(self.arch, bin_arch))
+
def _new_vm(self, *args):
vm = QEMUMachine(self.qemu_bin, sock_dir=tempfile.mkdtemp())
if args:
--
2.21.1
- [PATCH v2 03/29] python/qemu: Add binutils::binary_get_version(), (continued)
[PATCH v2 05/29] tests/acceptance: Restrict X86CPUModelAliases test to QEMU >= 4.1, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 06/29] python/qemu: Add binutils::binary_get_arch(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU binary target,
Philippe Mathieu-Daudé <=
[PATCH v2 08/29] python/qemu: Add binutils::binary_get_machines(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 10/29] python/qemu: Add binutils::binary_get_qom_implementations(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 09/29] tests/acceptance: Use 'machine' tag to check if available in QEMU binary, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 11/29] python/qemu: Add binutils::binary_get_accels(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 12/29] python/qemu/accel: Use binutils::binary_get_accels(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 13/29] python/qemu: Add binutils::binary_get_devices(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 15/29] tests: rename virtio_seg_max_adjust to virtio_check_params, Philippe Mathieu-Daudé, 2020/01/29