Fix: USBHost test results inconsistent#239
Conversation
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>
| 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 |
There was a problem hiding this comment.
Instead of causing a failure, let's change it to SKIP with exit code 0 if there is no USB devices found
There was a problem hiding this comment.
hmm, isn't the goal of the test to exercise this feature?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.