[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/23] tests/avocado: Do not run tests that require libslirp if it
From: |
Thomas Huth |
Subject: |
[PULL 18/23] tests/avocado: Do not run tests that require libslirp if it is not available |
Date: |
Tue, 30 Aug 2022 20:40:07 +0200 |
Some avocado tests blindly assume that QEMU has been compiled with libslirp
enabled and fail badly if it is missing. Add a proper check to cancel the
tests in this case.
Message-Id: <20220824151122.704946-6-thuth@redhat.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/avocado/avocado_qemu/__init__.py | 7 +++++++
tests/avocado/info_usernet.py | 1 +
tests/avocado/replay_linux.py | 1 +
3 files changed, 9 insertions(+)
diff --git a/tests/avocado/avocado_qemu/__init__.py
b/tests/avocado/avocado_qemu/__init__.py
index 9d17a287cf..3b5b8e7f2d 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -299,6 +299,12 @@ def require_accelerator(self, accelerator):
self.cancel("%s accelerator does not seem to be "
"available" % accelerator)
+ def require_netdev(self, netdevname):
+ netdevhelp = run_cmd([self.qemu_bin,
+ '-M', 'none', '-netdev', 'help'])[0];
+ if netdevhelp.find('\n' + netdevname + '\n') < 0:
+ self.cancel('no support for user networking')
+
def _new_vm(self, name, *args):
self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
@@ -550,6 +556,7 @@ def _set_distro(self):
def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
super().setUp()
+ self.require_netdev('user')
self._set_distro()
self.vm.add_args('-smp', self.smp)
self.vm.add_args('-m', self.memory)
diff --git a/tests/avocado/info_usernet.py b/tests/avocado/info_usernet.py
index dc01f74150..b862a47dba 100644
--- a/tests/avocado/info_usernet.py
+++ b/tests/avocado/info_usernet.py
@@ -16,6 +16,7 @@
class InfoUsernet(QemuSystemTest):
def test_hostfwd(self):
+ self.require_netdev('user')
self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
self.vm.launch()
res = self.vm.command('human-monitor-command',
diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py
index e1f9981a34..a76dd507fc 100644
--- a/tests/avocado/replay_linux.py
+++ b/tests/avocado/replay_linux.py
@@ -55,6 +55,7 @@ def vm_add_disk(self, vm, path, id, device):
'%s,drive=disk%s-rr%s' % (device, id, bus_string))
def launch_and_wait(self, record, args, shift):
+ self.require_netdev('user')
vm = self.get_vm()
vm.add_args('-smp', '1')
vm.add_args('-m', '1024')
--
2.31.1
- [PULL 09/23] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32, (continued)
- [PULL 09/23] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32, Thomas Huth, 2022/08/30
- [PULL 03/23] tests: Use g_mkdir_with_parents(), Thomas Huth, 2022/08/30
- [PULL 06/23] tests/qtest: Adapt {m48t59,rtc}-test cases for win32, Thomas Huth, 2022/08/30
- [PULL 10/23] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32, Thomas Huth, 2022/08/30
- [PULL 08/23] tests/qtest: Build cases that use memory-backend-file for posix only, Thomas Huth, 2022/08/30
- [PULL 11/23] tests/qtest: libqos: Drop inclusion of <sys/wait.h>, Thomas Huth, 2022/08/30
- [PULL 07/23] tests/qtest: Build e1000e-test for posix only, Thomas Huth, 2022/08/30
- [PULL 17/23] tests/vm: Add libslirp to the VM tests, Thomas Huth, 2022/08/30
- [PULL 19/23] tests/avocado: Fix trivial typo, Thomas Huth, 2022/08/30
- [PULL 01/23] tests/qtest: Use g_setenv(), Thomas Huth, 2022/08/30
- [PULL 18/23] tests/avocado: Do not run tests that require libslirp if it is not available,
Thomas Huth <=
- [PULL 21/23] gitlab-ci: Only use one process in Windows jobs for compilation, Thomas Huth, 2022/08/30
- [PULL 22/23] tests/qtest/ac97-test: Correct reference to driver, Thomas Huth, 2022/08/30
- [PULL 12/23] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h, Thomas Huth, 2022/08/30
- [PULL 14/23] tests/qtest: machine-none-test: Use double quotes to pass the cpu option, Thomas Huth, 2022/08/30
- [PULL 13/23] tests/qtest: device-plug-test: Reverse the usage of double/single quotes, Thomas Huth, 2022/08/30
- [PULL 15/23] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32, Thomas Huth, 2022/08/30
- [PULL 16/23] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option, Thomas Huth, 2022/08/30
- [PULL 23/23] tests/avocado/migration: Get find_free_port() from the ports, Thomas Huth, 2022/08/30
- [PULL 20/23] docs/devel/testing: fix minor typo, Thomas Huth, 2022/08/30
- Re: [PULL 00/23] First testing patches for QEMU 7.2, Stefan Hajnoczi, 2022/08/31