File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Runner/suites/Kernel/FunctionalArea/baseport/USBHost Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Import test suite definitions
3+ $( pwd) /init_env
4+ TESTNAME=" USBHost"
5+
6+ # import test functions library
7+ . " $( dirname " $0 " ) /../../utils/functestlib.sh"
8+ test_path=$( find_test_case_by_name " $TESTNAME " )
9+ log_info " -----------------------------------------------------------------------------------------"
10+ log_info " -------------------Starting $TESTNAME Testcase----------------------------"
11+
12+ log_info " Running USB Host enumeration test"
13+
14+ # Check if lsusb is installed
15+ check_dependencies lsusb
16+
17+ # Run lsusb and capture output
18+ usb_output=$( lsusb)
19+ device_count=$( echo " $usb_output " | wc -l)
20+
21+ # Filter out USB hubs
22+ non_hub_count=$( echo " $usb_output " | grep -vi " hub" | wc -l)
23+
24+ echo " Enumerated USB devices..."
25+ echo " $usb_output "
26+
27+ # Check if any USB devices were found
28+ if [ " $device_count " -eq 0 ]; then
29+ log_fail " $TESTNAME : Test Failed - No USB devices found."
30+ echo " $TESTNAME FAIL" > $test_path /$TESTNAME .res
31+ elif [ " $non_hub_count " -eq 0 ]; then
32+ log_fail " $TESTNAME : Test Failed - Only USB hubs detected, no functional USB devices."
33+ echo " $TESTNAME FAIL" > $test_path /$TESTNAME .res
34+ else
35+ log_pass " $TESTNAME : Test Passed - $non_hub_count non-hub USB device(s) found."
36+ echo " $TESTNAME PASS" > $test_path /$TESTNAME .res
37+ fi
38+
39+ log_info " -------------------Completed $TESTNAME Testcase----------------------------"
You can’t perform that action at this time.
0 commit comments