[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/20] tests/functional: Fix the aarch64_tcg_plugins test
From: |
Thomas Huth |
Subject: |
[PULL 04/20] tests/functional: Fix the aarch64_tcg_plugins test |
Date: |
Thu, 30 Jan 2025 14:15:18 +0100 |
Unfortunately, this test had not been added to meson.build, so we did
not notice a regression: Looking for 'Kernel panic - not syncing: VFS:'
as the indication for the final boot state of the kernel was a bad
idea since 'Kernel panic - not syncing' is the default failure
message of the LinuxKernelTest class, and since we're now reading
the console input byte by byte instead of linewise (see commit
cdad03b74f75), the failure now triggers before we fully read the
success string. Let's fix this by simply looking for the previous
line in the console output instead.
Also, replace the call to cancel() - this was only available in the
Avocado framework. In the functional framework, we must use skipTest()
instead. While we're at it, also fix the TODO here by looking for the
exact error and only skip the test if the plugins are not available.
Fixes: 3abc545e66 ("tests/functional: Convert the tcg_plugins test")
Fixes: cdad03b74f ("tests/functional: rewrite console handling to be bytewise")
Message-ID: <20250123083625.1498495-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/meson.build | 1 +
tests/functional/test_aarch64_tcg_plugins.py | 15 +++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 3e11b725cb..2b2d8953aa 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -72,6 +72,7 @@ tests_aarch64_system_thorough = [
'aarch64_sbsaref',
'aarch64_sbsaref_alpine',
'aarch64_sbsaref_freebsd',
+ 'aarch64_tcg_plugins',
'aarch64_tuxrun',
'aarch64_virt',
'aarch64_xlnx_versal',
diff --git a/tests/functional/test_aarch64_tcg_plugins.py
b/tests/functional/test_aarch64_tcg_plugins.py
index 01660eb090..7e8beacc83 100755
--- a/tests/functional/test_aarch64_tcg_plugins.py
+++ b/tests/functional/test_aarch64_tcg_plugins.py
@@ -15,6 +15,7 @@
import mmap
import re
+from qemu.machine.machine import VMLaunchFailure
from qemu_test import LinuxKernelTest, Asset
@@ -43,10 +44,12 @@ def run_vm(self, kernel_path, kernel_command_line,
try:
vm.launch()
- except:
- # TODO: probably fails because plugins not enabled but we
- # can't currently probe for the feature.
- self.cancel("TCG Plugins not enabled?")
+ except VMLaunchFailure as excp:
+ if "plugin interface not enabled in this build" in excp.output:
+ self.skipTest("TCG plugins not enabled")
+ else:
+ self.log.info(f"unhandled launch failure: {excp.output}")
+ raise excp
self.wait_for_console_pattern(console_pattern, vm)
# ensure logs are flushed
@@ -65,7 +68,7 @@ def test_aarch64_virt_insn(self):
kernel_path = self.ASSET_KERNEL.fetch()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
'console=ttyAMA0')
- console_pattern = 'Kernel panic - not syncing: VFS:'
+ console_pattern = 'Please append a correct "root=" boot option'
plugin_log = tempfile.NamedTemporaryFile(mode="r+t", prefix="plugin",
suffix=".log")
@@ -91,7 +94,7 @@ def test_aarch64_virt_insn_icount(self):
kernel_path = self.ASSET_KERNEL.fetch()
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
'console=ttyAMA0')
- console_pattern = 'Kernel panic - not syncing: VFS:'
+ console_pattern = 'Please append a correct "root=" boot option'
plugin_log = tempfile.NamedTemporaryFile(mode="r+t", prefix="plugin",
suffix=".log")
--
2.48.1
- [PULL 00/20] Functional tests, s390x improvements and slirp fixes, Thomas Huth, 2025/01/30
- [PULL 01/20] tests/functional/qemu_test/decorators: Fix bad check for imports, Thomas Huth, 2025/01/30
- [PULL 03/20] tests/functional: Convert the migration avocado test, Thomas Huth, 2025/01/30
- [PULL 06/20] tests/functional/test_mips_malta: Fix comment about endianness of the test, Thomas Huth, 2025/01/30
- [PULL 02/20] tests/functional: Fix broken decorators with lamda functions, Thomas Huth, 2025/01/30
- [PULL 04/20] tests/functional: Fix the aarch64_tcg_plugins test,
Thomas Huth <=
- [PULL 05/20] tests/functional: Add a ppc64 mac99 test, Thomas Huth, 2025/01/30
- [PULL 09/20] tests/tcg/s390x: Test modifying code using the MVC instruction, Thomas Huth, 2025/01/30
- [PULL 14/20] tests/functional: Extend PPC 40p test with Linux boot, Thomas Huth, 2025/01/30
- [PULL 15/20] tests/functional: Add a decorator for skipping long running tests, Thomas Huth, 2025/01/30
- [PULL 16/20] tests/functional: Add the ReplayKernelBase class, Thomas Huth, 2025/01/30
- [PULL 11/20] virtio-balloon-pci: Allow setting nvectors, so we can use MSI-X, Thomas Huth, 2025/01/30
- [PULL 13/20] s390x/s390-virtio-ccw: Support plugging PCI-based virtio memory devices, Thomas Huth, 2025/01/30
- [PULL 17/20] tests/functional/test_mipsel_malta: Convert the mipsel replay tests, Thomas Huth, 2025/01/30
- [PULL 10/20] hw/s390x/s390-virtio-ccw: Fix a record/replay deadlock, Thomas Huth, 2025/01/30
- [PULL 20/20] net/slirp: libslirp 4.9.0 compatibility, Thomas Huth, 2025/01/30