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=-6.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6B3A5CA9EAF for ; Thu, 24 Oct 2019 11:23:51 +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 2524B2084C for ; Thu, 24 Oct 2019 11:23:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bOCNtL8K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2524B2084C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNbDZ-0007vH-WA for qemu-devel@archiver.kernel.org; Thu, 24 Oct 2019 07:23:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46401) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNZN9-00057O-41 for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:25:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNZN6-0003Dm-OY for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:25:34 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:42143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNZN6-0003Da-Ep for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:25:32 -0400 Received: by mail-ot1-x341.google.com with SMTP id b16so9244722otk.9 for ; Thu, 24 Oct 2019 02:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=syid6krUsPxfc4GmRUpyI794bOgLFo56CLg1zf/h6MY=; b=bOCNtL8K5SdGMnD7ZGnIK3aSJfYlQDbhrzugBaBds2sBNaK+Sq21okTi1AY65bmo+Y 55LkeoOsw1HNr6xLVdyAGdu6MN7r5oUfU/ivDn4tHQNzxtRwhdUpxpCJc+wweEk28xpV pLYMIpAj2BCx29juApR11gP5gZuf+CH6zngBmeVYoiEWUa93GVMzfek1R9C0x+4RC78T qtavjENtk1mCgSKGWOxjfFr0K5qZoyKoaGhPk5BjGid81dgSjmRlxGh8kbW91NBpgRUr 6u1diA6PTzXNn59y7We26l/DljI5LY9aufZiPRJ8JxQsvBIlZmwgPjY52zk8wv8AXYXk vQSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=syid6krUsPxfc4GmRUpyI794bOgLFo56CLg1zf/h6MY=; b=L/Brn9XfXnNEdxwC7LfEQ3mxAlBRJnLADa5+TVc5tNfssJdXV/TihJZGt7QWKM/OuN ZptjC1aPOhcegipyFHhl/zyGfdMxKwE8m4uDQ+Vad7jgB9m4+2YJWNaDiXUZVu43lMcY oXY3DVKctDBJaslfmStbA95fjoWz5O2yd9OAZnTBJ8csuyqcrw1H96bWNYtK0qUeFyCY jlYnuX0v9XRTjgzFh2LyBzqH84MWTT6jzlTK6RL7czt6WKr6QLKqvX/YzifYrg0yWx1s ppOlayIVaLSiI2vygkI8iUKn5IuzPxMk0ilYLvVjvXSJVNzymJuV27Ej5IYql9b+1czg h5rg== X-Gm-Message-State: APjAAAVgIGz1FVxi/9itF4KxiEUMG2QxGJGW/j6m7Yg9SRmZq7Ccdgu9 mLfuvtD/SSYJAgZFW8ZiQwX82/Ofopr7LCrDnAU= X-Google-Smtp-Source: APXvYqwhiqctyT3qTRn4DDTRMhsDZDLaMVjelTLR9Q2ZDVloN8EcheOQ+djUtUOiWMcANoIEnPsAcyIdfueZJyTPrCM= X-Received: by 2002:a9d:4f0f:: with SMTP id d15mr10475126otl.64.1571909131528; Thu, 24 Oct 2019 02:25:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:340a:0:0:0:0:0 with HTTP; Thu, 24 Oct 2019 02:25:31 -0700 (PDT) In-Reply-To: <20191019153437.9820-2-f4bug@amsat.org> References: <20191019153437.9820-1-f4bug@amsat.org> <20191019153437.9820-2-f4bug@amsat.org> From: Aleksandar Markovic Date: Thu, 24 Oct 2019 11:25:31 +0200 Message-ID: Subject: Re: [PATCH v2 01/11] Acceptance tests: refactor wait_for_console_pattern To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Content-Type: multipart/alternative; boundary="000000000000676d1d0595a49df6" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::341 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: Eduardo Habkost , "qemu-devel@nongnu.org" , Aleksandar Markovic , Cleber Rosa , Aleksandar Rikalo , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000676d1d0595a49df6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Saturday, October 19, 2019, Philippe Mathieu-Daud=C3=A9 wrote: > From: Cleber Rosa > > The same utility method is already present in two different test > files, so let's consolidate it into a single utility function. > > Signed-off-by: Cleber Rosa > Message-Id: <20190916164011.7653-1-crosa@redhat.com> > Reviewed-by: Philippe Mathieu-Daud=C3=A9 > [PMD: failure_message is optional] > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > tests/acceptance/avocado_qemu/__init__.py | 25 +++++++++++++++++++++ > tests/acceptance/boot_linux_console.py | 27 +++++------------------ > tests/acceptance/linux_ssh_mips_malta.py | 18 +++------------ > 3 files changed, 33 insertions(+), 37 deletions(-) > > Reviewed-by: Aleksandar Markovic > diff --git a/tests/acceptance/avocado_qemu/__init__.py > b/tests/acceptance/avocado_qemu/__init__.py > index bd41e0443c..e3101cba30 100644 > --- a/tests/acceptance/avocado_qemu/__init__.py > +++ b/tests/acceptance/avocado_qemu/__init__.py > @@ -8,6 +8,7 @@ > # This work is licensed under the terms of the GNU GPL, version 2 or > # later. See the COPYING file in the top-level directory. > > +import logging > import os > import sys > import uuid > @@ -53,6 +54,30 @@ def pick_default_qemu_bin(arch=3DNone): > return qemu_bin_from_src_dir_path > > > +def wait_for_console_pattern(test, success_message, failure_message=3DNo= ne): > + """ > + Waits for messages to appear on the console, while logging the conte= nt > + > + :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 =3D test.vm.console_socket.makefile() > + console_logger =3D logging.getLogger('console') > + while True: > + msg =3D console.readline().strip() > + if not msg: > + continue > + console_logger.debug(msg) > + if success_message in msg: > + break > + if failure_message and failure_message in msg: > + fail =3D 'Failure message found in console: %s' % > failure_message > + test.fail(fail) > + > + > class Test(avocado.Test): > def setUp(self): > self._vms =3D {} > diff --git a/tests/acceptance/boot_linux_console.py > b/tests/acceptance/boot_linux_console.py > index 8a9a314ab4..8897e0c253 100644 > --- a/tests/acceptance/boot_linux_console.py > +++ b/tests/acceptance/boot_linux_console.py > @@ -9,12 +9,12 @@ > # later. See the COPYING file in the top-level directory. > > import os > -import logging > import lzma > import gzip > import shutil > > from avocado_qemu import Test > +from avocado_qemu import wait_for_console_pattern > from avocado.utils import process > from avocado.utils import archive > > @@ -29,31 +29,14 @@ class BootLinuxConsole(Test): > > KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' > > - def wait_for_console_pattern(self, success_message, > - failure_message=3D'Kernel panic - not > syncing'): > - """ > - 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 =3D self.vm.console_socket.makefile() > - console_logger =3D logging.getLogger('console') > - while True: > - msg =3D console.readline().strip() > - if not msg: > - continue > - console_logger.debug(msg) > - if success_message in msg: > - break > - if failure_message in msg: > - fail =3D 'Failure message found in console: %s' % > failure_message > - self.fail(fail) > + def wait_for_console_pattern(self, success_message): > + wait_for_console_pattern(self, success_message, > + failure_message=3D'Kernel panic - not > syncing') > > def exec_command_and_wait_for_pattern(self, command, > success_message): > command +=3D '\n' > self.vm.console_socket.sendall(command.encode()) > - self.wait_for_console_pattern(success_message) > + wait_for_console_pattern(self, success_message) > > def extract_from_deb(self, deb, path): > """ > diff --git a/tests/acceptance/linux_ssh_mips_malta.py > b/tests/acceptance/linux_ssh_mips_malta.py > index 25a1df5098..ffbb06f846 100644 > --- a/tests/acceptance/linux_ssh_mips_malta.py > +++ b/tests/acceptance/linux_ssh_mips_malta.py > @@ -13,6 +13,7 @@ import time > > from avocado import skipUnless > from avocado_qemu import Test > +from avocado_qemu import wait_for_console_pattern > from avocado.utils import process > from avocado.utils import archive > from avocado.utils import ssh > @@ -40,19 +41,6 @@ class LinuxSSH(Test): > def setUp(self): > super(LinuxSSH, self).setUp() > > - def wait_for_console_pattern(self, success_message, > - failure_message=3D'Oops'): > - console =3D self.vm.console_socket.makefile() > - console_logger =3D logging.getLogger('console') > - while True: > - msg =3D console.readline() > - console_logger.debug(msg.strip()) > - if success_message in msg: > - break > - if failure_message in msg: > - fail =3D 'Failure message found in console: %s' % > failure_message > - self.fail(fail) > - > def get_portfwd(self): > res =3D self.vm.command('human-monitor-command', > command_line=3D'info usernet') > @@ -109,7 +97,7 @@ class LinuxSSH(Test): > > self.log.info('VM launched, waiting for sshd') > console_pattern =3D 'Starting OpenBSD Secure Shell server: sshd' > - self.wait_for_console_pattern(console_pattern) > + wait_for_console_pattern(self, console_pattern, 'Oops') > self.log.info('sshd ready') > > self.ssh_connect('root', 'root') > @@ -117,7 +105,7 @@ class LinuxSSH(Test): > def shutdown_via_ssh(self): > self.ssh_command('poweroff') > self.ssh_disconnect_vm() > - self.wait_for_console_pattern('Power down') > + wait_for_console_pattern(self, 'Power down', 'Oops') > > def ssh_command_output_contains(self, cmd, exp): > stdout, _ =3D self.ssh_command(cmd) > -- > 2.21.0 > > > --000000000000676d1d0595a49df6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Saturday, October 19, 2019, Philippe Mathieu-Daud=C3=A9 <f4bug@amsat.org> wrote:
From: Cleber Rosa <crosa@redhat.com>

