From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 750DAC04FF3 for ; Mon, 24 May 2021 20:54:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E741760241 for ; Mon, 24 May 2021 20:54:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E741760241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llHap-0002g0-Tg for qemu-devel@archiver.kernel.org; Mon, 24 May 2021 16:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llHZ1-0000jJ-17 for qemu-devel@nongnu.org; Mon, 24 May 2021 16:52:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llHYv-00032W-1B for qemu-devel@nongnu.org; Mon, 24 May 2021 16:52:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621889551; 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: in-reply-to:in-reply-to:references:references; bh=VPXJUSdfQFBkGs2ItzbtMtnir671CHihthWwDauwDmM=; b=JLZ4M6Ul0a4suaStN54n76vMKUOuwuWSyZK9+Q3xTfONILVMUVPug0fJVANi6zcIZilFsy Dt1A3MwStBrMrri5uFLFlxmBCkyhtEYJ5/O1UaPQwgBEZn+/SYhCcbyFaiXXjd+pMmENo2 ok4/jd+CG91t7JgULDBJv3kbbjRqNCo= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-J8n3TTCoNh6NEv1RcLUq7A-1; Mon, 24 May 2021 16:52:28 -0400 X-MC-Unique: J8n3TTCoNh6NEv1RcLUq7A-1 Received: by mail-vs1-f69.google.com with SMTP id d19-20020a0561020413b029023877d74e72so6288051vsq.15 for ; Mon, 24 May 2021 13:52:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VPXJUSdfQFBkGs2ItzbtMtnir671CHihthWwDauwDmM=; b=ceWxAgK80GBVnVqnz2XjGNt7NSjJynUuJVmEINVY0oLq1uZtiaIVMvbxSQ+6L5zq2r qOzdp6lOSBjTe6JpzEVJCRXDM8YacL2OBqINYD1PcYnhz3ZdZUCCBqw9WMN7yO0aronK BlK/FFesCH4jZaArrzS+p5CooLs3uZcb07Yugh6luDcptix8npShLqQhMgQe2iLoDBbv z/0GY7ctkipOq3eKVak5rk2VCGPuDqhes2He4Eev3NEJsan972JUQ8QOFMc+R/S84H0V pdUBQ4TQT5RE9KEowC9hLy1yyUMSNDz/+jwD19Ct2YRD0ttijpni+Sf8WGxbS/ZyNkIQ St5w== X-Gm-Message-State: AOAM531r4T46KK9JusVNboBxWBzOfr5/rR64MvAeIFE6CZBLPKGuJgk1 J7nKRy7t4954YfNtxCO3aFWhRWvVmyVVOvCY3YNGJ+sWSLITCcUdF/Rr2V8qSampna+SfQoXXUM 7qhTI3wOEBpkGLJdWRnfVqaK7IBEZGEE= X-Received: by 2002:a05:6122:124b:: with SMTP id b11mr23419397vkp.11.1621889547486; Mon, 24 May 2021 13:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPK5F4nfNSastw3pKnUF+peW2wM5RqV0QxXE2fIEeDvZL8OE+Laljs7rb/IpQM7HQ8bOMsGwrMPNprzKdalbI= X-Received: by 2002:a05:6122:124b:: with SMTP id b11mr23419379vkp.11.1621889547085; Mon, 24 May 2021 13:52:27 -0700 (PDT) MIME-Version: 1.0 References: <20210503224326.206208-1-wainersm@redhat.com> <20210503224326.206208-7-wainersm@redhat.com> In-Reply-To: <20210503224326.206208-7-wainersm@redhat.com> From: Willian Rampazzo Date: Mon, 24 May 2021 17:52:00 -0300 Message-ID: Subject: Re: [PATCH 6/7] tests/acceptance: Move wait_for_console_pattern to ConsoleMixIn To: Wainer dos Santos Moschetta Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=wrampazz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=216.205.24.124; envelope-from=wrampazz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.371, 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: Philippe Mathieu Daude , qemu-devel , Cleber Rosa Junior Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, May 3, 2021 at 7:44 PM Wainer dos Santos Moschetta wrote: > > 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_pattern() > 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(). I know it is not your fault, but I find confusing this mix of calls to `wait_for_console_pattern` just because one call is using a default `failure_message`. What if we change the method from the LinuxKernelTest to something like: def wait_for_console_pattern(self, success_message, failure_message=None, vm=None): if failure_message is None: failure_message = 'Kernel panic - not syncing' wait_for_console_pattern(self, success_message, failure_message, vm=vm) This way we could use the same call instead of mixing them. > > Likewise in boot_xen.py file. > > 2) In virtiofs_submounts.py, wait_for_console_pattern() was imported but not 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/avocado_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, failure_message, > (failure_message, success_message) > test.fail(fail) > > -def wait_for_console_pattern(test, success_message, failure_message=None, > - vm=None): > - """ > - 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=vm) > - > class ConsoleMixIn(): > """Contains utilities for interacting with a guest via Console.""" > > @@ -163,6 +150,16 @@ def interrupt_interactive_console_until_pattern(self, success_message, > _console_interaction(self, success_message, failure_message, > interrupt_string, True) > > + def wait_for_console_pattern(self, success_message, failure_message=None, > + vm=None): > + """ > + Waits for messages to appear on the console, while logging the content > + > + :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=vm) > + > 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 = 'printk.time=0 ' > > def wait_for_console_pattern(self, success_message, vm=None): > - wait_for_console_pattern(self, success_message, > + super().wait_for_console_pattern(success_message, > failure_message='Kernel panic - not syncing', > vm=vm) > > @@ -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.') > > 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=2000', > '-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): > > self.exec_command_and_wait_for_pattern('boot', > 'Booting kernel from Legacy Image') > - 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 check') > > 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 > > from avocado import skipIf > -from avocado_qemu import wait_for_console_pattern > from boot_linux_console import LinuxKernelTest > > > @@ -59,7 +58,9 @@ def launch_xen(self, xen_path): > self.vm.launch() > > console_pattern = 'VFS: Cannot open root device' > - wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") > + # pylint: disable=E1003 > + super(LinuxKernelTest, self).wait_for_console_pattern(console_pattern, > + "Panic on CPU 0:") > > > class BootXen(BootXenBase): > diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_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 @@ > > 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 > > > -class LinuxSSH(Test): > +class LinuxSSH(Test, ConsoleMixIn): Same comment about the order of the classes here that I made on previous patches. > > timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg' > > @@ -126,7 +126,7 @@ def boot_debian_wheezy_image_and_ssh_login(self, endianess, kernel_path): > > self.log.info('VM launched, waiting for sshd') > console_pattern = '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') > > self.ssh_connect('root', 'root') > @@ -134,7 +134,7 @@ def boot_debian_wheezy_image_and_ssh_login(self, endianess, 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') > > def ssh_command_output_contains(self, cmd, exp): > stdout, _ = 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. > > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > from avocado.utils import archive > > -class CanonA1100Machine(Test): > +class CanonA1100Machine(Test, ConsoleMixIn): And here! > """Boots the barebox firmware and checks that the console is operational""" > > timeout = 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/acceptance/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 @@ > > from avocado import skipUnless > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > > > NUMPY_AVAILABLE = True > @@ -29,7 +29,7 @@ > CV2_AVAILABLE = False > > > -class IntegratorMachine(Test): > +class IntegratorMachine(Test, ConsoleMixIn): And here! > > timeout = 90 > > @@ -59,7 +59,7 @@ def test_integratorcp_console(self): > :avocado: tags=device:pl011 > """ > self.boot_integratorcp() > - wait_for_console_pattern(self, 'Log in as root') > + self.wait_for_console_pattern('Log in as root') > > @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') > @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') > @@ -80,7 +80,7 @@ def test_framebuffer_tux_logo(self): > > self.boot_integratorcp() > framebuffer_ready = 'Console: switching to colour frame buffer device' > - wait_for_console_pattern(self, framebuffer_ready) > + self.wait_for_console_pattern(framebuffer_ready) > self.vm.command('human-monitor-command', command_line='stop') > self.vm.command('human-monitor-command', > command_line='screendump %s' % screendump_path) > diff --git a/tests/acceptance/machine_arm_n8x0.py b/tests/acceptance/machine_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 @@ > > from avocado import skipUnless > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > > -class N8x0Machine(Test): > +class N8x0Machine(Test, ConsoleMixIn): And here! > """Boots the Linux kernel and checks that the console is operational""" > > timeout = 90 > @@ -30,7 +30,7 @@ def __do_test_n8x0(self): > self.vm.add_args('-kernel', kernel_path, > '-append', 'printk.time=0 console=ttyS1') > self.vm.launch() > - wait_for_console_pattern(self, 'TSC2005 driver initializing') > + self.wait_for_console_pattern('TSC2005 driver initializing') > > @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') > def test_n800(self): > diff --git a/tests/acceptance/machine_microblaze.py b/tests/acceptance/machine_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. > > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > from avocado.utils import archive > > -class MicroblazeMachine(Test): > +class MicroblazeMachine(Test, ConsoleMixIn): One more :) > > timeout = 90 > > @@ -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 @@ > > from avocado import skipUnless > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > > -class MipsLoongson3v(Test): > +class MipsLoongson3v(Test, ConsoleMixIn): Same here! > timeout = 60 > > @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/machine_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 @@ > > 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 > > @@ -33,7 +33,7 @@ > > @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') > @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') > -class MaltaMachineFramebuffer(Test): > +class MaltaMachineFramebuffer(Test, ConsoleMixIn): Is this the last? :D > > timeout = 30 > > @@ -68,7 +68,7 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): > '-append', kernel_command_line) > self.vm.launch() > framebuffer_ready = 'Console: switching to colour frame buffer device' > - wait_for_console_pattern(self, framebuffer_ready, > + self.wait_for_console_pattern(framebuffer_ready, > failure_message='Kernel panic - not syncing') > self.vm.command('human-monitor-command', command_line='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 @@ > > from avocado.utils import archive > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > > -class PpcMachine(Test): > +class PpcMachine(Test, ConsoleMixIn): No, that was not the last. One more here! > > timeout = 90 > KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' > @@ -32,7 +32,7 @@ def test_ppc64_pseries(self): > '-append', kernel_command_line) > self.vm.launch() > console_pattern = '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) > > 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) > > def test_ppc_virtex_ml507(self): > @@ -65,5 +65,5 @@ def test_ppc_virtex_ml507(self): > '-dtb', self.workdir + '/hippo/virtex440-ml507.dtb', > '-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/machine_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 > > > @@ -41,7 +40,7 @@ def test_uboot(self): > '-no-reboot') > self.vm.launch() > uboot_version = 'U-Boot 2016.05-rc3-23705-ga1ef3c71cb-dirty' > - wait_for_console_pattern(self, uboot_version) > + self.wait_for_console_pattern(uboot_version) > gcc_version = 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experimental)' > # 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='Kernel panic - not syncing') > + self.wait_for_console_pattern('Sash command shell (version 1.1.1)', > + failure_message='Kernel panic - not syncing') > self.exec_command_and_wait_for_pattern('printenv', 'TERM=linux') > 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 > > class S390CCWVirtioMachine(Test, ConsoleMixIn): > @@ -24,9 +23,9 @@ class S390CCWVirtioMachine(Test, ConsoleMixIn): > timeout = 120 > > def wait_for_console_pattern(self, success_message, vm=None): > - wait_for_console_pattern(self, success_message, > - failure_message='Kernel panic - not syncing', > - vm=vm) > + super().wait_for_console_pattern(success_message, > + failure_message='Kernel panic - not syncing', > + vm=vm) > > 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/machine_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. > > from avocado.utils import archive > +from avocado_qemu import ConsoleMixIn > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > > -class Sun4uMachine(Test): > +class Sun4uMachine(Test, ConsoleMixIn): One more here! > """Boots the Linux kernel and checks that the console is operational""" > > timeout = 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/machine_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. > > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > +from avocado_qemu import ConsoleMixIn > from avocado import skip > > > -class Leon3Machine(Test): > +class Leon3Machine(Test, ConsoleMixIn): Another here! > > timeout = 60 > > @@ -33,5 +33,5 @@ def test_leon3_helenos_uimage(self): > > self.vm.launch() > > - wait_for_console_pattern(self, 'Copyright (c) 2001-2014 HelenOS project') > - wait_for_console_pattern(self, 'Booting the kernel ...') > + self.wait_for_console_pattern('Copyright (c) 2001-2014 HelenOS project') > + self.wait_for_console_pattern('Booting the kernel ...') > diff --git a/tests/acceptance/multiprocess.py b/tests/acceptance/multiprocess.py > index b4a6d20770..9f487fb7bc 100644 > --- a/tests/acceptance/multiprocess.py > +++ b/tests/acceptance/multiprocess.py > @@ -8,7 +8,6 @@ > import socket > > from avocado_qemu import Test > -from avocado_qemu import wait_for_console_pattern > from avocado_qemu import ConsoleMixIn > > class Multiprocess(Test, ConsoleMixIn): > @@ -56,8 +55,8 @@ def do_test(self, kernel_url, initrd_url, kernel_command_line, > 'x-pci-proxy-dev,' > 'id=lsi1,fd='+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/*/uevent', > diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.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 > > > -class IbmPrep40pMachine(Test): > +class IbmPrep40pMachine(Test, ConsoleMixIn): And here! > > timeout = 60 > > @@ -44,8 +44,8 @@ def test_factory_firmware_and_netbsd(self): > '-fda', drive_path) > self.vm.launch() > os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007' > - 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') > > def test_openbios_192m(self): > """ > @@ -56,9 +56,9 @@ def test_openbios_192m(self): > self.vm.add_args('-m', '192') # test fw_cfg > > 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') > > def test_openbios_and_netbsd(self): > """ > @@ -75,4 +75,4 @@ def test_openbios_and_netbsd(self): > '-boot', 'd') > > 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 @@ > > 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 > > @@ -49,8 +48,7 @@ class VirtioGPUx86(Test, ConsoleMixIn): > ) > > def wait_for_console_pattern(self, success_message, vm=None): > - wait_for_console_pattern( > - self, > + super().wait_for_console_pattern( > success_message, > failure_message="Kernel panic - not syncing", > vm=vm, > diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virtiofs_submounts.py > index 46fa65392a..ad1999a372 100644 > --- a/tests/acceptance/virtiofs_submounts.py > +++ b/tests/acceptance/virtiofs_submounts.py > @@ -6,7 +6,6 @@ > > from avocado import skipUnless > from avocado_qemu import LinuxTest, BUILD_DIR > -from avocado_qemu import wait_for_console_pattern > from avocado.utils import ssh > > > -- > 2.29.2 >