From nobody Thu Sep 19 00:19:32 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=1721843763; cv=none; d=zohomail.com; s=zohoarc; b=hISOSzhSOzHo85bfV4aIqbtkJN/fMXmH6Jn4Ajm2RsTeYPQRXjgS7CiN46Ml3xetd6JM9tgIQgVYkqhccWNGRsyQCwqjArJhWn1zxjKC1n+RVmJkmi49jeFjQvm6ypJncOaqNuLGijJ3wc04JRxxwGdM9WqUEmYRRXkUqZXOnmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721843763; 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=+SD5m8qQwNcVObfcscMhGfK6HWkYOwHdm2EdrUNkLD8=; b=QYBfFljoHQUwjncxxKP+CbiI57UlV7itWT7jnA87BCYLxHsVZ3OQAPu2hnY1c+TRSrnpUIVkJtQPD5i77xPuostLI12btKShS/XWFVBVRuZ0F5eFu6zIrReC3B5ns7FqS3v7d6+rtIglrOULzBJNz9Bq0BL5LOYHBI2QzxxEdRE= 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 1721843763857551.9836144834976; Wed, 24 Jul 2024 10:56:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWgDN-0002ik-GQ; Wed, 24 Jul 2024 13:55:51 -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 1sWgCq-0000lH-1C for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWgCg-00061J-Ic for qemu-devel@nongnu.org; Wed, 24 Jul 2024 13:55:09 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-qbgQK-4BNTWv5V00bgo0Kw-1; Wed, 24 Jul 2024 13:54:56 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A09141944B29; Wed, 24 Jul 2024 17:54:54 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.144]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7068B1955D48; Wed, 24 Jul 2024 17:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721843699; 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=+SD5m8qQwNcVObfcscMhGfK6HWkYOwHdm2EdrUNkLD8=; b=fuQSdBrvuIXnRT6/lRqckynnk0WCxWSbwxAlk+rgZLl+hNCh6glrK35j0tl2vB1YXVSq7z ocSvuQo7veU8sU3kHx1lk6ZZ4OY9kiJXkkYbskDtaOXmGJsKFBwuUvbVCYsIrEtkMTkUS0 Qo5J2in/wpi2+VxlpfAjaL72xUjBRyA= X-MC-Unique: qbgQK-4BNTWv5V00bgo0Kw-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow , qemu-ppc@nongnu.org, Fabiano Rosas Subject: [PATCH v2 21/23] tests/functional: Convert the acpi-bits test into a standalone test Date: Wed, 24 Jul 2024 19:52:39 +0200 Message-ID: <20240724175248.1389201-22-thuth@redhat.com> In-Reply-To: <20240724175248.1389201-1-thuth@redhat.com> References: <20240724175248.1389201-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.136, 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=unavailable 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: 1721843764364116600 Content-Type: text/plain; charset="utf-8" Mostly a straight-forward conversion. Looks like we can simply drop the avocado datadrainer stuff when not using the avocado framework anymore. Signed-off-by: Thomas Huth --- .../acpi-bits/bits-config/bits-cfg.txt | 0 .../acpi-bits/bits-tests/smbios.py2 | 0 .../acpi-bits/bits-tests/smilatency.py2 | 0 .../acpi-bits/bits-tests/testacpi.py2 | 0 .../acpi-bits/bits-tests/testcpuid.py2 | 0 tests/functional/meson.build | 2 ++ .../test_acpi_bits.py} | 29 ++++++++----------- 7 files changed, 14 insertions(+), 17 deletions(-) rename tests/{avocado =3D> functional}/acpi-bits/bits-config/bits-cfg.txt = (100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/smbios.py2 (10= 0%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/smilatency.py2= (100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/testacpi.py2 (= 100%) rename tests/{avocado =3D> functional}/acpi-bits/bits-tests/testcpuid.py2 = (100%) rename tests/{avocado/acpi-bits.py =3D> functional/test_acpi_bits.py} (95%) mode change 100644 =3D> 100755 diff --git a/tests/avocado/acpi-bits/bits-config/bits-cfg.txt b/tests/funct= ional/acpi-bits/bits-config/bits-cfg.txt similarity index 100% rename from tests/avocado/acpi-bits/bits-config/bits-cfg.txt rename to tests/functional/acpi-bits/bits-config/bits-cfg.txt diff --git a/tests/avocado/acpi-bits/bits-tests/smbios.py2 b/tests/function= al/acpi-bits/bits-tests/smbios.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/smbios.py2 rename to tests/functional/acpi-bits/bits-tests/smbios.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/smilatency.py2 b/tests/func= tional/acpi-bits/bits-tests/smilatency.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/smilatency.py2 rename to tests/functional/acpi-bits/bits-tests/smilatency.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/testacpi.py2 b/tests/functi= onal/acpi-bits/bits-tests/testacpi.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/testacpi.py2 rename to tests/functional/acpi-bits/bits-tests/testacpi.py2 diff --git a/tests/avocado/acpi-bits/bits-tests/testcpuid.py2 b/tests/funct= ional/acpi-bits/bits-tests/testcpuid.py2 similarity index 100% rename from tests/avocado/acpi-bits/bits-tests/testcpuid.py2 rename to tests/functional/acpi-bits/bits-tests/testcpuid.py2 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 109e0408e4..52328f44b6 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -11,6 +11,7 @@ endif =20 # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { + 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240, 'ppc64_powernv' : 120, @@ -96,6 +97,7 @@ tests_x86_64_quick =3D [ ] =20 tests_x86_64_thorough =3D [ + 'acpi_bits', 'netdev_ethtool', 'virtio_gpu', ] diff --git a/tests/avocado/acpi-bits.py b/tests/functional/test_acpi_bits.py old mode 100644 new mode 100755 similarity index 95% rename from tests/avocado/acpi-bits.py rename to tests/functional/test_acpi_bits.py index efe4f52ee0..697fa4e768 --- a/tests/avocado/acpi-bits.py +++ b/tests/functional/test_acpi_bits.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# group: rw quick +# # Exercise QEMU generated ACPI/SMBIOS tables using biosbits, # https://biosbits.org/ # @@ -41,15 +41,16 @@ import tempfile import time import zipfile + +from pathlib import Path from typing import ( List, Optional, Sequence, ) from qemu.machine import QEMUMachine -from avocado import skipIf -from avocado.utils import datadrainer as drainer -from avocado_qemu import QemuBaseTest +from unittest import skipIf +from qemu_test import QemuBaseTest =20 deps =3D ["xorriso", "mformat"] # dependent tools needed in the test setup= /box. supported_platforms =3D ['x86_64'] # supported test platforms. @@ -129,10 +130,6 @@ def base_args(self): class AcpiBitsTest(QemuBaseTest): #pylint: disable=3Dtoo-many-instance-att= ributes """ ACPI and SMBIOS tests using biosbits. - - :avocado: tags=3Darch:x86_64 - :avocado: tags=3Dacpi - """ # in slower systems the test can take as long as 3 minutes to complete. timeout =3D BITS_TIMEOUT @@ -155,8 +152,7 @@ def __init__(self, *args, **kwargs): "download?job=3Dqemu-bits-build" %self._bitsTa= g) self._debugcon_addr =3D '0x403' self._debugcon_log =3D 'debugcon-log.txt' - logging.basicConfig(level=3Dlogging.INFO) - self.logger =3D logging.getLogger('acpi-bits') + self.logger =3D self.log =20 def _print_log(self, log): self.logger.info('\nlogs from biosbits follows:') @@ -282,8 +278,9 @@ def generate_bits_iso(self): =20 def setUp(self): # pylint: disable=3Darguments-differ super().setUp('qemu-system-') + self.logger =3D self.log =20 - self._baseDir =3D os.getenv('AVOCADO_TEST_BASEDIR') + self._baseDir =3D Path(__file__).parent =20 # workdir could also be avocado's own workdir in self.workdir. # At present, I prefer to maintain my own temporary working @@ -393,12 +390,6 @@ def test_acpi_smbios_bits(self): self._vm.set_console() self._vm.launch() =20 - 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 # biosbits has been configured to run all the specified test suites # in batch mode and then automatically initiate a vm shutdown. @@ -406,4 +397,8 @@ def test_acpi_smbios_bits(self): # with the avocado test timeout. self._vm.event_wait('SHUTDOWN', timeout=3DBITS_TIMEOUT) self._vm.wait(timeout=3DNone) + self.logger.debug("Checking console output ...") self.parse_log() + +if __name__ =3D=3D '__main__': + QemuBaseTest.main() --=20 2.45.2