usb_hid_reconnect.run: use distinct device-ids

Newer Qemu variants quit with an error about already existing devices
if the same device-id is add and removed in a loop fast. To circumvent
this strange behaviour, simply use consecutive device id numbers.

Ref genodelabs/genode#5021
This commit is contained in:
Stefan Kalkowski 2024-02-20 15:03:47 +01:00 committed by Christian Helmuth
parent 32e7ec7b9b
commit 88c347ee00

View File

@ -149,13 +149,13 @@ run_genode_until {(qemu)} 20 $spawn_id
for {set i 0} {$i < 50} {incr i} {
# connect keyboard
send "device_add usb-kbd,id=ukb1\n"
send "device_add usb-kbd,id=ukb$i\n"
# wait for keyboard
run_genode_until {.*USB HID.*Keyboard.*\n} 10 $spawn_id
# disconnect keyboard
send "device_del ukb1\n"
send "device_del ukb$i\n"
# wait for disconnect
run_genode_until {.*USB disconnect.*\n} 10 $spawn_id