From nobody Wed Nov 27 16:48:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698376956; cv=none; d=zohomail.com; s=zohoarc; b=Xc8yo8W9GCBKndYPvWLhE23RUwJZG1kVyAQeYlEDz0JdSuqCisXx5xoG0GPmH5T0vpSx0zhKyrKXUCEjx9EieSEDeID1IqbayxKYW9T9oK7x1+COwzdZQKrvQlQ56XjVnYMMw8bEXl5iE0zrx5uuG6XAq3RiBh/Mqa0dWZT5QYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698376956; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=simh88NQ8JXz8AjVZeNXJQud8G+aRTJe35SVm9ACyQs=; b=OKuTsPWnaNHwYM3eNik0vTB5vzs5M3wJrqLnw5wnTxBDWQ98a6CrqHRCjnVrSKGh7nrvzm0ATNga1Ah7p742zGznCdNwas1OewJNPvQpLXhqFMnWllUKj85utHvhf2eDH5Y2ag3823lQ/hAyV3v9VZqv04qWeJhcd6S4YuA5GEk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698376956723395.88847454423137; Thu, 26 Oct 2023 20:22:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwDQ4-00089d-GZ; Thu, 26 Oct 2023 23:21:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwDQ3-00089O-87 for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwDQ1-0001JD-Ec for qemu-devel@nongnu.org; Thu, 26 Oct 2023 23:21:55 -0400 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-7md5G9zyP1W1_u-YMWQZuw-1; Thu, 26 Oct 2023 23:21:50 -0400 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1c9d140fb3eso15163675ad.3 for ; Thu, 26 Oct 2023 20:21:49 -0700 (PDT) Received: from localhost.localdomain ([115.96.30.106]) by smtp.googlemail.com with ESMTPSA id j6-20020a170902da8600b001cc131c65besm418431plx.168.2023.10.26.20.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 20:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698376911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=simh88NQ8JXz8AjVZeNXJQud8G+aRTJe35SVm9ACyQs=; b=jIhTWw1Sm1nyCeCtTQpqp72HMivNdjzzRJRimSBRQJofusqINCLVO4ijuw+5Qt7RLMGdAH RzixtGGLTzBrCnaxHJc4rG5UejT0c7SNKM2VOr7RrJutkjPEu44T3Zuqui3ua6fucwAszX Co5f5+LEvOEfTTpY1zB63WPzK6ER8Ew= X-MC-Unique: 7md5G9zyP1W1_u-YMWQZuw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698376909; x=1698981709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=simh88NQ8JXz8AjVZeNXJQud8G+aRTJe35SVm9ACyQs=; b=MLyHSCjbxCIPl9iBzjcjbj8CYIwLlKOVWXc2llPk6glpV3SsZABplx+BIaEhTlrIbt qnCbp+MyLXpBXwf9TIG0rsrtl1cUh260HtMyxAQl/L47hFa79OwusG8YDR4+psalcuMJ U/d3mcNLEyrDA8K+2tiPWwCG/4k7o0QctSg7mt/tNxIx03mFRACIPb+DQYUt87VfS2ED VQ2zuCEpdr7amJEYRF9v9qjVNyU9p6kdgC4mbvUNRlVgRoBd4GQNYU3P81UAPPBXtWPk wNMsV6SR5w3eOwKZIakyorxIDKqMp2LMBYQT/UmQxzFkNWxrRgjaNsQfni6HHBv1euri j9bA== X-Gm-Message-State: AOJu0YwtUNOol7ZpOXqxnBwBNHCXUbDlwRN9lreh7SRWREM5tQj1d1Hh 9/fwE5/S+Uyc6ykwRll/Z5NeZJDoRkvdCKJo8IhGpKCLU/aZ/BDOIPmy4XgtZNt6zk5Cw+YlLGc JZ4l/UK55ArcjGyE= X-Received: by 2002:a17:902:c146:b0:1c6:3157:29f3 with SMTP id 6-20020a170902c14600b001c6315729f3mr1475318plj.36.1698376908894; Thu, 26 Oct 2023 20:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHquaDsWc+oVlPzPd4kPA1RU95KcL2SPRCfEAhJaIUPfdM0lm5zM71HOLhiixDaTxcoocuHRg== X-Received: by 2002:a17:902:c146:b0:1c6:3157:29f3 with SMTP id 6-20020a170902c14600b001c6315729f3mr1475305plj.36.1698376908565; Thu, 26 Oct 2023 20:21:48 -0700 (PDT) From: Ani Sinha To: Ani Sinha , "Michael S. Tsirkin" , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Cc: jsnow@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 2/2] acpi/tests/avocado/bits: enable console logging from bits VM Date: Fri, 27 Oct 2023 08:51:19 +0530 Message-ID: <20231027032120.6012-3-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231027032120.6012-1-anisinha@redhat.com> References: <20231027032120.6012-1-anisinha@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698376957536100002 Content-Type: text/plain; charset="utf-8" Console logs from the VM can be useful for debugging when things go wrong. Other avocado tests enables them. This change enables console logging with = the following changes: - point to the newer bios bits image that actually enabled VM console. - change the bits test to drain the console logs from the VM and write the logs. - wait for SHUTDOWN event from QEMU so that console logs can be drained out of the socket before it is closed as a part of vm.wait(). Additionally, following two cosmetic changes have been made: - Removed VM QEMU command line logging as avocado framework already logs i= t. This is a minor cleanup along the way. - Update my email to my work email in the avocado acpi bios bits test. CC: jsnow@redhat.com Signed-off-by: Ani Sinha --- tests/avocado/acpi-bits.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py index 042007b0b8..68b9e98d4e 100644 --- a/tests/avocado/acpi-bits.py +++ b/tests/avocado/acpi-bits.py @@ -18,7 +18,7 @@ # # # Author: -# Ani Sinha +# Ani Sinha =20 # pylint: disable=3Dinvalid-name # pylint: disable=3Dconsider-using-f-string @@ -48,6 +48,7 @@ ) from qemu.machine import QEMUMachine from avocado import skipIf +from avocado.utils import datadrainer as drainer from avocado_qemu import QemuBaseTest =20 deps =3D ["xorriso", "mformat"] # dependent tools needed in the test setup= /box. @@ -141,12 +142,12 @@ def __init__(self, *args, **kwargs): self._baseDir =3D None =20 # following are some standard configuration constants - self._bitsInternalVer =3D 2020 - self._bitsCommitHash =3D 'b48b88ff' # commit hash must match + self._bitsInternalVer =3D 2020 # gitlab CI does shallow clones of = depth 20 + self._bitsCommitHash =3D 'c7920d2b' # commit hash must match # the artifact tag below - self._bitsTag =3D "qemu-bits-10182022" # this is the latest bits + self._bitsTag =3D "qemu-bits-10262023" # this is the latest bits # release as of today. - self._bitsArtSHA1Hash =3D 'b04790ac9b99b5662d0416392c73b97580641fe= 5' + self._bitsArtSHA1Hash =3D 'b22cdfcfc7453875297d06d626f5474ee36a343= f' self._bitsArtURL =3D ("https://gitlab.com/qemu-project/" "biosbits-bits/-/jobs/artifacts/%s/" "download?job=3Dqemu-bits-build" %self._bitsTa= g) @@ -386,15 +387,20 @@ def test_acpi_smbios_bits(self): # for newer machine models"). Therefore, enforce 32-bit entry poin= t. self._vm.add_args('-machine', 'smbios-entry-point-type=3D32') =20 - args =3D " ".join(str(arg) for arg in self._vm.base_args()) + \ - " " + " ".join(str(arg) for arg in self._vm.args) + # enable console logging + self._vm.set_console() + self._vm.launch() =20 - self.logger.info("launching QEMU vm with the following arguments: = %s", - args) + self.logger.debug("Console output from bits VM follows ...") + c_drainer =3D drainer.LineLogger(self._vm.console_socket.fileno(), + logger=3Dself.logger.getChild("cons= ole"), + stop_check=3D(lambda : + not self._vm.is_running= ())) + c_drainer.start() =20 - self._vm.launch() # biosbits has been configured to run all the specified test suites # in batch mode and then automatically initiate a vm shutdown. # Rely on avocado's unit test timeout. + self._vm.event_wait('SHUTDOWN') self._vm.wait(timeout=3DNone) self.parse_log() --=20 2.42.0