The same utility method is already present in two different test
files, so let's consolidate it into a single utility function.

Signed-off-by: Cleber Rosa <crosa@re= dhat.com>
Message-Id: <2= 0190916164011.7653-1-crosa@redhat.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@redhat.com>
[PMD: failure_message is optional]
Signed-off-by: Philippe Mathieu-Daud=C3=A9 <philmd@redhat.com>
---
=C2=A0tests/acceptance/avocado_qemu/__init__.py | 25 +++++++++++++++++= ++++
=C2=A0tests/acceptance/boot_linux_console.py=C2=A0 =C2=A0 | 27 +++++--= ----------------
=C2=A0tests/acceptance/linux_ssh_mips_malta.py=C2=A0 | 18 +++---------= ---
=C2=A03 files changed, 33 insertions(+), 37 deletions(-)



Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp= .com>
=C2= =A0
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/accepta= nce/avocado_qemu/__init__.py
index bd41e0443c..e3101cba30 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -8,6 +8,7 @@
=C2=A0# This work is licensed under the terms of the GNU GPL, version 2 or<= br> =C2=A0# later.=C2=A0 See the COPYING file in the top-level directory.

+import logging
=C2=A0import os
=C2=A0import sys
=C2=A0import uuid
@@ -53,6 +54,30 @@ def pick_default_qemu_bin(arch=3DNone):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return qemu_bin_from_src_dir_path


