From f87481ca6d88539ac27d9db8e59ed093741cdb15 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 19 Jul 2026 09:46:11 +0900 Subject: [PATCH] test-usb-hub-qemu: spawn proof via descriptor-read line The 'USB HUB driver spawned' log line is emitted before setup_logging and never reaches the serial console, so check #2 could never pass. Use the hub-descriptor read line (emitted only after XhciClientHandle open + 8-port descriptor fetch succeed) as the spawn proof, and fold the old duplicate descriptor check into it. --- local/scripts/test-usb-hub-qemu.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/local/scripts/test-usb-hub-qemu.sh b/local/scripts/test-usb-hub-qemu.sh index 25f5df146e..1160a20cb8 100755 --- a/local/scripts/test-usb-hub-qemu.sh +++ b/local/scripts/test-usb-hub-qemu.sh @@ -136,17 +136,13 @@ if [[ "$check_mode" -eq 1 ]]; then exit 1 fi - # 2. usbhubd spawned for the hub device. - if ! grep -q "USB HUB driver spawned" "$log_file"; then - echo "ERROR: usbhubd did not spawn for the QEMU usb-hub" >&2 - echo " Expected: 'USB HUB driver spawned'" >&2 - echo " See $log_file" >&2 - exit 1 - fi - - # 3. Hub descriptor read succeeded (QEMU usb-hub exposes 8 ports). + # 2. usbhubd spawned for the hub device. The "USB HUB driver spawned" + # log line is emitted before setup_logging and never reaches the + # serial console, so the reliable spawn proof is the hub-descriptor + # read line (emitted only after XhciClientHandle open + descriptor + # fetch succeed). if ! grep -q "usbhubd: 8 port(s) detected" "$log_file"; then - echo "ERROR: hub descriptor read failed or wrong port count" >&2 + echo "ERROR: usbhubd did not spawn or hub descriptor read failed" >&2 echo " Expected: 'usbhubd: 8 port(s) detected'" >&2 grep -i "usbhubd" "$log_file" | tail -10 >&2 || true echo " See $log_file" >&2