From nobody Mon Feb 9 07:55:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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=1559857751; cv=none; d=zoho.com; s=zohoarc; b=cmI2gc0kMdJxhu0NqeXQBLsL3VMMfiskCTqMIvJnF795aSVbkEVEmt3viUvgjqDw2UlUH1SWiIUrDSXNuteppOc+su+/n+kePBDRzsN56yna73rS4BGMapOqCB2oI4ArK/8/oa+287SVeFMVFTK8RFIBGPdz5NiFX3SeuwrWGks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559857751; h=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:ARC-Authentication-Results; bh=folki1DPTgj6mdWcl7xDBQTH292SlchvOPCyJhx2ETk=; b=cNZRhutUIGSmrnoP+A90qRExwE0DUSRqXIW5anffkxMK/VT8Q+YLLsS0K67SVrgAUG4SCqJDSrCYyQ1MtAZk3QLLB7VMtkUEMcYv5mOHWNCwETpes2FZjWm/FH5U3fWaS4us2uezZqeyE4flf98uSnfqstLmw+ApOSEWECXC3GQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.47 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 (209.51.188.47 [209.51.188.47]) by mx.zohomail.com with SMTPS id 1559857751114971.2730534512345; Thu, 6 Jun 2019 14:49:11 -0700 (PDT) Received: from localhost ([::1]:42842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZ00n-0001iQ-HM for importer@patchew.org; Thu, 06 Jun 2019 17:33:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51595) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hYzu5-0005bg-GE for qemu-devel@nongnu.org; Thu, 06 Jun 2019 17:26:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYziZ-00087g-Ic for qemu-devel@nongnu.org; Thu, 06 Jun 2019 17:14:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54712) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYziZ-00086W-AC for qemu-devel@nongnu.org; Thu, 06 Jun 2019 17:14:39 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF9F1330247; Thu, 6 Jun 2019 21:14:31 +0000 (UTC) Received: from dhcp-17-47.bos.redhat.com (dhcp-17-47.bos.redhat.com [10.18.17.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBB9610ABD9F; Thu, 6 Jun 2019 21:14:30 +0000 (UTC) From: Cleber Rosa To: qemu-devel@nongnu.org Date: Thu, 6 Jun 2019 17:14:14 -0400 Message-Id: <20190606211414.8681-8-crosa@redhat.com> In-Reply-To: <20190606211414.8681-1-crosa@redhat.com> References: <20190606211414.8681-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 06 Jun 2019 21:14:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v6 7/7] [RFC]: use Avocado data drainer for console logging 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: Fam Zheng , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cornelia Huck , Wainer dos Santos Moschetta , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Samuel Ortiz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This depends on a proposed feature to Avocado, a new module that "drains" data and processes it. In this case, a drainer for the console socket file descriptor is used, and the data is sent to the "console" logger. This allows for a much better feedback of the test process, showing boot data from the guest as it happens, without obstructing the test code path. Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux.py | 14 +++++++++++--- tests/requirements.txt | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 9b54a0241f..f3507f519e 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -15,6 +15,7 @@ from avocado_qemu import Test, SRC_ROOT_DIR from avocado.utils import cloudinit from avocado.utils import network from avocado.utils import vmimage +from avocado.utils import datadrainer =20 =20 class BootLinux(Test): @@ -55,6 +56,13 @@ class BootLinux(Test): phone_home_port=3Dself.phone_home_port) self.vm.add_args('-drive', 'file=3D%s,format=3Draw' % cloudinit_is= o) =20 + def launch(self): + self.vm.set_console() + self.vm.launch() + console_drainer =3D datadrainer.LineLogger(self.vm.console_socket.= fileno(), + logger=3Dself.log.getChil= d('console')) + console_drainer.start() + def wait_for_boot_confirmation(self): self.log.info('VM launched, waiting for boot confirmation from gue= st') cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port), s= elf.name) @@ -70,7 +78,7 @@ class BootLinuxX8664(BootLinux): :avocado: tags=3Dmachine:pc """ self.vm.set_machine('pc') - self.vm.launch() + self.launch() self.wait_for_boot_confirmation() =20 def test_q35(self): @@ -79,7 +87,7 @@ class BootLinuxX8664(BootLinux): :avocado: tags=3Dmachine:q35 """ self.vm.set_machine('q35') - self.vm.launch() + self.launch() self.wait_for_boot_confirmation() =20 =20 @@ -99,5 +107,5 @@ class BootLinuxAarch64(BootLinux): 'edk2-aarch64-code.fd')) self.vm.add_args('-device', 'virtio-rng-pci,rng=3Drng0') self.vm.add_args('-object', 'rng-random,id=3Drng0,filename=3D/dev/= urandom') - self.vm.launch() + self.launch() self.wait_for_boot_confirmation() diff --git a/tests/requirements.txt b/tests/requirements.txt index 9d2c79b146..28eaf7b61e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,7 +1,7 @@ # Add Python module requirements, one per line, to be installed # in the tests/venv Python virtual environment. For more info, # refer to: https://pip.pypa.io/en/stable/user_guide/#id1 -avocado-framework=3D=3D68.0 +-e git+https://github.com/clebergnu/avocado@datadrainer#egg=3Davocado_fram= ework paramiko pycdlib=3D=3D1.6.0 =20 --=20 2.21.0