Skip to content

Commit 7b0093b

Browse files
author
Benjamin Berg
committed
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).
1 parent 0fd5a61 commit 7b0093b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/create-driver-test.py.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ process.wait()
105105
# Run capture
106106
# https://osqa-ask.wireshark.org/questions/53919/how-can-i-precisely-specify-a-usb-device-to-capture-with-tshark/
107107

108+
print(f'### Reseting USB port (as descriptors could be missing in the dump otherwise)')
109+
usb_device.open()
110+
usb_device.reset()
111+
usb_device.close()
112+
108113
print(f'### Starting USB capture on usbmon{bus_num}')
109114
capture_pid = os.fork()
110115
assert(capture_pid >= 0)

0 commit comments

Comments
 (0)