@samitouri / QOSamiQemu / commits / a4daae55b8

tests/functional/arm/test_aspeed_ast2600_sdk: Add USB EHCI test for AST2600 SDK

Add a functional test to verify USB EHCI support on the AST2600 SDK machine by attaching a USB keyboard device and checking its enumeration via lsusb. This introduces a helper routine that runs lsusb in the guest and validates that the emulated "QEMU USB Keyboard" is detected. Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/qemu-devel/20260504025342.1452605-2-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jamin Lin committed May 4, 2026 at 02:53 UTC a4daae55b8c4518b18b66f85d7290b67672dc695
1 file changed +7
tests/functional/arm/test_aspeed_ast2600_sdk.py
+7
@@ -40,6 +40,11 @@ class AST2600Machine(AspeedTest):
40 'i3ctransfer -d /dev/bus/i3c/5-1234567890ab -r 8 | grep 0x | xargs',
41 '0x12 0x34 0x56 0x78 0x90 0xab 0xcd 0xef')
42
43 + def do_ast2600_usb_ehci_test(self):
44 + exec_command_and_wait_for_pattern(self,
45 + 'lsusb',
46 + 'QEMU QEMU USB Keyboard')
47 +
48 def test_arm_ast2600_evb_sdk(self):
49 self.set_machine('ast2600-evb')
50 self.require_netdev('user')
@@ -54,6 +59,7 @@ class AST2600Machine(AspeedTest):
59 self.vm.add_args('-netdev', 'user,id=net1')
60 self.vm.add_args('-device',
61 'mock-i3c-target,bus=dw.i3c.5,pid=0xab9078563412')
62 + self.vm.add_args('-device', 'usb-kbd,bus=usb-bus.1')
63 self.do_test_arm_aspeed_sdk_start(
64 self.scratch_file("ast2600-default-image", "image-bmc"))
65
@@ -81,6 +87,7 @@ class AST2600Machine(AspeedTest):
87 '/sbin/hwclock -f /dev/rtc1', year)
88 self.do_ast2600_pcie_test()
89 self.do_ast2600_i3c_test()
90 + self.do_ast2600_usb_ehci_test()
91
92
93 if __name__ == '__main__':