Skip to content

Add test script to validate USB Host mode #33

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

Merged
merged 2 commits into from
May 21, 2025

Conversation

achauras-qcom
Copy link
Contributor

The shell script verifies the enumeration of USB devices connected to DUT for testing USB Host mode functionality.

Copy link
Contributor

@mwasilew mwasilew left a comment

Choose a reason for hiding this comment

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

Does this script require any hardware setup? From the script it looks like it. Please add some documentation or at least comment in the header of the script.

@mwasilew
Copy link
Contributor

This change looks good. I think only some docs about the setup are missing.

@achauras-qcom
Copy link
Contributor Author

Added README with documentation for setup

Copy link
Contributor

@mwasilew mwasilew left a comment

Choose a reason for hiding this comment

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

Please cleanup the commit message on the squashed commit. There only needs to be one signed-off-by tag. Also most of the text in the body can be dropped as it doesn't seem applicable

These lines can be dropped:

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>

Add SPDX license headers to USBHost/run.sh

Updates shell script under the USBHost/ directory to include proper SPDX
license identifiers and copyright:

  SPDX-License-Identifier: BSD-3-Clause-Clear

This change supports automation tools like repolinter and align with open
source best practices.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>

Add comments regarding test setup

Include test setup information as comment in the script header. This
informs tester of hardware setup requirement before starting test.


#Setup requires at least one USB peripheral connected to USB port that supports Host mode function

#!/bin/sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move shebang to the first line in the script.


#!/bin/sh
# Import test suite definitions
$(pwd)/init_env
Copy link
Contributor

Choose a reason for hiding this comment

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

should be

. "${PWD}"/init_env

TESTNAME="USBHost"

#import test functions library
. "$(dirname "$0")/../../utils/functestlib.sh"
Copy link
Contributor

Choose a reason for hiding this comment

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

In other scripts this is imported as

. "${TOOLS}"/functestlib.sh

Maybe we should keep the same convention here.

@achauras-qcom
Copy link
Contributor Author

Thanks for the review. Can I make these changes with a single commit message like "Update import suite/function paths" or do you suggest separate commits?

@mwasilew
Copy link
Contributor

@achauras-qcom update the commit "Add test script to validate USB Host mode" and force push to your fork.

#Setup requires at least one USB peripheral connected to USB port that supports Host mode function

# Import test suite definitions
. $(pwd)/init_env
Copy link
Contributor

Choose a reason for hiding this comment

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

please add quotes here to prevent word splitting.

. "${PWD}"/init_env

This is the last bit before merging. The rest looks good!

The shell script verifies the enumeration of USB devices
connected to DUT for testing USB Host mode functionality.

Signed-off-by: Aanchal Chaurasia <achauras@qti.qualcomm.com>
Added setup information and basic requirements.
This informs the tester of the hardware setup requirement before
starting test.

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

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

LGTM

@smuppand smuppand merged commit 5ab7e81 into qualcomm-linux:main May 21, 2025
3 checks passed
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