From nobody Sun Jul 26 11:06:40 2026 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=posteo.eu ARC-Seal: i=1; a=rsa-sha256; t=1783405188; cv=none; d=zohomail.com; s=zohoarc; b=m9EbDbAlcWvv+Dn1QDIu8xN4Qe9ub/dpM7KfMN02mYNX1wCn77Btkzza0xmHWnkueSY8ZsBrlRV4uboWyxzXSnVpQuQ2K0FtQofAwV/HLOYwaGwHKxmPUApXm2kN7JSxF/Pvmru7Lv4eosMrv0Gtak8vllUbmye1pXctUd/G9c0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783405188; 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=VKFM2IaRNN4DJdtb2GSgcTdTHhiZmoE3vAhb4sDdm2U=; b=LQPok93tP9vRDhSmdHSdYQotbwCjpVJaerTQqHINCLzPmWBU7yUG9tcKZqmoFd8tqjiXdx+pkjhLsNT2rDDoKf6fux+0T8Ao3tSDXw0NZM5MxLipdUXMuQ9ZCVjoT+t377asIvZ690/TxPoBgDie884Cvv78fxiGLTd650s7YSk= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783405188787157.40149638580363; Mon, 6 Jul 2026 23:19:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wgz9H-0003hY-Kp; Tue, 07 Jul 2026 02:19:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz9B-0003es-Mz for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:11 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz99-0001H7-G4 for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 44F49240103 for ; Tue, 7 Jul 2026 08:19:04 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4gvWJl6B1Vz9rxG; Tue, 7 Jul 2026 08:19:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.eu; s=1984.8680eb; t=1783405144; bh=VKFM2IaRNN4DJdtb2GSgcTdTHhiZmoE3vAhb4sDdm2U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=SVjsD+99X1DWbB3N9Oj3Cw5u2lyYhScTMSdh/wJiccLGJAjEM9XOH4wEugd0pzoq6 vgWaN5lSPCpLOyW/0Fi14tW+oI41FxQrrzcaqtl1rcgkhFHN+qhkSKyD9obXlIXuAD QNxU7LoYv34d2g36lRDGLGsWvRe9Hz6StZJ5eDDtR6xGN+yrSaZLYahg7ox+U31S6j ykRHJMiJBHTHSXwwK6e2PW2kxiq6PPNgl81kgeTrcaAkl7fSCKCyNuYwNby0ZkdsMq Fze0gHE9gn4buyW/OyKRkcsOHBzv7FWDWfgrf/FoTI0pTPrZo+6ejp8cY4epYycMKG 9wiXjtsMDaVWQ== From: Thomas Huth To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Subject: [PULL 1/3] tests/functional: Add hotplug_scsi test to hotplug virtio-scsi disk Date: Tue, 07 Jul 2026 06:19:04 +0000 Message-ID: <20260707061851.8298-2-th.huth@posteo.eu> In-Reply-To: <20260707061851.8298-1-th.huth@posteo.eu> References: <20260707061851.8298-1-th.huth@posteo.eu> 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=lists1p.gnu.org; Received-SPF: pass client-ip=185.67.36.66; envelope-from=th.huth@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development 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 @posteo.eu) X-ZM-MESSAGEID: 1783405190405158500 Content-Type: text/plain; charset="utf-8" From: Siddhi Katage Signed-off-by: Siddhi Katage Message-ID: <20260210113135.771697-1-siddhi.katage@oracle.com> [thuth: Add the new .py file to the MAINTAINERS file] Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/functional/x86_64/meson.build | 1 + tests/functional/x86_64/test_hotplug_scsi.py | 86 ++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100755 tests/functional/x86_64/test_hotplug_scsi.py diff --git a/MAINTAINERS b/MAINTAINERS index 97dcc78ded..ed65654698 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2338,6 +2338,7 @@ F: tests/qtest/virtio-scsi-test.c F: tests/qtest/fuzz-virtio-scsi-test.c F: tests/qtest/am53c974-test.c F: tests/qtest/fuzz-lsi53c895a-test.c +F: tests/functional/x86_64/test_hotplug_scsi.py T: git https://github.com/bonzini/qemu.git scsi-next =20 SSI diff --git a/tests/functional/x86_64/meson.build b/tests/functional/x86_64/= meson.build index 1ed10ad6c2..d237ca156e 100644 --- a/tests/functional/x86_64/meson.build +++ b/tests/functional/x86_64/meson.build @@ -31,6 +31,7 @@ endif tests_x86_64_system_thorough =3D [ 'acpi_bits', 'hotplug_blk', + 'hotplug_scsi', 'hotplug_cpu', 'intel_iommu', 'kvm_xen', diff --git a/tests/functional/x86_64/test_hotplug_scsi.py b/tests/functiona= l/x86_64/test_hotplug_scsi.py new file mode 100755 index 0000000000..10fd306616 --- /dev/null +++ b/tests/functional/x86_64/test_hotplug_scsi.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# +# Functional test that hotplugs a virtio scsi disk and checks it on a Linux +# guest +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pa= ttern + +class HotPlugScsi(LinuxKernelTest): + ASSET_KERNEL =3D Asset( + ('https://archives.fedoraproject.org/pub/archive/fedora/linux/rele= ases' + '/31/Server/x86_64/os/images/pxeboot/vmlinuz'), + 'd4738d03dbbe083ca610d0821d0a8f1488bebbdccef54ce33e3adb35fda00129') + + ASSET_INITRD =3D Asset( + ('https://archives.fedoraproject.org/pub/archive/fedora/linux/rele= ases' + '/31/Server/x86_64/os/images/pxeboot/initrd.img'), + '277cd6c7adf77c7e63d73bbb2cded8ef9e2d3a2f100000e92ff1f8396513cd8b') + + def blockdev_add(self) -> None: + self.vm.cmd('blockdev-add', **{ + 'driver': 'null-co', + 'size': 1073741824, + 'node-name': 'disk0' + }) + + def add_scsi_controller(self) -> None: + self.vm.cmd('device_add', { + 'driver': 'virtio-scsi-pci', + 'id': 'scsi0', + 'bus': 'pci.1', + 'addr': '1', + }) + + def assert_sda(self) -> None: + exec_command_and_wait_for_pattern(self, 'while ! test -e /sys/bloc= k/sda ;' + ' do sleep 0.2 ; done', '#= ') + + def assert_no_sda(self) -> None: + exec_command_and_wait_for_pattern(self, 'while test -e /sys/block/= sda ;' + ' do sleep 0.2 ; done', '#= ') + + def plug(self) -> None: + args =3D { + 'driver':'scsi-hd', + 'drive':'disk0', + 'bus':'scsi0.0', + 'id':'scsi-disk0', + } + + self.assert_no_sda() + self.vm.cmd('device_add', args) + self.wait_for_console_pattern('[sda] Attached SCSI disk') + self.assert_sda() + + def unplug(self) -> None: + self.vm.cmd('device_del', id=3D'scsi-disk0') + + self.vm.event_wait('DEVICE_DELETED', 1.0, + match=3D{'data': {'device': 'scsi-disk0'}}) + + self.assert_no_sda() + + def test(self) -> None: + self.require_accelerator('kvm') + self.set_machine('q35') + self.vm.add_args('-accel', 'kvm') + self.vm.add_args('-device', 'pcie-pci-bridge,id=3Dpci.1,bus=3Dpcie= .0') + self.vm.add_args('-m', '1G') + self.vm.add_args('-append', 'console=3DttyS0 rd.rescue') + + self.launch_kernel(self.ASSET_KERNEL.fetch(), + self.ASSET_INITRD.fetch(), + wait_for=3D'Entering emergency mode.') + self.wait_for_console_pattern('# ') + + self.blockdev_add() + self.add_scsi_controller() + self.plug() + self.unplug() + + +if __name__ =3D=3D '__main__': + LinuxKernelTest.main() + --=20 2.54.0 From nobody Sun Jul 26 11:06:40 2026 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=posteo.eu ARC-Seal: i=1; a=rsa-sha256; t=1783405197; cv=none; d=zohomail.com; s=zohoarc; b=mt9ObeRYmGKcVw094/bJXpGcNWLYPtZ2oJtCy08foS2tlG8FKTr9VuKqJcOxI8Uwi08CXRu4QRMRc1I/8OyZSRF9RM7VAJdDF0QOzCO3CgRDZLT3R2ysM5HIwoffg1jw/laEWNHI9qgN3p6w6f7os8UpAyZgjF4mbo87ChOnuGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783405197; h=Content-Type: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=7QgkWxDqsKGyeHGrlZEQIjZR/SmL5z10D2fm4AH3XoU=; b=abWp6fGse67krf4P5hXdTejjjwXOzUIzh59BpFQQ9PBnBi0+82WDHqXoQhBncFQncVYSRj4Y3qwRlVYs80uTDCyTsH9XiOU2bCCSY8CLDkQiCvQ+Wo3Yhqod0Kd8zGyWkI6zfFLapF+/XW1kRUvzBXulIcbLDuaGw+B7sACbgcM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178340519719745.54173208222517; Mon, 6 Jul 2026 23:19:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wgz9I-0003hk-2B; Tue, 07 Jul 2026 02:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz9D-0003fn-HE for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:13 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz99-0001H6-Rs for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:11 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8CE1D240101 for ; Tue, 7 Jul 2026 08:19:04 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4gvWJm10fGz9rxF; Tue, 7 Jul 2026 08:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.eu; s=1984.8680eb; t=1783405144; bh=7QgkWxDqsKGyeHGrlZEQIjZR/SmL5z10D2fm4AH3XoU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=FWDtk92+IbQU3JIOy7uVnE1dHXzsaaijxMa4Ijkl6Wkv/umi2srmBpu7xGffm/fvA TO7X8gLZZdNwc8jijK3G9SFNfMj3QNnTBGNYmtlTIwCMIxMxWrZgdsOyRK0n0QBoN8 4jEjU72ASmwfvzIeQC/n2mNJydLkvM6YuHuJCQyNGu8M7iQ8+HREdh4s63EyCU+AdC h2WRJiG1KWiQpoYQA7eWoYCuj2Ptxck4MrsHFplhjSU/TOI3tNd+ifkgDj4PSQ3MX6 5DppaG9smLtQtf6VCg3lowJOzRaTjoYDmXUS7gBLdxO6DPdpeO5LeAg0E9DaRVY1mq GaF24awAqhsrw== From: Thomas Huth To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Subject: [PULL 2/3] tests/functional/aspeed: unify boot completion detection on 'login:' prompt Date: Tue, 07 Jul 2026 06:19:04 +0000 Message-ID: <20260707061851.8298-3-th.huth@posteo.eu> In-Reply-To: <20260707061851.8298-1-th.huth@posteo.eu> References: <20260707061851.8298-1-th.huth@posteo.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=185.67.36.66; envelope-from=th.huth@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development 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 @posteo.eu) X-ZM-MESSAGEID: 1783405198546158500 From: C=C3=A9dric Le Goater The boot completion check in AspeedTest waits for the systemd "Hostname set to" message, which occasionally causes intermittent test timeouts, e.g. on ast2500 SoC machines. The root cause seems to be console output interleaving of both systemd and the getty login process. This results in the expected pattern string being broken up. Unify and simplify all boot completion checks by looking for the generic 'login:' substring in AspeedTest.wait_for_boot_complete(). With the override gone, remove the redundant FacebookAspeedTest class and update the Anacapa, Bletchley, and Catalina tests to inherit directly from AspeedTest. Also drop the now-dead image_hostname parameter from do_test_arm_aspeed_openbmc(). Reported-by: Peter Maydell Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3117 Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Thomas Huth Message-ID: <20260617042718.2883655-1-clg@redhat.com> Signed-off-by: Thomas Huth --- tests/functional/arm/test_aspeed_anacapa.py | 6 +++--- tests/functional/arm/test_aspeed_bletchley.py | 6 +++--- tests/functional/arm/test_aspeed_catalina.py | 6 +++--- .../arm/test_aspeed_gb200nvl_bmc.py | 3 +-- tests/functional/aspeed.py | 21 ++++--------------- 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/tests/functional/arm/test_aspeed_anacapa.py b/tests/functional= /arm/test_aspeed_anacapa.py index 27f8bd8b56..809afeaeb8 100644 --- a/tests/functional/arm/test_aspeed_anacapa.py +++ b/tests/functional/arm/test_aspeed_anacapa.py @@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 from qemu_test import Asset -from aspeed import FacebookAspeedTest +from aspeed import AspeedTest =20 =20 -class AnacapaMachine(FacebookAspeedTest): +class AnacapaMachine(AspeedTest): =20 ASSET_ANACAPA_FLASH =3D Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/3fa3212827b04be4= 034d43b5adeef57c27d6ab18/images/anacapa-bmc/openbmc-20260512025228/obmc-pho= sphor-image-anacapa-20260512025228.static.mtd.xz', @@ -22,4 +22,4 @@ def test_arm_ast2600_anacapa_openbmc(self): soc=3D'AST2600 rev A3') =20 if __name__ =3D=3D '__main__': - FacebookAspeedTest.main() + AspeedTest.main() diff --git a/tests/functional/arm/test_aspeed_bletchley.py b/tests/function= al/arm/test_aspeed_bletchley.py index 3000d0c302..5a60b24b3d 100755 --- a/tests/functional/arm/test_aspeed_bletchley.py +++ b/tests/functional/arm/test_aspeed_bletchley.py @@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 from qemu_test import Asset -from aspeed import FacebookAspeedTest +from aspeed import AspeedTest =20 =20 -class BletchleyMachine(FacebookAspeedTest): +class BletchleyMachine(AspeedTest): =20 ASSET_BLETCHLEY_FLASH =3D Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bl= etchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-2025012807= 1329.static.mtd.xz', @@ -22,4 +22,4 @@ def test_arm_ast2600_bletchley_openbmc(self): soc=3D'AST2600 rev A3') =20 if __name__ =3D=3D '__main__': - FacebookAspeedTest.main() + AspeedTest.main() diff --git a/tests/functional/arm/test_aspeed_catalina.py b/tests/functiona= l/arm/test_aspeed_catalina.py index 2694e4b005..dc2f24e7b4 100755 --- a/tests/functional/arm/test_aspeed_catalina.py +++ b/tests/functional/arm/test_aspeed_catalina.py @@ -5,10 +5,10 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 from qemu_test import Asset -from aspeed import FacebookAspeedTest +from aspeed import AspeedTest =20 =20 -class CatalinaMachine(FacebookAspeedTest): +class CatalinaMachine(AspeedTest): =20 ASSET_CATALINA_FLASH =3D Asset( 'https://github.com/legoater/qemu-aspeed-boot/raw/a866feb5ef81245b= 4827a214584bf6bcc72939f6/images/catalina-bmc/obmc-phosphor-image-catalina-2= 0250619123021.static.mtd.xz', @@ -22,4 +22,4 @@ def test_arm_ast2600_catalina_openbmc(self): soc=3D'AST2600 rev A3') =20 if __name__ =3D=3D '__main__': - FacebookAspeedTest.main() + AspeedTest.main() diff --git a/tests/functional/arm/test_aspeed_gb200nvl_bmc.py b/tests/funct= ional/arm/test_aspeed_gb200nvl_bmc.py index e5f2dce0f5..f9e736d047 100755 --- a/tests/functional/arm/test_aspeed_gb200nvl_bmc.py +++ b/tests/functional/arm/test_aspeed_gb200nvl_bmc.py @@ -19,8 +19,7 @@ def test_arm_aspeed_gb200_openbmc(self): =20 self.do_test_arm_aspeed_openbmc('gb200nvl-bmc', image=3Dimage_path, uboot=3D'2019.04', cpu_id=3D'0xf00= ', - soc=3D'AST2600 rev A3', - image_hostname=3D'gb200nvl-obmc') + soc=3D'AST2600 rev A3') =20 if __name__ =3D=3D '__main__': AspeedTest.main() diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py index 88b6590934..076da1036c 100644 --- a/tests/functional/aspeed.py +++ b/tests/functional/aspeed.py @@ -8,14 +8,7 @@ class AspeedTest(LinuxKernelTest): =20 def do_test_arm_aspeed_openbmc(self, machine, image, uboot=3D'2019.04', - cpu_id=3D'0x0', soc=3D'AST2500 rev A1', - image_hostname=3DNone): - # Allow for the image hostname to not end in "-bmc" - if image_hostname is not None: - hostname =3D image_hostname - else: - hostname =3D machine.removesuffix('-bmc') - + cpu_id=3D'0x0', soc=3D'AST2500 rev A1'): self.set_machine(machine) self.vm.set_console() self.vm.add_args('-drive', f'file=3D{image},if=3Dmtd,format=3Draw', @@ -28,10 +21,10 @@ def do_test_arm_aspeed_openbmc(self, machine, image, ub= oot=3D'2019.04', self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu= _id}') self.wait_for_console_pattern(f'ASPEED {soc}') self.wait_for_console_pattern('/init as init process') - self.wait_for_boot_complete(hostname) + self.wait_for_boot_complete() =20 - def wait_for_boot_complete(self, hostname): - self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{host= name}>.') + def wait_for_boot_complete(self): + self.wait_for_console_pattern('login:') =20 def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern=3D= 'Aspeed EVB'): self.require_netdev('user') @@ -71,9 +64,3 @@ def generate_otpmem_image(self): with open(path, "wb") as f: f.write(pattern) return path - - -class FacebookAspeedTest(AspeedTest): - - def wait_for_boot_complete(self, hostname): - self.wait_for_console_pattern(f'{hostname} login:') --=20 2.54.0 From nobody Sun Jul 26 11:06:40 2026 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=posteo.eu ARC-Seal: i=1; a=rsa-sha256; t=1783405184; cv=none; d=zohomail.com; s=zohoarc; b=BmNQgb4FCsKvXT6Ysnu2/ue6NVWmrfD41JU+0z/r98nng5LQ0z61HbYqrvR0kTBb1qWdjBkeW4VUrn/Dtf02LZDNa2ThJDWX6PpUFt7IEFIKZKO07e5i6XL2HZ6GgqowPnlO29PVAAb18h4IYt9d/ntvWDysGFeqwvFC0OvLHHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783405184; h=Content-Type: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=sqJjUQr1d6MtGh6P89u1z/j9xMEOCvznwFnXrNcsL+k=; b=C5WofnghvJzagmUK7+rh5lFHKWgiq4X6M+YvIFBjGzxOLFDg+CeEa7QqCjAeWtga3vO8qXIRUFhfSPZ38q+4/UJEhx21Pd7ycW8BUr0rJNAyXWrzPJ/S0NNDTXyc3poUIcrnE7a6vYNIexEGbldGazn3+fDMXJjAMMfkVkQE8Zs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783405184042953.2565806809254; Mon, 6 Jul 2026 23:19:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wgz9H-0003hg-R1; Tue, 07 Jul 2026 02:19:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz9B-0003eq-IF for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:11 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wgz99-0001HA-Op for qemu-devel@nongnu.org; Tue, 07 Jul 2026 02:19:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D2307240101 for ; Tue, 7 Jul 2026 08:19:04 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4gvWJm320vz9rxG; Tue, 7 Jul 2026 08:19:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.eu; s=1984.8680eb; t=1783405144; bh=sqJjUQr1d6MtGh6P89u1z/j9xMEOCvznwFnXrNcsL+k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=UuUOO7HCe2otFHPKhEJ402fznlqGU5K0jGlSfztuwkviruaKp0BdP3yvXAsvVycce EeKcla5DBgmnMFZ5+Y8c97kzaCvrd8PUK5Mipr6q+nVQJqhHjTbaDDdeBNWe5/weeK nnooqiV4KfIBldASTwEiFDYSZACXGjQD5hcPsBhX+4N3ffDED8spAyJRIZjzsEhz2S hHHbO7+iSFyuq3GJltYrkNI5sABNpRaPENhBY5GRdD4zMLzuNR1hYD2+SWacK2Xx5J 3BY2X9a9NYOqs3spucI1GzOeDBV0uoqde+B5YfI+NZ1vi1JDnNa6yMPqF4LOoMmumU 75mwivrl7Xyxw== From: Thomas Huth To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Subject: [PULL 3/3] tests/functional: use QMP to query available machines Date: Tue, 07 Jul 2026 06:19:04 +0000 Message-ID: <20260707061851.8298-4-th.huth@posteo.eu> In-Reply-To: <20260707061851.8298-1-th.huth@posteo.eu> References: <20260707061851.8298-1-th.huth@posteo.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists1p.gnu.org; Received-SPF: pass client-ip=185.67.36.66; envelope-from=th.huth@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development 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 @posteo.eu) X-ZM-MESSAGEID: 1783405186618158500 From: Ganesh Harshan Replace parsing of "qemu -M help" in set_machine() with QMP "query-machines". The previous approach relied on parsing human-readable CLI output and substring matching, which is fragile and prone to incorrect matches. It is also sensitive to output format changes. Use QMP instead to retrieve structured machine information, ensuring accurate matching and better maintainability. Cache the result at the class level to avoid repeated QEMU startup overhead. Signed-off-by: Ganesh Harshan Reviewed-by: Daniel P. Berrang=C3=A9 Message-ID: <20260625165310.54113-1-ganeshredcobra@gmail.com> [thuth: Drop problematic self.vm.set_machine() statement] Signed-off-by: Thomas Huth --- tests/functional/qemu_test/testcase.py | 31 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index eaec1bea13..4912a47a46 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -314,13 +314,32 @@ def setUp(self): console_log.addHandler(self._console_log_fh) =20 def set_machine(self, machinename): - # TODO: We should use QMP to get the list of available machines - if not self._machinehelp: - self._machinehelp =3D run( - [self.qemu_bin, '-M', 'help'], - capture_output=3DTrue, check=3DTrue, encoding=3D'utf8').st= dout - if self._machinehelp.find(machinename) < 0: + cls =3D type(self) + + if not hasattr(cls, "_machines"): + tmp_vm =3D QEMUMachine(self.qemu_bin) + tmp_vm.set_machine('none') + + try: + tmp_vm.launch() + resp =3D tmp_vm.qmp('query-machines') + + machines =3D resp.get('return', []) + cls._machines =3D [ + m.get('name') for m in machines if 'name' in m + ] + + finally: + try: + tmp_vm.shutdown() + except Exception: + pass + + self._machines =3D cls._machines + + if machinename not in self._machines: self.skipTest('no support for machine ' + machinename) + self.machine =3D machinename =20 def require_accelerator(self, accelerator): --=20 2.54.0