Skip to content

Commit

Permalink
tests/avocado: probe for multi-process support before running test
Browse files Browse the repository at this point in the history
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 <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Cc: Jagannathan Raman <jag.raman@oracle.com>
Cc: John G Johnson <john.g.johnson@oracle.com>
Message-Id: <20230321111752.2681128-1-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed Mar 22, 2023
1 parent 136b608 commit 80232db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/avocado/avocado_qemu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/avocado/multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 80232db

Please sign in to comment.