From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9aeU-00051N-Vs for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:20:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9aeQ-00069W-2j for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:20:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39520) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9aeP-000677-So for qemu-devel@nongnu.org; Fri, 20 Apr 2018 14:20:50 -0400 From: Eduardo Habkost Date: Fri, 20 Apr 2018 15:19:30 -0300 Message-Id: <20180420181951.7252-4-ehabkost@redhat.com> In-Reply-To: <20180420181951.7252-1-ehabkost@redhat.com> References: <20180420181951.7252-1-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC 03/24] avocado_qemu: Improve handle_prompts to allow login after booted vm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amador Pahim , Stefan Hajnoczi , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Alistair Francis , Cleber Rosa , Fam Zheng From: Luk=C3=A1=C5=A1 Doktor When the VM is booted before calling "vm.get_console" this command fails to login as there is no new output in the console. Let's just press enter (which should be relatively harmless as login asks for the user again and when already logged in we might "only" execute what's already written. Signed-off-by: Luk=C3=A1=C5=A1 Doktor Signed-off-by: Eduardo Habkost --- tests/avocado/avocado_qemu/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/avocado/avocado_qemu/test.py b/tests/avocado/avocado_q= emu/test.py index e74de97a3e..9cc163b3a8 100644 --- a/tests/avocado/avocado_qemu/test.py +++ b/tests/avocado/avocado_qemu/test.py @@ -123,7 +123,8 @@ def _handle_prompts(session, username, password, prom= pt, timeout=3D10, password_prompt_count =3D 0 login_prompt_count =3D 0 last_chance =3D False - + # Send enter to refresh output (in case session was attached after b= oot) + session.sendline() output =3D "" while True: try: --=20 2.14.3