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.
This commit is contained in:
2026-07-19 09:46:11 +09:00
parent 36f1cd6193
commit f87481ca6d
+6 -10
View File
@@ -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