Skip to content

Commit 4586a4e

Browse files
committed
Fix remaining shellcheck warnings
Fix warnings and errors in remaining files. Where errors are unavoidable add suitable exceptions, like in the platform.sh script. Signed-off-by: Milosz Wasilewski <[email protected]>
1 parent 085bf1d commit 4586a4e

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Runner/suites/Kernel/FunctionalArea/baseport/Reboot_health_check/setup_systemd.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
#!/bin/sh
2+
13
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
24
# SPDX-License-Identifier: BSD-3-Clause-Clear
35

4-
#!/bin/sh
56
# Import test suite definitions
67
set -x
78
chmod 777 -R /var/common/*
@@ -25,15 +26,15 @@ NC="\033[0m" # No Color
2526

2627
# Function to log
2728
log_info() {
28-
echo -e "${YELLOW}[INFO]${NC} $1"
29+
echo "${YELLOW}[INFO]${NC} $1"
2930
}
3031

3132
log_success() {
32-
echo -e "${GREEN}[SUCCESS]${NC} $1"
33+
echo "${GREEN}[SUCCESS]${NC} $1"
3334
}
3435

3536
log_error() {
36-
echo -e "${RED}[ERROR]${NC} $1"
37+
echo "${RED}[ERROR]${NC} $1"
3738
}
3839

3940
# Verify app binary exists

Runner/suites/Kernel/FunctionalArea/baseport/USBHost/run.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ echo "$usb_output"
3232

3333
# Check if any USB devices were found
3434
if [ "$device_count" -eq 0 ]; then
35-
    log_fail "$TESTNAME : Test Failed - No USB devices found."
36-
    echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
35+
log_fail "$TESTNAME : Test Failed - No USB devices found."
36+
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
3737
elif [ "$non_hub_count" -eq 0 ]; then
38-
    log_fail "$TESTNAME : Test Failed - Only USB hubs detected, no functional USB devices."
39-
    echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
38+
log_fail "$TESTNAME : Test Failed - Only USB hubs detected, no functional USB devices."
39+
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
4040
else
41-
    log_pass "$TESTNAME : Test Passed - $non_hub_count non-hub USB device(s) found."
42-
    echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
41+
log_pass "$TESTNAME : Test Passed - $non_hub_count non-hub USB device(s) found."
42+
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
4343
fi
4444

45-
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
45+
log_info "-------------------Completed $TESTNAME Testcase----------------------------"

Runner/utils/platform.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
# shellcheck disable=SC2148
2+
# Intentionally not defining shell.
3+
14
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
25
# SPDX-License-Identifier: BSD-3-Clause-Clear
36

47
# Detect Android userland
58
ANDROID_PATH=/system/build.prop
69
if [ -f $ANDROID_PATH ]; then
710
ANDROID=1
11+
# shellcheck disable=SC2209,SC2034
812
SHELL_CMD=sh
913
else
1014
ANDROID=0
15+
# shellcheck disable=SC2209,SC2034
1116
SHELL_CMD=bash
1217
fi
1318

0 commit comments

Comments
 (0)