Skip to content

Conversation

@achauras-qcom
Copy link
Contributor

Resolves #228

Problem: In some platforms, during verification of 'lsusb' command, an empty character may cause false positive in the 'if' check and report test pass even though no USB devices are connected.
Solution: Add additional test condition to verify output of 'lsusb' command and avoid false pass when no USB device is connected.

Resolves qualcomm-linux#228

Problem: In some platforms, during verification of 'lsusb' command, an empty character may cause false positive in the 'if' check and report test pass even though no USB devices are connected.
Solution: Add additional test condition to verify output of 'lsusb' command and avoid false pass when no USB device is connected.

Signed-off-by: “Aanchal <achauras@qti.qualcomm.com>
@smuppand smuppand requested a review from mwasilew December 22, 2025 11:48
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.

if [ -z "$usb_output" ] || [ "$device_count" -eq 0 ]; then
log_fail "$TESTNAME : Test Failed - No USB devices found."
echo "$TESTNAME FAIL" > "$res_file"
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of causing a failure, let's change it to SKIP with exit code 0 if there is no USB devices found

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, isn't the goal of the test to exercise this feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On changing the exit result to SKIP, in cases where a physically connected device does not enumerate, same test condition will be hit and it would report 'skip' instead of 'fail'. It is difficult to determine whether physically any USB devices were connected besides user input.
Is there a way we can take input parameter from user based on which we can skip certain tests?
Meanwhile I will also explore if we can determine physical connection without successful enumeration by checking port status, if that works reliably.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO the current version is OK. The test should not be attempted on devices that are not prepared or won't support USB. For example on RB3g2 it won't pass with current meta-qcom build due to missing firmware. I believe this is an issue of test scheduling not the test itself and I vote to keep the version in this PR.

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.

USBHost test results inconsistent

3 participants