+def wait_for_console_pattern(test, success_message, failure_message=3DNone= ):
+=C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 Waits for messages to appear on the console, while logging t= he content
+
+=C2=A0 =C2=A0 :param test: an Avocado test containing a VM that will have = its console
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0read and pro= bed for a success or failure message
+=C2=A0 =C2=A0 :type test: :class:`avocado_qemu.Test`
+=C2=A0 =C2=A0 :param success_message: if this message appears, test succee= ds
+=C2=A0 =C2=A0 :param failure_message: if this message appears, test fails<= br> +=C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 console =3D test.vm.console_socket.makefile()
+=C2=A0 =C2=A0 console_logger =3D logging.getLogger('console')
+=C2=A0 =C2=A0 while True:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 msg =3D console.readline().strip()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if not msg:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 console_logger.debug(msg)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if success_message in msg:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if failure_message and failure_message in msg:=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fail =3D 'Failure message fo= und in console: %s' % failure_message
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 test.fail(fail)
+
+
=C2=A0class Test(avocado.Test):
=C2=A0 =C2=A0 =C2=A0def setUp(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self._vms =3D {}
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance= /boot_linux_console.py
index 8a9a314ab4..8897e0c253 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -9,12 +9,12 @@
=C2=A0# later.=C2=A0 See the COPYING file in the top-level directory.

=C2=A0import os
-import logging
=C2=A0import lzma
=C2=A0import gzip
=C2=A0import shutil

=C2=A0from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
=C2=A0from avocado.utils import process
=C2=A0from avocado.utils import archive

@@ -29,31 +29,14 @@ class BootLinuxConsole(Test):

=C2=A0 =C2=A0 =C2=A0KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 = 9;

-=C2=A0 =C2=A0 def wait_for_console_pattern(self, success_message,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0failure_message=3D'Kernel = panic - not syncing'):
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Waits for messages to appear on the console, w= hile logging the content
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 :param success_message: if this message appear= s, test succeeds
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 :param failure_message: if this message appear= s, test fails
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 console =3D self.vm.console_socket.makefi= le()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 console_logger =3D logging.getLogger('cons= ole')
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 while True:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 msg =3D console.readline().strip= ()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not msg:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 console_logger.debug(msg)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if success_message in msg:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if failure_message in msg:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fail =3D 'Fail= ure message found in console: %s' % failure_message
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.fail(fail) +=C2=A0 =C2=A0 def wait_for_console_pattern(self, success_message):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 wait_for_console_pattern(self, success_message= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0failure_message=3D'Kernel = panic - not syncing')

=C2=A0 =C2=A0 =C2=A0def exec_command_and_wait_for_pattern(self, comman= d, success_message):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0command +=3D '\n'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.vm.console_socket.sendall(comma= nd.encode())
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.wait_for_console_pattern(success_mes= sage)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 wait_for_console_pattern(self, success_message= )

=C2=A0 =C2=A0 =C2=A0def extract_from_deb(self, deb, path):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptan= ce/linux_ssh_mips_malta.py
index 25a1df5098..ffbb06f846 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -13,6 +13,7 @@ import time

=C2=A0from avocado import skipUnless
=C2=A0from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
=C2=A0from avocado.utils import process
=C2=A0from avocado.utils import archive
=C2=A0from avocado.utils import ssh
@@ -40,19 +41,6 @@ class LinuxSSH(Test):
=C2=A0 =C2=A0 =C2=A0def setUp(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0super(LinuxSSH, self).setUp()

-=C2=A0 =C2=A0 def wait_for_console_pattern(self, success_message,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0failure_message=3D'Oops= 9;):
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 console =3D self.vm.console_socket.makefi= le()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 console_logger =3D logging.getLogger('cons= ole')
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 while True:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 msg =3D console.readline()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 console_logger.debug(msg.st= rip())
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if success_message in msg:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if failure_message in msg:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fail =3D 'Fail= ure message found in console: %s' % failure_message
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.fail(fail) -
=C2=A0 =C2=A0 =C2=A0def get_portfwd(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0res =3D self.vm.command('human-m= onitor-command',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0command_line=3D'info usernet'= )
@@ -109,7 +97,7 @@ class LinuxSSH(Test):

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.log.info('VM launched, waiting for sshd')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0console_pattern =3D 'Starting OpenBSD= Secure Shell server: sshd'
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.wait_for_console_pattern(console_pat= tern)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 wait_for_console_pattern(self, console_pattern= , 'Oops')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.log.info('sshd ready')

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.ssh_connect('root', 'roo= t')
@@ -117,7 +105,7 @@ class LinuxSSH(Test):
=C2=A0 =C2=A0 =C2=A0def shutdown_via_ssh(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.ssh_command('poweroff')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.ssh_disconnect_vm()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.wait_for_console_pattern('Power = down')
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 wait_for_console_pattern(self, 'Power down= ', 'Oops')

=C2=A0 =C2=A0 =C2=A0def ssh_command_output_contains(self, cmd, exp): =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stdout, _ =3D self.ssh_command(cmd)
--
2.21.0


--000000000000676d1d0595a49df6--