Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: USB: Use libusb0 backend on Windows #11458

Merged

Conversation

fkjagodzinski
Copy link
Member

Description

libusb0 supports all features used for testing. A newer version (libusb1) does not have a complete implementation for Windows.

Moreover, this will stop our USB device tests from using a libusb-1.0.dll which may have been copied to the Python directory by the user (i.e. following pyOCD installation procedure).

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[x] Test update
[ ] Breaking change

Reviewers

@jeromecoutant, @jamesbeyond

Release Notes

Filip Jagodzinski added 2 commits September 11, 2019 14:00
libusb0 supports all features used for testing. A newer version
(libusb1) does not have a complete implementation for Windows.
libusb0 supports all features used for testing. A newer version
(libusb1) does not have a complete implementation for Windows.
@ciarmcom ciarmcom requested review from jamesbeyond and a team September 11, 2019 13:00
@ciarmcom
Copy link
Member

@fkjagodzinski, thank you for your changes.
@jamesbeyond @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 requested a review from a team September 11, 2019 13:04
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 17, 2019

@jamesbeyond Please review

@jeromecoutant
Copy link
Collaborator

Hi
I am currently trying to debug with the USB serial test...
And maybe current patch is not complete...

I could start pyocd gdbserver,
but test couldn't be run:

[1569231275.73][HTST][ERR] host test not detected: usb_device_serial

@fkjagodzinski
Copy link
Member Author

[1569231275.73][HTST][ERR] host test not detected: usb_device_serial

@jeromecoutant If you use htrun you should add a -e flag to specify host test directory, e.g. mbedhtrun --skip-flashing --skip-reset -p COM31:9600 -e "TESTS\host_tests".

Copy link
Contributor

@maciejbocianski maciejbocianski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jamesbeyond
Copy link
Contributor

hey @fkjagodzinski, what is the impact to the test setup? do we need to update anything the documentation related to the setup?
https://github.com/ARMmbed/mbed-os/blob/master/TESTS/usb_device/README.md

@fkjagodzinski
Copy link
Member Author

@jamesbeyond, no impact on the setup procedure.

This patch explicitly sets the pyusb backend to libusb0 to make sure we always use the driver set by Zadig. If the user has libusb1 present in Win environment, it will be loaded by default by pyusb. This is bad, since this lib version does not provide all features we use in tests.

@adbridge
Copy link
Contributor

@jamesbeyond are you happy with this ?

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy, good to go @adbridge

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 27, 2019

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit a1961de into ARMmbed:master Sep 30, 2019
@fkjagodzinski fkjagodzinski deleted the test_update-usb_device-fix_pyusb_backend branch September 30, 2019 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants