From 45f6cef973f289112ea6118047fecc93492f7f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CAanchal?= Date: Mon, 22 Dec 2025 17:04:46 +0530 Subject: [PATCH] Fix: USBHost test results inconsistent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Runner/suites/Kernel/Baseport/USBHost/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runner/suites/Kernel/Baseport/USBHost/run.sh b/Runner/suites/Kernel/Baseport/USBHost/run.sh index 552ce583..45b037e4 100755 --- a/Runner/suites/Kernel/Baseport/USBHost/run.sh +++ b/Runner/suites/Kernel/Baseport/USBHost/run.sh @@ -55,9 +55,10 @@ echo "Enumerated USB devices..." echo "$usb_output" # Check if any USB devices were found -if [ "$device_count" -eq 0 ]; then +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 elif [ "$non_hub_count" -eq 0 ]; then log_fail "$TESTNAME : Test Failed - Only USB hubs detected, no functional USB devices."