Skip to content

Add scripts to test USB Device enumeration on Host PCs #45

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

Closed

Conversation

achauras-qcom
Copy link
Contributor

Added test scripts to verify successful USB enumeration with user-input PID when DUT is connected to Host PC.

The script verifies successful USB enumeration on Host PC for given PID
when DUT is connected via USB.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
The script verifies successful enumeration on Ubuntu/Mac PCs with given
PID when DUT is connected via USB.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
The documentation includes setup details, usage and examples for running
USB Device mode test scripts.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
@achauras-qcom
Copy link
Contributor Author

@smuppand @mwasilew Please help review this PR.

@smuppand
Copy link
Contributor

@achauras-qcom As far as I know, this host-based test isn't applicable for Lava. It might become relevant once we migrate to Axiom. Would you prefer to wait until the migration is complete? @mwasilew could you please confirm whether this test works on Lava?

@mwasilew
Copy link
Contributor

It might work in LAVA with container, but I don't know how useful this is. It tests the host rather than the device. In addition, there is no test script here, just a script that should be called with specific parameter. I'll try do demo this in LAVA if I have some time later today

@mwasilew
Copy link
Contributor

https://lava.infra.foundries.io/scheduler/job/75731#L1974

My changes are here: mwasilew@9847816

I only did minimal changes to show the concept.

This test can be written without python (at least for linux). If you write the test in python, please use pyusb library and don't use os.system. This way you will have one script to cover all operating systems.

@achauras-qcom
Copy link
Contributor Author

Thanks @mwasilew for the example. I'll try incorporating it.
I can keep shell script for linux if it's preferrable. I had tried out pyusb but was facing an issue with Windows. Once it's resolved, I will update the pyusb implementation so we have only 1 script.

@achauras-qcom
Copy link
Contributor Author

Regarding the use of the script for Host PC: Since USB is a master-slave protocol where master drives all communication, we need to test successful enumeration from master/host perspective only, which is the PC in this case. Our Axiom test scripts do the same.

@mwasilew
Copy link
Contributor

As far as I understand pyusb works on Linux, Windows and Mac. Do you have any logs/traces of the issue you're facing?

The builds we currently use don't include any gadged/adb drivers, so this test isn't very useful. It may change later though.

@achauras-qcom
Copy link
Contributor Author

In Windows, usb.core.find(find_all=True) is returning an empty list, probably due to missing libusb drivers.

If current builds don't include usb gadget drivers, then sure we can park this change for later. I will meanwhile work on resolving issues with my current script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants