Skip to content

Fix shellcheck warnings and errors #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Runner/init_env
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

# Source this file to setup the test suite environment
export BASEDIR=$(pwd)
export TOOLS=$(pwd)/utils
export SUITES=$(pwd)/suites
BASEDIR=$(pwd)
export BASEDIR
TOOLS=$(pwd)/utils
export TOOLS
SUITES=$(pwd)/suites
export SUITES
12 changes: 6 additions & 6 deletions Runner/run-test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh


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

# Check if the directory name matches the user input (ignoring case)
if [ "${dir_name_in_dir,,}" = "$test_name" ]; then
# Check if the directory name matches the user input
if [ "${dir_name_in_dir}" = "$test_name" ]; then
# Get the absolute path of the directory
abs_path=$(readlink -f "$1")
echo "$abs_path"
Expand Down Expand Up @@ -53,7 +54,6 @@ execute_test_case() {
# Function to run a specific test case by name
run_specific_test_by_name() {
test_name="$1"
test_name=${test_name,,}
test_path=$(find_test_case_by_name ".")
if [ -z "$test_path" ]; then
log "Test case with name $test_name not found."
Expand Down
8 changes: 5 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/BWMON/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="BWMON"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "--------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down Expand Up @@ -41,6 +42,7 @@ log_info "Comparing votes"


incremented=true
# shellcheck disable=SC2046
for i in $(seq 2 $(echo "$initial_votes" | wc -l)); do
initial_vote=$(echo "$initial_votes" | sed -n "${i}p")
final_vote=$(echo "$final_votes" | sed -n "${i}p")
Expand Down
9 changes: 5 additions & 4 deletions Runner/suites/Kernel/FunctionalArea/baseport/Buses/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="Buses"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand All @@ -26,4 +27,4 @@ else
log_fail "$TESTNAME : Test Failed"
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
fi
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
log_info "-------------------Completed $TESTNAME Testcase----------------------------"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh

. "$(pwd)/init_env"
. "${PWD}/init_env"
TESTNAME="CPUFreq_Validation"
. "$TOOLS/functestlib.sh"

Expand Down
7 changes: 4 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/GIC/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="GIC"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
5 changes: 3 additions & 2 deletions Runner/suites/Kernel/FunctionalArea/baseport/IPA/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="IPA"
. "$TOOLS/functestlib.sh"
test_path=$(find_test_case_by_name "$TESTNAME")
Expand Down
7 changes: 4 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/IPCC/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="IPCC"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "--------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="Interrupts"

#import test functions library
. $TOOLS/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
. "${TOOLS}"/functestlib.sh
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"

Expand Down
8 changes: 5 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/MEMLAT/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="MEMLAT"
#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
test_bin_path=$(find_test_case_bin_by_name "lat_mem_rd")
log_info "-----------------------------------------------------------------------------------------"
Expand Down Expand Up @@ -37,6 +38,7 @@ wait
log_info "Comparing votes..."

incremented=true
# shellcheck disable=SC2046
for i in $(seq 1 $(echo "$initial_votes" | wc -l)); do
initial_vote=$(echo "$initial_votes" | sed -n "${i}p")
final_vote=$(echo "$final_votes" | sed -n "${i}p")
Expand Down
5 changes: 3 additions & 2 deletions Runner/suites/Kernel/FunctionalArea/baseport/RMNET/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="RMNET"
. "$TOOLS/functestlib.sh"
test_path=$(find_test_case_by_name "$TESTNAME")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
TESTNAME="Reboot_health_check"
. "{PWD}"/init_env
#import test functions library
. $TOOLS/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
. "${TOOLS}"/functestlib.sh

# Directory for health check files
HEALTH_DIR="/var/reboot_health"
LOG_FILE="$HEALTH_DIR/reboot_test.log"
RETRY_FILE="$HEALTH_DIR/reboot_retry_count"
MAX_RETRIES=3

Expand Down
9 changes: 5 additions & 4 deletions Runner/suites/Kernel/FunctionalArea/baseport/Timer/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="Timer"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand All @@ -21,7 +22,7 @@ BINARY_PATH="/var/common/bins/timers/posix_timers"
OUTPUT=$($BINARY_PATH)

# Check if "pass:7" is in the output
if [[ $OUTPUT == *"pass:7"* ]]; then
if echo "${OUTPUT}" | grep "pass:7"; then
log_pass "$TESTNAME : Test Passed"
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="adsp_remoteproc"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "--------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="cdsp_remoteproc"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
7 changes: 4 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/hotplug/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="hotplug"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "--------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
7 changes: 4 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/iommu/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="iommu"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "--------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
7 changes: 4 additions & 3 deletions Runner/suites/Kernel/FunctionalArea/baseport/irq/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="irq"

#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")
log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
Expand Down
9 changes: 5 additions & 4 deletions Runner/suites/Kernel/FunctionalArea/baseport/kaslr/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

#!/bin/sh
# Import test suite definitions
. $(pwd)/init_env
. "${PWD}"/init_env
TESTNAME="kaslr"
#import test functions library
. $TOOLS/functestlib.sh
. "${TOOLS}"/functestlib.sh
test_path=$(find_test_case_by_name "$TESTNAME")

log_info "--------------------------------------------------------------------------"
Expand All @@ -19,7 +20,7 @@ value=$(echo $output | awk '{print $1}')



if [ $value == "0000000000000000" ]; then
if [ $value = "0000000000000000" ]; then
log_pass "$TESTNAME : Test Passed"
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
else
Expand Down
Loading
Loading