@samitouri / QOSamiQemu / commits / b04746bd0d

tests/functional/aspeed: unify boot completion detection on 'login:' prompt

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 <peter.maydell@linaro.org> Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3117 Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260617042718.2883655-1-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Cédric Le Goater committed Jun 17, 2026 at 06:27 UTC b04746bd0d7c116b94fe3cd7e105849d481c21a6
5 files changed +14 -28
tests/functional/arm/test_aspeed_anacapa.py
+3 -3
@@ -5,10 +5,10 @@
5 # SPDX-License-Identifier: GPL-2.0-or-later
6
7 from qemu_test import Asset
8 -from aspeed import FacebookAspeedTest
8 +from aspeed import AspeedTest
9
10
11 -class AnacapaMachine(FacebookAspeedTest):
11 +class AnacapaMachine(AspeedTest):
12
13 ASSET_ANACAPA_FLASH = Asset(
14 'https://github.com/legoater/qemu-aspeed-boot/raw/refs/heads/master/images/anacapa-bmc/openbmc-20260616025349/obmc-phosphor-image-anacapa-20260616025349.static.mtd.xz',
@@ -22,4 +22,4 @@ class AnacapaMachine(FacebookAspeedTest):
22 soc='AST2600 rev A3')
23
24 if __name__ == '__main__':
25 - FacebookAspeedTest.main()
25 + AspeedTest.main()
tests/functional/arm/test_aspeed_bletchley.py
+3 -3
@@ -5,10 +5,10 @@
5 # SPDX-License-Identifier: GPL-2.0-or-later
6
7 from qemu_test import Asset
8 -from aspeed import FacebookAspeedTest
8 +from aspeed import AspeedTest
9
10
11 -class BletchleyMachine(FacebookAspeedTest):
11 +class BletchleyMachine(AspeedTest):
12
13 ASSET_BLETCHLEY_FLASH = Asset(
14 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bletchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-20250128071329.static.mtd.xz',
@@ -22,4 +22,4 @@ class BletchleyMachine(FacebookAspeedTest):
22 soc='AST2600 rev A3')
23
24 if __name__ == '__main__':
25 - FacebookAspeedTest.main()
25 + AspeedTest.main()
tests/functional/arm/test_aspeed_catalina.py
+3 -3
@@ -5,10 +5,10 @@
5 # SPDX-License-Identifier: GPL-2.0-or-later
6
7 from qemu_test import Asset
8 -from aspeed import FacebookAspeedTest
8 +from aspeed import AspeedTest
9
10
11 -class CatalinaMachine(FacebookAspeedTest):
11 +class CatalinaMachine(AspeedTest):
12
13 ASSET_CATALINA_FLASH = Asset(
14 'https://github.com/legoater/qemu-aspeed-boot/raw/a866feb5ef81245b4827a214584bf6bcc72939f6/images/catalina-bmc/obmc-phosphor-image-catalina-20250619123021.static.mtd.xz',
@@ -22,4 +22,4 @@ class CatalinaMachine(FacebookAspeedTest):
22 soc='AST2600 rev A3')
23
24 if __name__ == '__main__':
25 - FacebookAspeedTest.main()
25 + AspeedTest.main()
tests/functional/arm/test_aspeed_gb200nvl_bmc.py
+1 -2
@@ -19,8 +19,7 @@ class GB200Machine(AspeedTest):
19
20 self.do_test_arm_aspeed_openbmc('gb200nvl-bmc', image=image_path,
21 uboot='2019.04', cpu_id='0xf00',
22 - soc='AST2600 rev A3',
23 - image_hostname='gb200nvl-obmc')
22 + soc='AST2600 rev A3')
23
24 if __name__ == '__main__':
25 AspeedTest.main()
tests/functional/aspeed.py
+4 -17
@@ -8,14 +8,7 @@ from qemu_test import LinuxKernelTest
8 class AspeedTest(LinuxKernelTest):
9
10 def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
11 - cpu_id='0x0', soc='AST2500 rev A1',
12 - image_hostname=None):
13 - # Allow for the image hostname to not end in "-bmc"
14 - if image_hostname is not None:
15 - hostname = image_hostname
16 - else:
17 - hostname = machine.removesuffix('-bmc')
18 -
11 + cpu_id='0x0', soc='AST2500 rev A1'):
12 self.set_machine(machine)
13 self.vm.set_console()
14 self.vm.add_args('-drive', f'file={image},if=mtd,format=raw',
@@ -28,10 +21,10 @@ class AspeedTest(LinuxKernelTest):
21 self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}')
22 self.wait_for_console_pattern(f'ASPEED {soc}')
23 self.wait_for_console_pattern('/init as init process')
31 - self.wait_for_boot_complete(hostname)
24 + self.wait_for_boot_complete()
25
33 - def wait_for_boot_complete(self, hostname):
34 - self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
26 + def wait_for_boot_complete(self):
27 + self.wait_for_console_pattern('login:')
28
29 def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
30 self.require_netdev('user')
@@ -71,9 +64,3 @@ class AspeedTest(LinuxKernelTest):
64 with open(path, "wb") as f:
65 f.write(pattern)
66 return path
74 -
75 -
76 -class FacebookAspeedTest(AspeedTest):
77 -
78 - def wait_for_boot_complete(self, hostname):
79 - self.wait_for_console_pattern(f'{hostname} login:')