[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 14/29] tests/acceptance: Use 'device' tags to check availa
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH v2 14/29] tests/acceptance: Use 'device' tags to check availability in QEMU binary |
Date: |
Wed, 29 Jan 2020 22:23:30 +0100 |
We already use the 'device' tag in Avocado tests.
If any of the requested device is not available in the QEMU binary,
the tests will be cancelled (skipped).
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
RFC because I'm not certain, we might want to find bugs where
a device is missing in the built binary...
---
tests/acceptance/avocado_qemu/__init__.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index 53ec8512d1..44062aea56 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -20,6 +20,7 @@ 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_devices
from qemu.binutils import binary_get_machines
from qemu.binutils import binary_get_version
from qemu.machine import QEMUMachine
@@ -158,6 +159,16 @@ class Test(avocado.Test):
if self.machine not in binary_get_machines(self.qemu_bin):
self.cancel(fmt.format(self.machine))
+ # Verify devices
+ self.devices = self.tags.get('device', [])
+ bin_devices = binary_get_devices(self.qemu_bin)
+ logger.debug('devices: {}'.format(self.devices))
+ fmt = "Test expects device '{}' which is missing from QEMU binary"
+ for dev in self.devices:
+ logger.debug(dev)
+ if dev not in bin_devices:
+ self.cancel(fmt.format(dev))
+
def _new_vm(self, *args):
vm = QEMUMachine(self.qemu_bin, sock_dir=tempfile.mkdtemp())
if args:
--
2.21.1
- [PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU binary target, (continued)
- [PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU binary target, Philippe Mathieu-Daudé, 2020/01/29
- [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
- [RFC PATCH v2 14/29] tests/acceptance: Use 'device' tags to check availability in QEMU binary,
Philippe Mathieu-Daudé <=
- [PATCH v2 16/29] tests/acceptance/virtio_check_params: Only remove listed machines, Philippe Mathieu-Daudé, 2020/01/29
- [PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging, Philippe Mathieu-Daudé, 2020/01/29
- [PATCH v2 19/29] tests/acceptance/virtio_check_params: Only test Xen as superuser, Philippe Mathieu-Daudé, 2020/01/29
- [PATCH v2 18/29] tests/acceptance/virtio_check_params: List machine being tested, Philippe Mathieu-Daudé, 2020/01/29
- [PATCH v2 20/29] tests/acceptance/virtio_check_params: Skip test if arch is not supported, Philippe Mathieu-Daudé, 2020/01/29
- [RFC PATCH v2 21/29] tests/acceptance/virtio_check_params: Kludge to skip tests on MIPS, Philippe Mathieu-Daudé, 2020/01/29