From nobody Mon Feb 9 12:43:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620084342; cv=none; d=zohomail.com; s=zohoarc; b=Hj7TEj2QJ4fuBOaVzVoZ28rSZyu0EIT9GWqITKkQFpzV6CwCcYTlwIa+ipnCsa9yFjBkFskTCNCMdLUDELf3NJ1sXpWlR7I3pfdSnvj0Q6arZBteKM4d9ScRJgdU0jfFUM2HN1DdD4vuWlgrnACV+u5ZXNW4EhtIRAjKt6bU420= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620084342; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KMtJt5XBtvo1jrR71Hr9QYznAUGCS99ndKySs7xNSUs=; b=cXNYpiHijB1n/mTJmt+qZt95wfrn250N2YkDne/ZeMcg/hBqSt4oujx3flmXcKWIAWoJzAhIzezfH0+QTa0MaFaWmumF+I7jnM1mxZlXy808yyjRrOXxv1H+fy8BSWTuwZAvQJKwjmwLISViPlJ8E1Fo/qTE3sn5WpNjOVAJRuk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620084342906807.5841174001898; Mon, 3 May 2021 16:25:42 -0700 (PDT) Received: from localhost ([::1]:38846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldhwb-0005FI-LX for importer@patchew.org; Mon, 03 May 2021 19:25:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldhIb-0002l8-Ma for qemu-devel@nongnu.org; Mon, 03 May 2021 18:44:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldhIY-0007OR-32 for qemu-devel@nongnu.org; Mon, 03 May 2021 18:44:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-lHHRBrMZPo-b1q6r0h-Lwg-1; Mon, 03 May 2021 18:44:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6ECE48189C4 for ; Mon, 3 May 2021 22:44:06 +0000 (UTC) Received: from wainer-laptop.localdomain.com (ovpn-116-131.gru2.redhat.com [10.97.116.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6EB36060F; Mon, 3 May 2021 22:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620081856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KMtJt5XBtvo1jrR71Hr9QYznAUGCS99ndKySs7xNSUs=; b=D9ugGKYp1i9RnW4AKaM89xjbNdbDMXe2sYOijIhXWwLxyOv5zABhYN3iWv+vONSIEZ86MA /dUe6vekg2brOeOQmu5bzdvFY9bZBcIKxo4xTSJT/w8ldU2Su7gZWL9epNRhY+LC/fOD2I kQ7wS0fp3p+W7tOfqJkIdPL3jzuOnLQ= X-MC-Unique: lHHRBrMZPo-b1q6r0h-Lwg-1 From: Wainer dos Santos Moschetta To: qemu-devel@nongnu.org Subject: [PATCH 6/7] tests/acceptance: Move wait_for_console_pattern to ConsoleMixIn Date: Mon, 3 May 2021 19:43:25 -0300 Message-Id: <20210503224326.206208-7-wainersm@redhat.com> In-Reply-To: <20210503224326.206208-1-wainersm@redhat.com> References: <20210503224326.206208-1-wainersm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=wainersm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=wainersm@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.698, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: willianr@redhat.com, philmd@redhat.com, crosa@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This moved wait_for_console_pattern() to ConsoleMixIn. By far this change required the most adaptations on tests. Notice that: 1) Some tests from boot_linux_console.py were using the wait_for_console_p= attern() from the avocado_qemu package rather than the overloaded method on the LinuxKernelTest class, and that explains the explict calls to ConsoleMixIn.wait_for_console_pattern(). Likewise in boot_xen.py file. 2) In virtiofs_submounts.py, wait_for_console_pattern() was imported but n= ot used. Signed-off-by: Wainer dos Santos Moschetta --- tests/acceptance/avocado_qemu/__init__.py | 23 +++++++++----------- tests/acceptance/boot_linux_console.py | 14 ++++++------ tests/acceptance/boot_xen.py | 5 +++-- tests/acceptance/linux_ssh_mips_malta.py | 8 +++---- tests/acceptance/machine_arm_canona1100.py | 6 ++--- tests/acceptance/machine_arm_integratorcp.py | 8 +++---- tests/acceptance/machine_arm_n8x0.py | 6 ++--- tests/acceptance/machine_microblaze.py | 8 +++---- tests/acceptance/machine_mips_loongson3v.py | 6 ++--- tests/acceptance/machine_mips_malta.py | 6 ++--- tests/acceptance/machine_ppc.py | 10 ++++----- tests/acceptance/machine_rx_gdbsim.py | 7 +++--- tests/acceptance/machine_s390_ccw_virtio.py | 7 +++--- tests/acceptance/machine_sparc64_sun4u.py | 6 ++--- tests/acceptance/machine_sparc_leon3.py | 8 +++---- tests/acceptance/multiprocess.py | 5 ++--- tests/acceptance/ppc_prep_40p.py | 16 +++++++------- tests/acceptance/virtio-gpu.py | 4 +--- tests/acceptance/virtiofs_submounts.py | 1 - 19 files changed, 73 insertions(+), 81 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 4a0129c0eb..b21f9ea3ff 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -101,19 +101,6 @@ def _console_interaction(test, success_message, failur= e_message, (failure_message, success_message) test.fail(fail) =20 -def wait_for_console_pattern(test, success_message, failure_message=3DNone, - vm=3DNone): - """ - Waits for messages to appear on the console, while logging the content - - :param test: an Avocado test containing a VM that will have its console - read and probed for a success or failure message - :type test: :class:`avocado_qemu.Test` - :param success_message: if this message appears, test succeeds - :param failure_message: if this message appears, test fails - """ - _console_interaction(test, success_message, failure_message, None, vm= =3Dvm) - class ConsoleMixIn(): """Contains utilities for interacting with a guest via Console.""" =20 @@ -163,6 +150,16 @@ def interrupt_interactive_console_until_pattern(self, = success_message, _console_interaction(self, success_message, failure_message, interrupt_string, True) =20 + def wait_for_console_pattern(self, success_message, failure_message=3D= None, + vm=3DNone): + """ + Waits for messages to appear on the console, while logging the con= tent + + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + """ + _console_interaction(self, success_message, failure_message, None,= vm=3Dvm) + class Test(avocado.Test): def _get_unique_tag_val(self, tag_name): """ diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 50e0a3fe79..e8d7a127fe 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -17,7 +17,6 @@ from avocado import skipUnless from avocado_qemu import Test from avocado_qemu import ConsoleMixIn -from avocado_qemu import wait_for_console_pattern from avocado.utils import process from avocado.utils import archive from avocado.utils.path import find_command, CmdNotFoundError @@ -48,7 +47,7 @@ class LinuxKernelTest(Test, ConsoleMixIn): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' =20 def wait_for_console_pattern(self, success_message, vm=3DNone): - wait_for_console_pattern(self, success_message, + super().wait_for_console_pattern(success_message, failure_message=3D'Kernel panic - not syn= cing', vm=3Dvm) =20 @@ -262,7 +261,7 @@ def test_mips64el_malta_5KEc_cpio(self): '-append', kernel_command_line, '-no-reboot') self.vm.launch() - wait_for_console_pattern(self, 'Boot successful.') + ConsoleMixIn.wait_for_console_pattern(self, 'Boot successful.') =20 self.exec_command_and_wait_for_pattern('cat /proc/cpuinfo', 'MIPS 5KE') @@ -877,7 +876,7 @@ def test_arm_orangepi_uboot_netbsd9(self): '-global', 'allwinner-rtc.base-year=3D2000', '-no-reboot') self.vm.launch() - wait_for_console_pattern(self, 'U-Boot 2020.01+dfsg-1') + ConsoleMixIn.wait_for_console_pattern(self, 'U-Boot 2020.01+dfsg-1= ') self.interrupt_interactive_console_until_pattern( 'Hit any key to stop autoboot:', 'switch to partitions #0, OK') @@ -897,10 +896,11 @@ def test_arm_orangepi_uboot_netbsd9(self): =20 self.exec_command_and_wait_for_pattern('boot', 'Booting kernel from Legacy Imag= e') - wait_for_console_pattern(self, 'Starting kernel ...') - wait_for_console_pattern(self, 'NetBSD 9.0 (GENERIC)') + ConsoleMixIn.wait_for_console_pattern(self, 'Starting kernel ...') + ConsoleMixIn.wait_for_console_pattern(self, 'NetBSD 9.0 (GENERIC)') # Wait for user-space - wait_for_console_pattern(self, 'Starting root file system check') + ConsoleMixIn.wait_for_console_pattern(self, + 'Starting root file system che= ck') =20 def test_aarch64_raspi3_atf(self): """ diff --git a/tests/acceptance/boot_xen.py b/tests/acceptance/boot_xen.py index 75c2d44492..9b5506398e 100644 --- a/tests/acceptance/boot_xen.py +++ b/tests/acceptance/boot_xen.py @@ -14,7 +14,6 @@ import os =20 from avocado import skipIf -from avocado_qemu import wait_for_console_pattern from boot_linux_console import LinuxKernelTest =20 =20 @@ -59,7 +58,9 @@ def launch_xen(self, xen_path): self.vm.launch() =20 console_pattern =3D 'VFS: Cannot open root device' - wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") + # pylint: disable=3DE1003 + super(LinuxKernelTest, self).wait_for_console_pattern(console_patt= ern, + "Panic on CPU 0:") =20 =20 class BootXen(BootXenBase): diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 6dbd02d49d..8d8531b6c5 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -13,13 +13,13 @@ =20 from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn from avocado.utils import process from avocado.utils import archive from avocado.utils import ssh =20 =20 -class LinuxSSH(Test): +class LinuxSSH(Test, ConsoleMixIn): =20 timeout =3D 150 # Not for 'configure --enable-debug --enable-debug-tcg' =20 @@ -126,7 +126,7 @@ def boot_debian_wheezy_image_and_ssh_login(self, endian= ess, kernel_path): =20 self.log.info('VM launched, waiting for sshd') console_pattern =3D 'Starting OpenBSD Secure Shell server: sshd' - wait_for_console_pattern(self, console_pattern, 'Oops') + self.wait_for_console_pattern(console_pattern, 'Oops') self.log.info('sshd ready') =20 self.ssh_connect('root', 'root') @@ -134,7 +134,7 @@ def boot_debian_wheezy_image_and_ssh_login(self, endian= ess, kernel_path): def shutdown_via_ssh(self): self.ssh_command('poweroff') self.ssh_disconnect_vm() - wait_for_console_pattern(self, 'Power down', 'Oops') + self.wait_for_console_pattern('Power down', 'Oops') =20 def ssh_command_output_contains(self, cmd, exp): stdout, _ =3D self.ssh_command(cmd) diff --git a/tests/acceptance/machine_arm_canona1100.py b/tests/acceptance/= machine_arm_canona1100.py index 0e5c43dbcf..945aa83270 100644 --- a/tests/acceptance/machine_arm_canona1100.py +++ b/tests/acceptance/machine_arm_canona1100.py @@ -9,10 +9,10 @@ # later. See the COPYING file in the top-level directory. =20 from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn from avocado.utils import archive =20 -class CanonA1100Machine(Test): +class CanonA1100Machine(Test, ConsoleMixIn): """Boots the barebox firmware and checks that the console is operation= al""" =20 timeout =3D 90 @@ -32,4 +32,4 @@ def test_arm_canona1100(self): self.vm.add_args('-bios', self.workdir + '/day18/barebox.canon-a1100.bin') self.vm.launch() - wait_for_console_pattern(self, 'running /env/bin/init') + self.wait_for_console_pattern('running /env/bin/init') diff --git a/tests/acceptance/machine_arm_integratorcp.py b/tests/acceptanc= e/machine_arm_integratorcp.py index 49c8ebff78..490bafa571 100644 --- a/tests/acceptance/machine_arm_integratorcp.py +++ b/tests/acceptance/machine_arm_integratorcp.py @@ -13,7 +13,7 @@ =20 from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn =20 =20 NUMPY_AVAILABLE =3D True @@ -29,7 +29,7 @@ CV2_AVAILABLE =3D False =20 =20 -class IntegratorMachine(Test): +class IntegratorMachine(Test, ConsoleMixIn): =20 timeout =3D 90 =20 @@ -59,7 +59,7 @@ def test_integratorcp_console(self): :avocado: tags=3Ddevice:pl011 """ self.boot_integratorcp() - wait_for_console_pattern(self, 'Log in as root') + self.wait_for_console_pattern('Log in as root') =20 @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') @@ -80,7 +80,7 @@ def test_framebuffer_tux_logo(self): =20 self.boot_integratorcp() framebuffer_ready =3D 'Console: switching to colour frame buffer d= evice' - wait_for_console_pattern(self, framebuffer_ready) + self.wait_for_console_pattern(framebuffer_ready) self.vm.command('human-monitor-command', command_line=3D'stop') self.vm.command('human-monitor-command', command_line=3D'screendump %s' % screendump_path) diff --git a/tests/acceptance/machine_arm_n8x0.py b/tests/acceptance/machin= e_arm_n8x0.py index e5741f2d8d..403415243e 100644 --- a/tests/acceptance/machine_arm_n8x0.py +++ b/tests/acceptance/machine_arm_n8x0.py @@ -12,9 +12,9 @@ =20 from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn =20 -class N8x0Machine(Test): +class N8x0Machine(Test, ConsoleMixIn): """Boots the Linux kernel and checks that the console is operational""" =20 timeout =3D 90 @@ -30,7 +30,7 @@ def __do_test_n8x0(self): self.vm.add_args('-kernel', kernel_path, '-append', 'printk.time=3D0 console=3DttyS1') self.vm.launch() - wait_for_console_pattern(self, 'TSC2005 driver initializing') + self.wait_for_console_pattern('TSC2005 driver initializing') =20 @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') def test_n800(self): diff --git a/tests/acceptance/machine_microblaze.py b/tests/acceptance/mach= ine_microblaze.py index 7f6d18495d..d6ecd69e95 100644 --- a/tests/acceptance/machine_microblaze.py +++ b/tests/acceptance/machine_microblaze.py @@ -6,10 +6,10 @@ # later. See the COPYING file in the top-level directory. =20 from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn from avocado.utils import archive =20 -class MicroblazeMachine(Test): +class MicroblazeMachine(Test, ConsoleMixIn): =20 timeout =3D 90 =20 @@ -27,8 +27,8 @@ def test_microblaze_s3adsp1800(self): self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/day17/ballerina.bin') self.vm.launch() - wait_for_console_pattern(self, 'This architecture does not have ' - 'kernel memory protection') + self.wait_for_console_pattern('This architecture does not have ' + 'kernel memory protection') # Note: # The kernel sometimes gets stuck after the "This architecture ..." # message, that's why we don't test for a later string here. This diff --git a/tests/acceptance/machine_mips_loongson3v.py b/tests/acceptance= /machine_mips_loongson3v.py index 85b131a40f..58242d5c9b 100644 --- a/tests/acceptance/machine_mips_loongson3v.py +++ b/tests/acceptance/machine_mips_loongson3v.py @@ -12,9 +12,9 @@ =20 from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn =20 -class MipsLoongson3v(Test): +class MipsLoongson3v(Test, ConsoleMixIn): timeout =3D 60 =20 @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') @@ -36,4 +36,4 @@ def test_pmon_serial_console(self): self.vm.set_console() self.vm.add_args('-bios', pmon_path) self.vm.launch() - wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:') + self.wait_for_console_pattern('CPU GODSON3 BogoMIPS:') diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/mach= ine_mips_malta.py index 7c9a4ee4d2..e05fa862cc 100644 --- a/tests/acceptance/machine_mips_malta.py +++ b/tests/acceptance/machine_mips_malta.py @@ -13,7 +13,7 @@ =20 from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn from avocado.utils import archive from avocado import skipIf =20 @@ -33,7 +33,7 @@ =20 @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') -class MaltaMachineFramebuffer(Test): +class MaltaMachineFramebuffer(Test, ConsoleMixIn): =20 timeout =3D 30 =20 @@ -68,7 +68,7 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): '-append', kernel_command_line) self.vm.launch() framebuffer_ready =3D 'Console: switching to colour frame buffer d= evice' - wait_for_console_pattern(self, framebuffer_ready, + self.wait_for_console_pattern(framebuffer_ready, failure_message=3D'Kernel panic - not syn= cing') self.vm.command('human-monitor-command', command_line=3D'stop') self.vm.command('human-monitor-command', diff --git a/tests/acceptance/machine_ppc.py b/tests/acceptance/machine_ppc= .py index a836e2496f..61f378a3a2 100644 --- a/tests/acceptance/machine_ppc.py +++ b/tests/acceptance/machine_ppc.py @@ -7,9 +7,9 @@ =20 from avocado.utils import archive from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn =20 -class PpcMachine(Test): +class PpcMachine(Test, ConsoleMixIn): =20 timeout =3D 90 KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' @@ -32,7 +32,7 @@ def test_ppc64_pseries(self): '-append', kernel_command_line) self.vm.launch() console_pattern =3D 'Kernel command line: %s' % kernel_command_line - wait_for_console_pattern(self, console_pattern, self.panic_message) + self.wait_for_console_pattern(console_pattern, self.panic_message) =20 def test_ppc_mpc8544ds(self): """ @@ -47,7 +47,7 @@ def test_ppc_mpc8544ds(self): self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/creek/creek.bin') self.vm.launch() - wait_for_console_pattern(self, 'QEMU advent calendar 2020', + self.wait_for_console_pattern('QEMU advent calendar 2020', self.panic_message) =20 def test_ppc_virtex_ml507(self): @@ -65,5 +65,5 @@ def test_ppc_virtex_ml507(self): '-dtb', self.workdir + '/hippo/virtex440-ml507.dt= b', '-m', '512') self.vm.launch() - wait_for_console_pattern(self, 'QEMU advent calendar 2020', + self.wait_for_console_pattern('QEMU advent calendar 2020', self.panic_message) diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machi= ne_rx_gdbsim.py index a893273bad..7a77cfe116 100644 --- a/tests/acceptance/machine_rx_gdbsim.py +++ b/tests/acceptance/machine_rx_gdbsim.py @@ -13,7 +13,6 @@ from avocado import skipIf from avocado_qemu import Test from avocado_qemu import ConsoleMixIn -from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 =20 @@ -41,7 +40,7 @@ def test_uboot(self): '-no-reboot') self.vm.launch() uboot_version =3D 'U-Boot 2016.05-rc3-23705-ga1ef3c71cb-dirty' - wait_for_console_pattern(self, uboot_version) + self.wait_for_console_pattern(uboot_version) gcc_version =3D 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experi= mental)' # FIXME limit baudrate on chardev, else we type too fast #self.exec_command_and_wait_for_pattern('version', gcc_version) @@ -68,6 +67,6 @@ def test_linux_sash(self): '-dtb', dtb_path, '-no-reboot') self.vm.launch() - wait_for_console_pattern(self, 'Sash command shell (version 1.1.1)= ', - failure_message=3D'Kernel panic - not syn= cing') + self.wait_for_console_pattern('Sash command shell (version 1.1.1)', + failure_message=3D'Kernel panic - no= t syncing') self.exec_command_and_wait_for_pattern('printenv', 'TERM=3Dlinux') diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance= /machine_s390_ccw_virtio.py index 537393c42f..bc1606ae43 100644 --- a/tests/acceptance/machine_s390_ccw_virtio.py +++ b/tests/acceptance/machine_s390_ccw_virtio.py @@ -15,7 +15,6 @@ from avocado import skipIf from avocado_qemu import Test from avocado_qemu import ConsoleMixIn -from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 class S390CCWVirtioMachine(Test, ConsoleMixIn): @@ -24,9 +23,9 @@ class S390CCWVirtioMachine(Test, ConsoleMixIn): timeout =3D 120 =20 def wait_for_console_pattern(self, success_message, vm=3DNone): - wait_for_console_pattern(self, success_message, - failure_message=3D'Kernel panic - not syn= cing', - vm=3Dvm) + super().wait_for_console_pattern(success_message, + failure_message=3D'Kernel panic - n= ot syncing', + vm=3Dvm) =20 def wait_for_crw_reports(self): self.exec_command_and_wait_for_pattern( diff --git a/tests/acceptance/machine_sparc64_sun4u.py b/tests/acceptance/m= achine_sparc64_sun4u.py index c7ad474bdc..810f11b049 100644 --- a/tests/acceptance/machine_sparc64_sun4u.py +++ b/tests/acceptance/machine_sparc64_sun4u.py @@ -9,10 +9,10 @@ # later. See the COPYING file in the top-level directory. =20 from avocado.utils import archive +from avocado_qemu import ConsoleMixIn from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern =20 -class Sun4uMachine(Test): +class Sun4uMachine(Test, ConsoleMixIn): """Boots the Linux kernel and checks that the console is operational""" =20 timeout =3D 90 @@ -32,4 +32,4 @@ def test_sparc64_sun4u(self): self.vm.add_args('-kernel', self.workdir + '/day23/vmlinux', '-append', self.KERNEL_COMMON_COMMAND_LINE) self.vm.launch() - wait_for_console_pattern(self, 'Starting logging: OK') + self.wait_for_console_pattern('Starting logging: OK') diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/mac= hine_sparc_leon3.py index 2405cd7a0d..1bf7812987 100644 --- a/tests/acceptance/machine_sparc_leon3.py +++ b/tests/acceptance/machine_sparc_leon3.py @@ -6,11 +6,11 @@ # later. See the COPYING file in the top-level directory. =20 from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn from avocado import skip =20 =20 -class Leon3Machine(Test): +class Leon3Machine(Test, ConsoleMixIn): =20 timeout =3D 60 =20 @@ -33,5 +33,5 @@ def test_leon3_helenos_uimage(self): =20 self.vm.launch() =20 - wait_for_console_pattern(self, 'Copyright (c) 2001-2014 HelenOS pr= oject') - wait_for_console_pattern(self, 'Booting the kernel ...') + self.wait_for_console_pattern('Copyright (c) 2001-2014 HelenOS pro= ject') + self.wait_for_console_pattern('Booting the kernel ...') diff --git a/tests/acceptance/multiprocess.py b/tests/acceptance/multiproce= ss.py index b4a6d20770..9f487fb7bc 100644 --- a/tests/acceptance/multiprocess.py +++ b/tests/acceptance/multiprocess.py @@ -8,7 +8,6 @@ import socket =20 from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern from avocado_qemu import ConsoleMixIn =20 class Multiprocess(Test, ConsoleMixIn): @@ -56,8 +55,8 @@ def do_test(self, kernel_url, initrd_url, kernel_command_= line, 'x-pci-proxy-dev,' 'id=3Dlsi1,fd=3D'+str(proxy_sock.fileno())) self.vm.launch() - wait_for_console_pattern(self, 'as init process', - 'Kernel panic - not syncing') + self.wait_for_console_pattern('as init process', + 'Kernel panic - not syncing') self.exec_command('mount -t sysfs sysfs /sys') self.exec_command_and_wait_for_pattern( 'cat /sys/bus/pci/devices/*/ueve= nt', diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_4= 0p.py index 96ba13b894..35475892be 100644 --- a/tests/acceptance/ppc_prep_40p.py +++ b/tests/acceptance/ppc_prep_40p.py @@ -10,10 +10,10 @@ from avocado import skipIf from avocado import skipUnless from avocado_qemu import Test -from avocado_qemu import wait_for_console_pattern +from avocado_qemu import ConsoleMixIn =20 =20 -class IbmPrep40pMachine(Test): +class IbmPrep40pMachine(Test, ConsoleMixIn): =20 timeout =3D 60 =20 @@ -44,8 +44,8 @@ def test_factory_firmware_and_netbsd(self): '-fda', drive_path) self.vm.launch() os_banner =3D 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 20= 07' - wait_for_console_pattern(self, os_banner) - wait_for_console_pattern(self, 'Model: IBM PPS Model 6015') + self.wait_for_console_pattern(os_banner) + self.wait_for_console_pattern('Model: IBM PPS Model 6015') =20 def test_openbios_192m(self): """ @@ -56,9 +56,9 @@ def test_openbios_192m(self): self.vm.add_args('-m', '192') # test fw_cfg =20 self.vm.launch() - wait_for_console_pattern(self, '>> OpenBIOS') - wait_for_console_pattern(self, '>> Memory: 192M') - wait_for_console_pattern(self, '>> CPU type PowerPC,604') + self.wait_for_console_pattern('>> OpenBIOS') + self.wait_for_console_pattern('>> Memory: 192M') + self.wait_for_console_pattern('>> CPU type PowerPC,604') =20 def test_openbios_and_netbsd(self): """ @@ -75,4 +75,4 @@ def test_openbios_and_netbsd(self): '-boot', 'd') =20 self.vm.launch() - wait_for_console_pattern(self, 'NetBSD/prep BOOT, Revision 1.9') + self.wait_for_console_pattern('NetBSD/prep BOOT, Revision 1.9') diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py index 4d65431ef1..a7e6bbb8a2 100644 --- a/tests/acceptance/virtio-gpu.py +++ b/tests/acceptance/virtio-gpu.py @@ -6,7 +6,6 @@ =20 from avocado_qemu import Test from avocado_qemu import BUILD_DIR -from avocado_qemu import wait_for_console_pattern from avocado_qemu import ConsoleMixIn from avocado_qemu import is_readable_executable_file =20 @@ -49,8 +48,7 @@ class VirtioGPUx86(Test, ConsoleMixIn): ) =20 def wait_for_console_pattern(self, success_message, vm=3DNone): - wait_for_console_pattern( - self, + super().wait_for_console_pattern( success_message, failure_message=3D"Kernel panic - not syncing", vm=3Dvm, diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 46fa65392a..ad1999a372 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -6,7 +6,6 @@ =20 from avocado import skipUnless from avocado_qemu import LinuxTest, BUILD_DIR -from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 =20 --=20 2.29.2