Commit 32ddd082 authored by Veronika Molnarova's avatar Veronika Molnarova Committed by Arnaldo Carvalho de Melo

perf testsuite: Fix shellcheck warnings

Shellcheck is becoming a standard when building perf to prevent
any unnecessary mistakes. Fix shellcheck warnings in perf testsuite.
Signed-off-by: default avatarVeronika Molnarova <vmolnaro@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240702110849.31904-5-vmolnaro@redhat.comSigned-off-by: default avatarMichael Petlan <mpetlan@redhat.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a3a02a52
...@@ -26,8 +26,8 @@ print_results() ...@@ -26,8 +26,8 @@ print_results()
PERF_RETVAL="$1"; shift PERF_RETVAL="$1"; shift
CHECK_RETVAL="$1"; shift CHECK_RETVAL="$1"; shift
FAILURE_REASON="" FAILURE_REASON=""
TASK_COMMENT="$@" TASK_COMMENT="$*"
if [ $PERF_RETVAL -eq 0 -a $CHECK_RETVAL -eq 0 ]; then if [ $PERF_RETVAL -eq 0 ] && [ $CHECK_RETVAL -eq 0 ]; then
_echo "$MPASS-- [ PASS ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT" _echo "$MPASS-- [ PASS ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT"
return 0 return 0
else else
...@@ -56,7 +56,7 @@ print_overall_results() ...@@ -56,7 +56,7 @@ print_overall_results()
print_testcase_skipped() print_testcase_skipped()
{ {
TASK_COMMENT="$@" TASK_COMMENT="$*"
_echo "$MSKIP-- [ SKIP ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT :: testcase skipped" _echo "$MSKIP-- [ SKIP ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT :: testcase skipped"
return 0 return 0
} }
...@@ -69,7 +69,7 @@ print_overall_skipped() ...@@ -69,7 +69,7 @@ print_overall_skipped()
print_warning() print_warning()
{ {
WARN_COMMENT="$@" WARN_COMMENT="$*"
_echo "$MWARN-- [ WARN ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $WARN_COMMENT" _echo "$MWARN-- [ WARN ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $WARN_COMMENT"
return 0 return 0
} }
......
...@@ -45,7 +45,7 @@ export TEST_IGNORE_MISSING_PMU=${TEST_IGNORE_MISSING_PMU:-n} ...@@ -45,7 +45,7 @@ export TEST_IGNORE_MISSING_PMU=${TEST_IGNORE_MISSING_PMU:-n}
export LC_ALL=C export LC_ALL=C
#### colors #### colors
if [ -t 1 -o "$TESTLOG_FORCE_COLOR" = "yes" ]; then if [ -t 1 ] || [ "$TESTLOG_FORCE_COLOR" = "yes" ]; then
export MPASS="\e[32m" export MPASS="\e[32m"
export MALLPASS="\e[1;32m" export MALLPASS="\e[1;32m"
export MFAIL="\e[31m" export MFAIL="\e[31m"
...@@ -68,15 +68,15 @@ fi ...@@ -68,15 +68,15 @@ fi
### general info ### general info
DIR_PATH=`dirname "$(readlink -e "$0")"` DIR_PATH=`dirname "$(readlink -e "$0")"`
export TEST_NAME=`basename $DIR_PATH | sed 's/base/perf/'` TEST_NAME=`basename $DIR_PATH | sed 's/base/perf/'`; export TEST_NAME
export MY_ARCH=`arch` MY_ARCH=`arch`; export MY_ARCH
# storing logs and temporary files variables # storing logs and temporary files variables
if [ -n "$PERFSUITE_RUN_DIR" ]; then if [ -n "$PERFSUITE_RUN_DIR" ]; then
# when $PERFSUITE_RUN_DIR is set to something, all the logs and temp files will be placed there # when $PERFSUITE_RUN_DIR is set to something, all the logs and temp files will be placed there
# --> the $PERFSUITE_RUN_DIR/perf_something/examples and $PERFSUITE_RUN_DIR/perf_something/logs # --> the $PERFSUITE_RUN_DIR/perf_something/examples and $PERFSUITE_RUN_DIR/perf_something/logs
# dirs will be used for that # dirs will be used for that
export PERFSUITE_RUN_DIR=`readlink -f $PERFSUITE_RUN_DIR` PERFSUITE_RUN_DIR=`readlink -f $PERFSUITE_RUN_DIR`; export PERFSUITE_RUN_DIR
export CURRENT_TEST_DIR="$PERFSUITE_RUN_DIR/$TEST_NAME" export CURRENT_TEST_DIR="$PERFSUITE_RUN_DIR/$TEST_NAME"
export MAKE_TARGET_DIR="$CURRENT_TEST_DIR/examples" export MAKE_TARGET_DIR="$CURRENT_TEST_DIR/examples"
export LOGS_DIR="$CURRENT_TEST_DIR/logs" export LOGS_DIR="$CURRENT_TEST_DIR/logs"
...@@ -93,6 +93,7 @@ fi ...@@ -93,6 +93,7 @@ fi
if [ ! -d ./common ]; then if [ ! -d ./common ]; then
# set parameters based on runmode # set parameters based on runmode
if [ -f ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh ]; then if [ -f ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh ]; then
# shellcheck source=/dev/null
. ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh . ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh
fi fi
# if some parameters haven't been set until now, set them to default # if some parameters haven't been set until now, set them to default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment