From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P . Berrange" <berrange@redhat.com>
Subject: [PATCH v2 02/15] tests/functional: Move the check for the parameters from avocado to functional
Date: Mon, 14 Apr 2025 13:30:16 +0200 [thread overview]
Message-ID: <20250414113031.151105-3-thuth@redhat.com> (raw)
In-Reply-To: <20250414113031.151105-1-thuth@redhat.com>
From: Thomas Huth <thuth@redhat.com>
test_x86_64_pc in tests/avocado/boot_linux_console.py only checks
whether the kernel parameters have correctly been passed to the
kernel in the guest by looking for them in the console output of the
guest. Let's move that to the functional test framework now, but
instead of doing it in a separate test, let's do it for all tuxrun
tests instead, so it is done automatically for all targets that have
a tuxrun test.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/avocado/boot_linux_console.py | 34 ------------------------
tests/functional/qemu_test/tuxruntest.py | 9 ++++---
2 files changed, 5 insertions(+), 38 deletions(-)
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index c15f39ae1f3..cbb1e2fb506 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -9,17 +9,9 @@
# later. See the COPYING file in the top-level directory.
import os
-import lzma
-import gzip
import shutil
-from avocado import skip
-from avocado import skipUnless
-from avocado import skipUnless
from avocado_qemu import QemuSystemTest
-from avocado_qemu import exec_command
-from avocado_qemu import exec_command_and_wait_for_pattern
-from avocado_qemu import interrupt_interactive_console_until_pattern
from avocado_qemu import wait_for_console_pattern
from avocado.utils import process
from avocado.utils import archive
@@ -68,29 +60,3 @@ def extract_from_rpm(self, rpm, path):
process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True)
os.chdir(cwd)
return os.path.normpath(os.path.join(self.workdir, path))
-
-class BootLinuxConsole(LinuxKernelTest):
- """
- Boots a Linux kernel and checks that the console is operational and the
- kernel command line is properly passed from QEMU to the kernel
- """
- timeout = 90
-
- def test_x86_64_pc(self):
- """
- :avocado: tags=arch:x86_64
- :avocado: tags=machine:pc
- """
- kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
- '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
- '/vmlinuz')
- kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
- kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-
- self.vm.set_console()
- kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
- self.vm.add_args('-kernel', kernel_path,
- '-append', kernel_command_line)
- self.vm.launch()
- console_pattern = 'Kernel command line: %s' % kernel_command_line
- self.wait_for_console_pattern(console_pattern)
diff --git a/tests/functional/qemu_test/tuxruntest.py b/tests/functional/qemu_test/tuxruntest.py
index ad74156f9c5..c2bd5baaae9 100644
--- a/tests/functional/qemu_test/tuxruntest.py
+++ b/tests/functional/qemu_test/tuxruntest.py
@@ -77,12 +77,12 @@ def prepare_run(self, kernel, disk, drive, dtb=None, console_index=0):
blockdev = "driver=raw,file.driver=file," \
+ f"file.filename={disk},node-name=hd0"
- kcmd_line = self.KERNEL_COMMON_COMMAND_LINE
- kcmd_line += f" root=/dev/{self.root}"
- kcmd_line += f" console={self.console}"
+ self.kcmd_line = self.KERNEL_COMMON_COMMAND_LINE
+ self.kcmd_line += f" root=/dev/{self.root}"
+ self.kcmd_line += f" console={self.console}"
self.vm.add_args('-kernel', kernel,
- '-append', kcmd_line,
+ '-append', self.kcmd_line,
'-blockdev', blockdev)
# Sometimes we need extra devices attached
@@ -103,6 +103,7 @@ def run_tuxtest_tests(self, haltmsg):
wait to exit cleanly.
"""
ps1='root@tuxtest:~#'
+ self.wait_for_console_pattern(self.kcmd_line)
self.wait_for_console_pattern('tuxtest login:')
exec_command_and_wait_for_pattern(self, 'root', ps1)
exec_command_and_wait_for_pattern(self, 'cat /proc/interrupts', ps1)
--
2.49.0
next prev parent reply other threads:[~2025-04-14 11:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 11:30 [PATCH v2 00/15] Convert remaining Avocado tests to functional Thomas Huth
2025-04-14 11:30 ` [PATCH v2 01/15] gitlab-ci: Remove the avocado tests from the CI pipelines Thomas Huth
2025-04-14 11:30 ` Thomas Huth [this message]
2025-04-14 11:30 ` [PATCH v2 03/15] tests/functional: Convert reverse_debugging tests to the functional framework Thomas Huth
2025-04-14 11:51 ` Daniel P. Berrangé
2025-04-14 11:30 ` [PATCH v2 04/15] tests/functional: Convert the i386 replay avocado test Thomas Huth
2025-04-14 11:30 ` [PATCH v2 05/15] tests/avocado: Remove the LinuxKernelTest class Thomas Huth
2025-04-14 11:30 ` [PATCH v2 06/15] tests/functional: Convert the 32-bit big endian Wheezy mips test Thomas Huth
2025-04-14 11:30 ` [PATCH v2 07/15] tests/functional: Convert the 32-bit little " Thomas Huth
2025-04-14 11:30 ` [PATCH v2 08/15] tests/functional: Convert the 64-bit " Thomas Huth
2025-04-14 11:30 ` [PATCH v2 09/15] tests/functional: Convert the 64-bit big " Thomas Huth
2025-04-14 11:30 ` [PATCH v2 10/15] tests/avocado: Remove the boot_linux.py tests Thomas Huth
2025-04-14 11:30 ` [PATCH v2 11/15] tests/functional: Use the tuxrun kernel for the x86 replay test Thomas Huth
2025-04-14 11:30 ` [PATCH v2 12/15] tests/functional: Use the tuxrun kernel for the aarch64 " Thomas Huth
2025-04-14 11:30 ` [PATCH v2 13/15] tests/functional: Convert the SMMU test to the functional framework Thomas Huth
2025-04-14 11:30 ` [PATCH v2 14/15] gitlab-ci: Update QEMU_JOB_AVOCADO and QEMU_CI_AVOCADO_TESTING Thomas Huth
2025-04-14 11:30 ` [PATCH v2 15/15] Remove the remainders of the Avocado tests Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414113031.151105-3-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=berrange@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).