From 80232dba16dc2e52f7b699af5051d100628ba857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 21 Mar 2023 11:15:35 +0000 Subject: [PATCH] tests/avocado: probe for multi-process support before running test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A recent attempt to let avocado run more tests on the CentOS stream build failed because there was no gating on the multiprocess feature. Like missing accelerators avocado should gracefully skip when the feature is not enabled. In this case we use the existence of the proxy device as a proxy for multi-process support. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Cc: Elena Ufimtseva Cc: Jagannathan Raman Cc: John G Johnson Message-Id: <20230321111752.2681128-1-alex.bennee@linaro.org> --- tests/avocado/avocado_qemu/__init__.py | 10 ++++++++++ tests/avocado/multiprocess.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index a313e88c07e3..cb71f50db91c 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -309,6 +309,16 @@ def require_netdev(self, netdevname): if netdevhelp.find('\n' + netdevname + '\n') < 0: self.cancel('no support for user networking') + def require_multiprocess(self): + """ + Test for the presence of the x-pci-proxy-dev which is required + to support multiprocess. + """ + devhelp = run_cmd([self.qemu_bin, + '-M', 'none', '-device', 'help'])[0]; + if devhelp.find('x-pci-proxy-dev') < 0: + self.cancel('no support for multiprocess device emulation') + def _new_vm(self, name, *args): self._sd = tempfile.TemporaryDirectory(prefix="qemu_") vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir, diff --git a/tests/avocado/multiprocess.py b/tests/avocado/multiprocess.py index 80a3b8f442b9..9112a4cacc6e 100644 --- a/tests/avocado/multiprocess.py +++ b/tests/avocado/multiprocess.py @@ -22,6 +22,7 @@ def do_test(self, kernel_url, initrd_url, kernel_command_line, machine_type): """Main test method""" self.require_accelerator('kvm') + self.require_multiprocess() # Create socketpair to connect proxy and remote processes proxy_sock, remote_sock = socket.socketpair(socket.AF_UNIX,