From patchwork Wed Feb 5 15:59:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 13961453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5A5AC02198 for ; Wed, 5 Feb 2025 16:00:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tfhom-0006nV-Oi; Wed, 05 Feb 2025 11:00:00 -0500 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 1tfhok-0006mZ-8x for qemu-devel@nongnu.org; Wed, 05 Feb 2025 10:59:58 -0500 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 1tfhoi-0001Ku-Nr for qemu-devel@nongnu.org; Wed, 05 Feb 2025 10:59:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738771195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fysQSNA1E970ViCFvsrSMcbTwNV0+wBLHllSL/r6qwc=; b=G5OdXD9QGjyPzhlkMpU4PqQUWB5n4/wcHD0jDNBiUAEXpglCyFRSkoSCoMX8lwPHBeQLre yrfyzKgKvxJW1xRdEZj4N8ExP/tQJc7MCR1hXau03pfSTpDPpWfOkOk78kkbBRTT1UuJ3S cln5lJxjRVa8alPHt2IyckUm1CtFTaQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-v0VYLq4kN0usPTmUcwozWg-1; Wed, 05 Feb 2025 10:59:53 -0500 X-MC-Unique: v0VYLq4kN0usPTmUcwozWg-1 X-Mimecast-MFC-AGG-ID: v0VYLq4kN0usPTmUcwozWg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 632521800373; Wed, 5 Feb 2025 15:59:52 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6FB6A195608D; Wed, 5 Feb 2025 15:59:50 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] tests/functional: skip test if QEMU_TEST_QEMU_BINARY is not set Date: Wed, 5 Feb 2025 15:59:42 +0000 Message-ID: <20250205155946.2811296-2-berrange@redhat.com> In-Reply-To: <20250205155946.2811296-1-berrange@redhat.com> References: <20250205155946.2811296-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org If QEMU_TEST_QEMU_BINARY is not set we currently assert in the setUp function, resulting in a big traceback: TAP version 13 Traceback (most recent call last): File "/var/home/berrange/src/virt/qemu/tests/functional/qemu_test/testcase.py", line 280, in setUp super().setUp('qemu-system-') ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/var/home/berrange/src/virt/qemu/tests/functional/qemu_test/testcase.py", line 196, in setUp self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be set') ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: unexpectedly None : QEMU_TEST_QEMU_BINARY must be set not ok 1 test_ppc_405.Ppc405Machine.test_ppc_ref405ep 1..1 For every other test pre-requisite that's missing we will mark the test as skipped. This does the same for missing QEMU_TEST_QEMU_BINARY, such that we get TAP version 13 ok 1 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 2 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_noapic_nomsi # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 3 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_nomsi # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 4 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_novector # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 5 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_novector_noapic # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 6 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_novector_nomsi # SKIP QEMU_TEST_QEMU_BINARY env variable is not set ok 7 test_x86_64_kvm_xen.KVMXenGuest.test_kvm_xen_guest_vapic # SKIP QEMU_TEST_QEMU_BINARY env variable is not set 1..7 Signed-off-by: Daniel P. Berrangé --- tests/functional/qemu_test/testcase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 869f3949fe..94541e8bfb 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -193,7 +193,9 @@ def assets_available(self): return True def setUp(self, bin_prefix): - self.assertIsNotNone(self.qemu_bin, 'QEMU_TEST_QEMU_BINARY must be set') + if self.qemu_bin is None: + self.skipTest("QEMU_TEST_QEMU_BINARY env variable is not set") + self.arch = self.qemu_bin.split('-')[-1] self.socketdir = None From patchwork Wed Feb 5 15:59:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 13961454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AD736C02192 for ; Wed, 5 Feb 2025 16:00:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tfhos-0006or-EX; Wed, 05 Feb 2025 11:00:06 -0500 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 1tfhoq-0006oM-B2 for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:04 -0500 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 1tfhoo-0001LO-HG for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738771200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g4GxtRuTE/tRrwPDpYOfV4BzsfnM7SOpGaFfYwquWYY=; b=HF2HAHEoZBZJxVw7n3yFcNtszqHmIp0Fan+I/zQJfu0PEb+9qNS1Zo+/jsCVTl2V/gc+PJ 5XkrbZrTF1UcuPzk1z7DPgrJr85aVA9vIVPvRO560vhHgzzNHxntFv0gmK+24qHrA9Ddq1 lSwehA7cSdzpGdeeb1ckWZC/D3yR4l8= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-AoO9NpDqN6qNKzIw33Sevw-1; Wed, 05 Feb 2025 10:59:56 -0500 X-MC-Unique: AoO9NpDqN6qNKzIw33Sevw-1 X-Mimecast-MFC-AGG-ID: AoO9NpDqN6qNKzIw33Sevw Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D3ADB1801BF3; Wed, 5 Feb 2025 15:59:54 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F4050195608D; Wed, 5 Feb 2025 15:59:52 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] tests/functional: remove unused 'bin_prefix' variable Date: Wed, 5 Feb 2025 15:59:43 +0000 Message-ID: <20250205155946.2811296-3-berrange@redhat.com> In-Reply-To: <20250205155946.2811296-1-berrange@redhat.com> References: <20250205155946.2811296-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This was copied over from avocado but has not been used in the new functional tests. Signed-off-by: Daniel P. Berrangé --- tests/functional/qemu_test/testcase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 94541e8bfb..332c782ebc 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -192,7 +192,7 @@ def assets_available(self): return False return True - def setUp(self, bin_prefix): + def setUp(self): if self.qemu_bin is None: self.skipTest("QEMU_TEST_QEMU_BINARY env variable is not set") @@ -256,7 +256,7 @@ def main(): class QemuUserTest(QemuBaseTest): def setUp(self): - super().setUp('qemu-') + super().setUp() self._ldpath = [] def add_ldpath(self, ldpath): @@ -279,7 +279,7 @@ class QemuSystemTest(QemuBaseTest): def setUp(self): self._vms = {} - super().setUp('qemu-system-') + super().setUp() console_log = logging.getLogger('console') console_log.setLevel(logging.DEBUG) From patchwork Wed Feb 5 15:59:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 13961458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7B118C02192 for ; Wed, 5 Feb 2025 16:01:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tfhot-0006p8-E6; Wed, 05 Feb 2025 11:00:07 -0500 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 1tfhoq-0006oL-AK for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:04 -0500 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 1tfhoo-0001Lf-MA for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738771201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9ZHuUSSEfLVR8YhjvWGcoC8+zUMIHyaTIZI83tFOw5M=; b=NAj2i8m2Z+aK6GCz6Q5Qi8aOe+ANixcMSxVtWCeUh60AtPcihxb5TbR6Vx0TVBAgogfwXC TYow2Q0dEyJbnz3ksEMJU9TwiP18V6gwgilEVbKVwLfp7PXdEihg4eIyMzoIIWvTwOD/3W VNO16oO20RIdmtmOeaNDk7nykgpDlcg= Received: from mx-prod-mc-02.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-362-fo0lflImNKOu8eWW-tJGsg-1; Wed, 05 Feb 2025 10:59:58 -0500 X-MC-Unique: fo0lflImNKOu8eWW-tJGsg-1 X-Mimecast-MFC-AGG-ID: fo0lflImNKOu8eWW-tJGsg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4E8721955ED9; Wed, 5 Feb 2025 15:59:57 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5678E195608D; Wed, 5 Feb 2025 15:59:55 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] tests/functional: set 'qemu_bin' as an object level field Date: Wed, 5 Feb 2025 15:59:44 +0000 Message-ID: <20250205155946.2811296-4-berrange@redhat.com> In-Reply-To: <20250205155946.2811296-1-berrange@redhat.com> References: <20250205155946.2811296-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The 'qemu_bin' field is currently set on the class, despite being accessed as if it were an object instance field with 'self.qemu_bin'. This is no obvious need to have it as a class field, so move it into the object instance. Signed-off-by: Daniel P. Berrangé --- docs/devel/testing/functional.rst | 2 +- tests/functional/qemu_test/testcase.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/testing/functional.rst b/docs/devel/testing/functional.rst index ecc738922b..bcb5509512 100644 --- a/docs/devel/testing/functional.rst +++ b/docs/devel/testing/functional.rst @@ -173,7 +173,7 @@ QEMU binary selection ^^^^^^^^^^^^^^^^^^^^^ The QEMU binary used for the ``self.vm`` QEMUMachine instance will -primarily depend on the value of the ``qemu_bin`` class attribute. +primarily depend on the value of the ``qemu_bin`` instance attribute. If it is not explicitly set by the test code, its default value will be the result the QEMU_TEST_QEMU_BINARY environment variable. diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 332c782ebc..574c1942f2 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -33,7 +33,6 @@ class QemuBaseTest(unittest.TestCase): - qemu_bin = os.getenv('QEMU_TEST_QEMU_BINARY') arch = None workdir = None @@ -193,6 +192,7 @@ def assets_available(self): return True def setUp(self): + self.qemu_bin = os.getenv('QEMU_TEST_QEMU_BINARY') if self.qemu_bin is None: self.skipTest("QEMU_TEST_QEMU_BINARY env variable is not set") From patchwork Wed Feb 5 15:59:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 13961455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3BF55C02197 for ; Wed, 5 Feb 2025 16:00:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tfhou-0006pd-NM; Wed, 05 Feb 2025 11:00:08 -0500 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 1tfhor-0006oj-L9 for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:05 -0500 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 1tfhop-0001PJ-Ey for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738771202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iJ2p1A8CTSdONnDKxN+tuBTW4cFdXDYG7d72xpn4jPM=; b=d0sEOBWZBsIGfWLUUXpz60TaZODBx+LD6Wq7HCBmKHH7ZctKsE7X73xmYhwaogipIMKWT/ ypzsyPJAaVAu5wM6fabIeT+dP9eHxmaaIjqRDlnPYeLB65vBim9bjawqS9m6epH1QNjKXL 05M9GOiMN9KyksccR4khcKa4J7Pdaac= Received: from mx-prod-mc-02.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-592-5pr-3K1PP6ezdUyM2k1fnA-1; Wed, 05 Feb 2025 11:00:01 -0500 X-MC-Unique: 5pr-3K1PP6ezdUyM2k1fnA-1 X-Mimecast-MFC-AGG-ID: 5pr-3K1PP6ezdUyM2k1fnA Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32AFE1955E94; Wed, 5 Feb 2025 16:00:00 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C5FAF195608D; Wed, 5 Feb 2025 15:59:57 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] tests/functional: remove all class level fields Date: Wed, 5 Feb 2025 15:59:45 +0000 Message-ID: <20250205155946.2811296-5-berrange@redhat.com> In-Reply-To: <20250205155946.2811296-1-berrange@redhat.com> References: <20250205155946.2811296-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org A number of fields are set at the class level on QemuBaseTest, even though the exact same named field is then set at the object level later in most cases. Signed-off-by: Daniel P. Berrangé --- tests/functional/qemu_test/testcase.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 574c1942f2..531d6393ad 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -33,12 +33,6 @@ class QemuBaseTest(unittest.TestCase): - arch = None - - workdir = None - log = None - logdir = None - ''' @params compressed: filename, Asset, or file-like object to uncompress @params format: optional compression format (gzip, lzma) From patchwork Wed Feb 5 15:59:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 13961457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 896C9C02192 for ; Wed, 5 Feb 2025 16:01:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tfhox-0006pz-8d; Wed, 05 Feb 2025 11:00:11 -0500 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 1tfhov-0006ph-Qa for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:09 -0500 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 1tfhos-0001Xu-9B for qemu-devel@nongnu.org; Wed, 05 Feb 2025 11:00:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738771205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dL8Z/bhkQjotEMwlHIYSRAsV8q1dl/IpscxL1xN+G9A=; b=b3tr8279cmqO8/XaHPfIYQTIv7GLrh7M4r2RKpIxDN4TMALiAQCqmNZMreVrAijoyyIygj OtKX1hVKz7ky4s9g+Y5kV29yEbqWZVWrnJvlCYpak5CTIQttffZcUsLIOGNFOgnZCEObbu n97XQbMLSn5yqwDf/PrtL9kz+fTcERw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-LDAeOsESOduXAKajJTRhHQ-1; Wed, 05 Feb 2025 11:00:04 -0500 X-MC-Unique: LDAeOsESOduXAKajJTRhHQ-1 X-Mimecast-MFC-AGG-ID: LDAeOsESOduXAKajJTRhHQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E916718011E6; Wed, 5 Feb 2025 16:00:02 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A7908195608D; Wed, 5 Feb 2025 16:00:00 +0000 (UTC) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/5] tests/functional: skip mem addr test on 32-bit hosts Date: Wed, 5 Feb 2025 15:59:46 +0000 Message-ID: <20250205155946.2811296-6-berrange@redhat.com> In-Reply-To: <20250205155946.2811296-1-berrange@redhat.com> References: <20250205155946.2811296-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The test_mem_addr_space is validating handling of QEMU with various memory address settings. All of the test cases are setting 'maxmem' to a value that exceeds the 32-bit address space, so these must all be skipped on 32-bit hosts. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé --- tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/decorators.py | 12 ++++++++++++ tests/functional/test_mem_addr_space.py | 17 ++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py index 5c972843a6..7a90311891 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -15,6 +15,6 @@ from .linuxkernel import LinuxKernelTest from .decorators import skipIfMissingCommands, skipIfNotMachine, \ skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \ - skipIfMissingImports + skipIfMissingImports, skipIf32BitTarget from .archive import archive_extract from .uncompress import uncompress diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py index 1651eb739a..d3a8cf0483 100644 --- a/tests/functional/qemu_test/decorators.py +++ b/tests/functional/qemu_test/decorators.py @@ -5,6 +5,7 @@ import importlib import os import platform +import sys from unittest import skipUnless from .cmd import which @@ -118,3 +119,14 @@ def skipIfMissingImports(*args): return skipUnless(has_imports, 'required import(s) "%s" not installed' % ", ".join(args)) + +''' +Decorator to skip execution of a test on 32-bit targets +Example: + + @skipIf32BitTarget() +''' +def skipIf32BitTarget(): + enoughBits = sys.maxsize > 2**32 + return skipUnless(enoughBits, + 'Test requires a host with 64-bit address space') diff --git a/tests/functional/test_mem_addr_space.py b/tests/functional/test_mem_addr_space.py index bb0cf062ca..3e0215beb3 100755 --- a/tests/functional/test_mem_addr_space.py +++ b/tests/functional/test_mem_addr_space.py @@ -10,7 +10,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from qemu_test import QemuSystemTest +from qemu_test import QemuSystemTest, skipIf32BitTarget import time class MemAddrCheck(QemuSystemTest): @@ -22,6 +22,7 @@ class MemAddrCheck(QemuSystemTest): # first, lets test some 32-bit processors. # for all 32-bit cases, pci64_hole_size is 0. + @skipIf32BitTarget() def test_phybits_low_pse36(self): """ With pse36 feature ON, a processor has 36 bits of addressing. So it can @@ -49,6 +50,7 @@ def test_phybits_low_pse36(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_low_pae(self): """ With pae feature ON, a processor has 36 bits of addressing. So it can @@ -66,6 +68,7 @@ def test_phybits_low_pae(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_pentium_pse36(self): """ Setting maxmem to 59.5G and making sure that QEMU can start with the @@ -82,6 +85,7 @@ def test_phybits_ok_pentium_pse36(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_pentium_pae(self): """ Test is same as above but now with pae cpu feature turned on. @@ -99,6 +103,7 @@ def test_phybits_ok_pentium_pae(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_pentium2(self): """ Pentium2 has 36 bits of addressing, so its same as pentium @@ -115,6 +120,7 @@ def test_phybits_ok_pentium2(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_low_nonpse36(self): """ Pentium processor has 32 bits of addressing without pse36 or pae @@ -135,6 +141,7 @@ def test_phybits_low_nonpse36(self): self.assertRegex(self.vm.get_log(), r'phys-bits too low') # now lets test some 64-bit CPU cases. + @skipIf32BitTarget() def test_phybits_low_tcg_q35_70_amd(self): """ For q35 7.1 machines and above, there is a HT window that starts at @@ -161,6 +168,7 @@ def test_phybits_low_tcg_q35_70_amd(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_low_tcg_q35_71_amd(self): """ AMD_HT_START is defined to be at 1012 GiB. So for q35 machines @@ -181,6 +189,7 @@ def test_phybits_low_tcg_q35_71_amd(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_tcg_q35_70_amd(self): """ Same as q35-7.0 AMD case except that here we check that QEMU can @@ -197,6 +206,7 @@ def test_phybits_ok_tcg_q35_70_amd(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_tcg_q35_71_amd(self): """ Same as q35-7.1 AMD case except that here we check that QEMU can @@ -213,6 +223,7 @@ def test_phybits_ok_tcg_q35_71_amd(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_tcg_q35_71_intel(self): """ Same parameters as test_phybits_low_tcg_q35_71_amd() but use @@ -231,6 +242,7 @@ def test_phybits_ok_tcg_q35_71_intel(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_low_tcg_q35_71_amd_41bits(self): """ AMD processor with 41 bits. Max cpu hw address = 2 TiB. @@ -255,6 +267,7 @@ def test_phybits_low_tcg_q35_71_amd_41bits(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_tcg_q35_71_amd_41bits(self): """ AMD processor with 41 bits. Max cpu hw address = 2 TiB. @@ -273,6 +286,7 @@ def test_phybits_ok_tcg_q35_71_amd_41bits(self): self.vm.shutdown() self.assertNotRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_low_tcg_q35_intel_cxl(self): """ cxl memory window starts after memory device range. Here, we use 1 GiB @@ -293,6 +307,7 @@ def test_phybits_low_tcg_q35_intel_cxl(self): self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") self.assertRegex(self.vm.get_log(), r'phys-bits too low') + @skipIf32BitTarget() def test_phybits_ok_tcg_q35_intel_cxl(self): """ Same as above but here we do not reserve any cxl memory window. Hence,