Skip to content

Commit 45f6cef

Browse files
committed
Fix: USBHost test results inconsistent
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. Signed-off-by: “Aanchal <achauras@qti.qualcomm.com>
1 parent 8f592b1 commit 45f6cef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • Runner/suites/Kernel/Baseport/USBHost

Runner/suites/Kernel/Baseport/USBHost/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ echo "Enumerated USB devices..."
5555
echo "$usb_output"
5656

5757
# Check if any USB devices were found
58-
if [ "$device_count" -eq 0 ]; then
58+
if [ -z "$usb_output" ] || [ "$device_count" -eq 0 ]; then
5959
log_fail "$TESTNAME : Test Failed - No USB devices found."
6060
echo "$TESTNAME FAIL" > "$res_file"
61+
exit 1
6162

6263
elif [ "$non_hub_count" -eq 0 ]; then
6364
log_fail "$TESTNAME : Test Failed - Only USB hubs detected, no functional USB devices."

0 commit comments

Comments
 (0)