qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 13/24] tests/functional: Convert the s390x avocado tests i


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 13/24] tests/functional: Convert the s390x avocado tests into standalone tests
Date: Thu, 1 Aug 2024 19:11:01 +0200
User-agent: Mozilla Thunderbird

On 30/7/24 19:03, Daniel P. Berrangé wrote:
From: Thomas Huth <thuth@redhat.com>

These tests use archive.lzma_uncompress() from the Avocado utils,
so provide a small helper function for this, based on the
standard lzma module from Python instead.

And while we're at it, replace the MD5 hashes in the topology test
with proper SHA256 hashes, since MD5 should not be used anymore
nowadays.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
  MAINTAINERS                                   |  4 +-
  tests/functional/meson.build                  |  6 ++
  tests/functional/qemu_test/utils.py           | 14 +++
  .../test_s390x_ccw_virtio.py}                 | 79 ++++++++---------
  .../test_s390x_topology.py}                   | 86 ++++++++-----------
  5 files changed, 94 insertions(+), 95 deletions(-)
  rename tests/{avocado/machine_s390_ccw_virtio.py => 
functional/test_s390x_ccw_virtio.py} (85%)
  mode change 100644 => 100755
  rename tests/{avocado/s390_topology.py => functional/test_s390x_topology.py} 
(88%)
  mode change 100644 => 100755

Conversion LGTM, so:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Now while testing I'm getting errors, but maybe pre-existing...

pyvenv/bin/meson test --no-rebuild -t 1 --setup thorough --num-processes 1 --print-errorlogs --suite func-s390x --suite func-s390x-thorough qemu:func-thorough+func-s390x-thorough+thorough / func-s390x-s390x_ccw_virtio time out (After 180.0 seconds) 1/5 qemu:func-thorough+func-s390x-thorough+thorough / func-s390x-s390x_ccw_virtio TIMEOUT 180.05s killed by signal 15 SIGTERM ▶ 2/5 test_empty_cpu_model.EmptyCPUModel.test FAIL 2/5 qemu:func-quick+func-s390x / func-s390x-empty_cpu_model ERROR 0.21s exit status 1
stderr:
Traceback (most recent call last):
File "/home/user/qemu/tests/functional/test_empty_cpu_model.py", line 21, in test
    self.assertRegex(self.vm.get_log(), r'-cpu option cannot be empty')
AssertionError: Regex didn't match: '-cpu option cannot be empty' not found in 'Could not access KVM kernel module: Permission denied\nqemu-system-s390x: failed to initialize kvm: Permission denied\n'


(test program exited with status code 1)
▶ 4/5 test_version.Version.test_qmp_human_info_version FAIL
Traceback (most recent call last):
File "/home/user/qemu/python/qemu/qmp/protocol.py", line 425, in _session_guard
    await coro
File "/home/user/qemu/python/qemu/qmp/qmp_client.py", line 250, in _establish_session
    self._greeting = await self._get_greeting()
File "/home/user/qemu/python/qemu/qmp/qmp_client.py", line 270, in _get_greeting
    msg = await self._recv()
  File "/home/user/qemu/python/qemu/qmp/protocol.py", line 1009, in _recv
    message = await self._do_recv()
File "/home/user/qemu/python/qemu/qmp/qmp_client.py", line 402, in _do_recv
    msg_bytes = await self._readline()
File "/home/user/qemu/python/qemu/qmp/protocol.py", line 977, in _readline
    raise EOFError
EOFError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/user/qemu/python/qemu/machine/machine.py", line 448, in launch
    self._launch()
File "/home/user/qemu/python/qemu/machine/machine.py", line 487, in _launch
    self._post_launch()
File "/home/user/qemu/python/qemu/machine/machine.py", line 381, in _post_launch
    self._qmp.connect()
  File "/home/user/qemu/python/qemu/qmp/legacy.py", line 153, in connect
    self._sync(
  File "/home/user/qemu/python/qemu/qmp/legacy.py", line 102, in _sync
    return self._aloop.run_until_complete(
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
    return await fut
  File "/home/user/qemu/python/qemu/qmp/protocol.py", line 382, in connect
    await self._session_guard(
File "/home/user/qemu/python/qemu/qmp/protocol.py", line 456, in _session_guard
    raise ConnectError(emsg, err) from err
qemu.qmp.protocol.ConnectError: Failed to establish session: EOFError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/user/qemu/tests/functional/test_version.py", line 22, in test_qmp_human_info_version
    self.vm.launch()
File "/home/user/qemu/python/qemu/machine/machine.py", line 461, in launch
    raise VMLaunchFailure(
qemu.machine.machine.VMLaunchFailure: ConnectError: Failed to establish session: EOFError
        Exit code: 1
Command: qemu-system-s390x -display none -vga none -chardev socket,id=mon,fd=5 -mon chardev=mon,mode=control -machine none -nodefaults
        Output: Could not access KVM kernel module: Permission denied
qemu-system-s390x: failed to initialize kvm: Permission denied

5/5 qemu:func-thorough+func-s390x-thorough+thorough / func-s390x-s390x_topology SKIP 1.14s 0 subtests passed

Summary of Failures:

1/5 qemu:func-thorough+func-s390x-thorough+thorough / func-s390x-s390x_ccw_virtio TIMEOUT 180.05s killed by signal 15 SIGTERM 2/5 qemu:func-quick+func-s390x / func-s390x-empty_cpu_model ERROR 0.21s exit status 1 4/5 qemu:func-quick+func-s390x / func-s390x-version ERROR 0.25s exit status 1

I'm surprised by "Could not access KVM kernel module" because
kvm_available() checks for RW access:

  def kvm_available(target_arch: Optional[str] = None,
                    qemu_bin: Optional[str] = None) -> bool:
      if not os.access("/dev/kvm", os.R_OK | os.W_OK):
          return False

Maybe missing require_accelerator() in tests?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]