Skip to content

Commit 0c10fe6

Browse files
committed
Fix shellcheck warnings and errors
This patch fixes all shellcheck warnings and errors in existing shell scripts. Shellcheck should not display any issues when run with the following parameters shellcheck -S warning -e SC1091 SC2230 SC3043 Shellcheck version 0.9.0 was used for this patch. Signed-off-by: Milosz Wasilewski <[email protected]>
1 parent 73a2a03 commit 0c10fe6

File tree

31 files changed

+184
-141
lines changed

31 files changed

+184
-141
lines changed

Runner/init_env

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
#!/bin/sh
12
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
23
# SPDX-License-Identifier: BSD-3-Clause-Clear
34

45
# Source this file to setup the test suite environment
5-
export BASEDIR=$(pwd)
6-
export TOOLS=$(pwd)/utils
7-
export SUITES=$(pwd)/suites
6+
BASEDIR=$(pwd)
7+
export BASEDIR
8+
TOOLS=$(pwd)/utils
9+
export TOOLS
10+
SUITES=$(pwd)/suites
11+
export SUITES

Runner/run-test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78

89
#import test functions library
9-
. $TOOLS/functestlib.sh
10+
. "${TOOLS}"/functestlib.sh
1011

1112

1213
# Find test case path by name
@@ -16,8 +17,8 @@ find_test_case_by_name() {
1617
# Get the directory name
1718
dir_name_in_dir=${1##*/}
1819

19-
# Check if the directory name matches the user input (ignoring case)
20-
if [ "${dir_name_in_dir,,}" = "$test_name" ]; then
20+
# Check if the directory name matches the user input
21+
if [ "${dir_name_in_dir}" = "$test_name" ]; then
2122
# Get the absolute path of the directory
2223
abs_path=$(readlink -f "$1")
2324
echo "$abs_path"
@@ -53,7 +54,6 @@ execute_test_case() {
5354
# Function to run a specific test case by name
5455
run_specific_test_by_name() {
5556
test_name="$1"
56-
test_name=${test_name,,}
5757
test_path=$(find_test_case_by_name ".")
5858
if [ -z "$test_path" ]; then
5959
log "Test case with name $test_name not found."

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="BWMON"
89

910
#import test functions library
10-
. $TOOLS/functestlib.sh
11+
. "${TOOLS}"/functestlib.sh
1112
test_path=$(find_test_case_by_name "$TESTNAME")
1213
log_info "--------------------------------------------------------------------------"
1314
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
@@ -41,6 +42,7 @@ log_info "Comparing votes"
4142

4243

4344
incremented=true
45+
# shellcheck disable=SC2046
4446
for i in $(seq 2 $(echo "$initial_votes" | wc -l)); do
4547
initial_vote=$(echo "$initial_votes" | sed -n "${i}p")
4648
final_vote=$(echo "$final_votes" | sed -n "${i}p")

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="Buses"
89

910
#import test functions library
10-
. $TOOLS/functestlib.sh
11+
. "${TOOLS}"/functestlib.sh
1112
test_path=$(find_test_case_by_name "$TESTNAME")
1213
log_info "-----------------------------------------------------------------------------------------"
1314
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
@@ -26,4 +27,4 @@ else
2627
log_fail "$TESTNAME : Test Failed"
2728
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
2829
fi
29-
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
30+
log_info "-------------------Completed $TESTNAME Testcase----------------------------"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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
5-
6-
. "$(pwd)/init_env"
6+
. "${PWD}/init_env"
77
TESTNAME="CPUFreq_Validation"
88
. "$TOOLS/functestlib.sh"
99

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="GIC"
89

910
#import test functions library
10-
. $TOOLS/functestlib.sh
11+
. "${TOOLS}"/functestlib.sh
1112
test_path=$(find_test_case_by_name "$TESTNAME")
1213
log_info "-----------------------------------------------------------------------------------------"
1314
log_info "-------------------Starting $TESTNAME Testcase----------------------------"

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="IPA"
89
. "$TOOLS/functestlib.sh"
910
test_path=$(find_test_case_by_name "$TESTNAME")

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="IPCC"
89

910
#import test functions library
10-
. $TOOLS/functestlib.sh
11+
. "${TOOLS}"/functestlib.sh
1112
test_path=$(find_test_case_by_name "$TESTNAME")
1213
log_info "--------------------------------------------------------------------------"
1314
log_info "-------------------Starting $TESTNAME Testcase----------------------------"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="Interrupts"
89

910
#import test functions library
10-
. $TOOLS/functestlib.sh
11-
test_path=$(find_test_case_by_name "$TESTNAME")
11+
. "${TOOLS}"/functestlib.sh
1212
log_info "-----------------------------------------------------------------------------------------"
1313
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
1414

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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
6-
. $(pwd)/init_env
7+
. "${PWD}"/init_env
78
TESTNAME="MEMLAT"
89
#import test functions library
9-
. $TOOLS/functestlib.sh
10+
. "${TOOLS}"/functestlib.sh
1011
test_path=$(find_test_case_by_name "$TESTNAME")
1112
test_bin_path=$(find_test_case_bin_by_name "lat_mem_rd")
1213
log_info "-----------------------------------------------------------------------------------------"
@@ -37,6 +38,7 @@ wait
3738
log_info "Comparing votes..."
3839

3940
incremented=true
41+
# shellcheck disable=SC2046
4042
for i in $(seq 1 $(echo "$initial_votes" | wc -l)); do
4143
initial_vote=$(echo "$initial_votes" | sed -n "${i}p")
4244
final_vote=$(echo "$final_votes" | sed -n "${i}p")

0 commit comments

Comments
 (0)