support/testing: usbip: wait for the keyboard be detected

Running TestUsbIp may fail when checking if two QEMU USB Keyboards are
reported by lsusb. On fast host, the second QEMU USB keyboard may not
aleady detected when lsusb is executed. So wait a bit, to let the new
keyboard be detected.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Romain Naour
2026-06-21 18:53:36 +02:00
committed by Julien Olivain
parent 67d6e6602f
commit 933a591d8a

View File

@@ -1,4 +1,5 @@
import os
import time
import infra.basetest
@@ -91,6 +92,9 @@ class TestUsbIp(infra.basetest.BRTest):
# keyboard.
self.assertRunOk("usbip attach --remote=127.0.0.1 --busid=1-1")
# Wait a bit, to let the new keyboard be detected.
time.sleep(1)
# We check "lsusb" now sees exactly two QEMU USB Keyboards
# (the original one, and a second one created by usbip).
out, ret = self.emulator.run("lsusb")