mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
tests: Reset the USB device before testing
The kernel caches URBs to get descriptor values. Doing a reset before starting the record ensures that we will see any descriptor reads in the usbmon trace and can therefore correctly replay them (possibly not true if they happen multiple times).
This commit is contained in:
@@ -105,6 +105,11 @@ process.wait()
|
||||
# Run capture
|
||||
# https://osqa-ask.wireshark.org/questions/53919/how-can-i-precisely-specify-a-usb-device-to-capture-with-tshark/
|
||||
|
||||
print(f'### Reseting USB port (as descriptors could be missing in the dump otherwise)')
|
||||
usb_device.open()
|
||||
usb_device.reset()
|
||||
usb_device.close()
|
||||
|
||||
print(f'### Starting USB capture on usbmon{bus_num}')
|
||||
capture_pid = os.fork()
|
||||
assert(capture_pid >= 0)
|
||||
|
||||
Reference in New Issue
Block a user