diff --git a/ci/openshift-ci/cluster/install_kata.sh b/ci/openshift-ci/cluster/install_kata.sh index 1eeab501ab..7279fe8e84 100755 --- a/ci/openshift-ci/cluster/install_kata.sh +++ b/ci/openshift-ci/cluster/install_kata.sh @@ -177,7 +177,7 @@ wait_for_app_pods_message() { pods=($(oc get pods -l app="$app" --no-headers=true $namespace | awk '{print $1}')) [ "${#pods}" -ge "$pod_count" ] && break if [ "$SECONDS" -gt "$timeout" ]; then - echo "Unable to find ${pod_count} pods for '-l app=\"$app\"' in ${SECONDS}s (${pods[@]})" + printf "Unable to find ${pod_count} pods for '-l app=\"$app\"' in ${SECONDS}s (%s)" "${pods[@]}" return -1 fi done @@ -187,7 +187,7 @@ wait_for_app_pods_message() { echo "$log" | grep "$message" -q && echo "Found $(echo "$log" | grep "$message") in $pod's log ($SECONDS)" && break; if [ "$SECONDS" -gt "$timeout" ]; then echo -n "Message '$message' not present in '${pod}' pod of the '-l app=\"$app\"' " - echo "pods after ${SECONDS}s (${pods[@]})" + printf "pods after ${SECONDS}s :(%s)\n" "${pods[@]}" echo "Pod $pod's output so far:" echo "$log" return -1 diff --git a/tests/common.bash b/tests/common.bash index 5f7443dc54..1a7597ea82 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -96,12 +96,12 @@ function kubectl_retry() { local interval=15 local i=0 while true; do - kubectl $@ && return 0 || true + kubectl "$@" && return 0 || true i=$((i + 1)) - [ $i -lt $max_tries ] && echo "'kubectl $@' failed, retrying in $interval seconds" 1>&2 || break + [ $i -lt $max_tries ] && echo "'kubectl $*' failed, retrying in $interval seconds" 1>&2 || break sleep $interval done - echo "'kubectl $@' failed after $max_tries tries" 1>&2 && return 1 + echo "'kubectl $*' failed after $max_tries tries" 1>&2 && return 1 } function waitForProcess() { @@ -601,7 +601,7 @@ function clone_cri_containerd() { # version: the version of the tarball that will be downloaded # tarball-name: the name of the tarball that will be downloaded function download_github_project_tarball() { - project="${1}" + project="${1}" version="${2}" tarball_name="${3}" @@ -731,7 +731,7 @@ OOMScoreAdjust=-999 [Install] WantedBy=multi-user.target EOF - fi + fi } # base_version: The version to be intalled in the ${major}.${minor} format diff --git a/tests/functional/tracing/tracing-test.sh b/tests/functional/tracing/tracing-test.sh index 4952539acb..b0e621ecce 100755 --- a/tests/functional/tracing/tracing-test.sh +++ b/tests/functional/tracing/tracing-test.sh @@ -297,7 +297,7 @@ check_spans() # Check for existence of spans in output so we do not do the more # time consuming test of checking span ordering if it will fail - info "Checking spans: ${span_ordering_data[@]}" + info "Checking spans:" "${span_ordering_data[@]}" local missing_spans=() for span_ordering in "${span_ordering_data[@]}"; do local test_spans=(`echo $span_ordering | tr ':' ' '`) @@ -306,7 +306,7 @@ check_spans() done done if [ "${#missing_spans[@]}" -gt 0 ]; then - die "Fail: Missing spans: ${missing_spans[@]}" + die "Fail: Missing spans:" "${missing_spans[@]}" fi # Check relative ordering of spans. We are not checking full trace, just @@ -360,10 +360,10 @@ check_spans() local last_initial_span_index=${#initial_span_ids[@]}-1 if [ $matches -eq ${#span_ids[@]} ]; then - info "Pass: spans \"${test_spans[@]}\" found in jaeger output" + info "Pass: spans \"" "${test_spans[@]}" "\" found in jaeger output" break elif [ $matches -lt ${#span_ids[@]} ] && [ "$initial" = "${initial_span_ids[$last_initial_span_index]}" ]; then - die "Fail: spans \"${test_spans[@]}\" NOT in jaeger output" + die "Fail: spans \"" "${test_spans[@]}" "\" NOT in jaeger output" fi # else repeat test for next initial span ID done diff --git a/tests/metrics/density/memory_usage.sh b/tests/metrics/density/memory_usage.sh index e42ac7e527..97f39af395 100755 --- a/tests/metrics/density/memory_usage.sh +++ b/tests/metrics/density/memory_usage.sh @@ -377,7 +377,7 @@ function main(){ # Verify enough arguments if [ $# != 2 ] && [ $# != 3 ];then help - die "Not enough arguments [$@]" + die "Not enough arguments [$*]" fi if [ "${CTR_RUNTIME}" != "io.containerd.runc.v2" ] && [ "${CTR_RUNTIME}" != "io.containerd.kata.v2" ]; then diff --git a/tests/metrics/machine_learning/pytorch.sh b/tests/metrics/machine_learning/pytorch.sh index c07cdf3abc..a15bde4498 100755 --- a/tests/metrics/machine_learning/pytorch.sh +++ b/tests/metrics/machine_learning/pytorch.sh @@ -106,7 +106,7 @@ EOF function main() { # Verify enough arguments if [ $# != 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/metrics/machine_learning/tensorflow_mobilenet_v1_bfloat16_fp32.sh b/tests/metrics/machine_learning/tensorflow_mobilenet_v1_bfloat16_fp32.sh index 63a37154f1..6bc9cf9f6c 100755 --- a/tests/metrics/machine_learning/tensorflow_mobilenet_v1_bfloat16_fp32.sh +++ b/tests/metrics/machine_learning/tensorflow_mobilenet_v1_bfloat16_fp32.sh @@ -111,7 +111,7 @@ EOF function main() { # Verify enough arguments if [ $# != 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/metrics/machine_learning/tensorflow_nhwc.sh b/tests/metrics/machine_learning/tensorflow_nhwc.sh index 328c055d47..17122d4916 100755 --- a/tests/metrics/machine_learning/tensorflow_nhwc.sh +++ b/tests/metrics/machine_learning/tensorflow_nhwc.sh @@ -151,7 +151,7 @@ EOF function main() { # Verify enough arguments if [ "$#" -lt 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/metrics/machine_learning/tensorflow_resnet50_fp32.sh b/tests/metrics/machine_learning/tensorflow_resnet50_fp32.sh index e6eafc3920..f42d516829 100755 --- a/tests/metrics/machine_learning/tensorflow_resnet50_fp32.sh +++ b/tests/metrics/machine_learning/tensorflow_resnet50_fp32.sh @@ -111,7 +111,7 @@ EOF function main() { # Verify enough arguments if [ $# != 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/metrics/machine_learning/tensorflow_resnet50_int8.sh b/tests/metrics/machine_learning/tensorflow_resnet50_int8.sh index 2549333930..79e5fce412 100755 --- a/tests/metrics/machine_learning/tensorflow_resnet50_int8.sh +++ b/tests/metrics/machine_learning/tensorflow_resnet50_int8.sh @@ -105,7 +105,7 @@ EOF function main() { # Verify enough arguments if [ $# != 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/metrics/storage/webtooling.sh b/tests/metrics/storage/webtooling.sh index f828496185..b692e78d41 100755 --- a/tests/metrics/storage/webtooling.sh +++ b/tests/metrics/storage/webtooling.sh @@ -140,7 +140,7 @@ EOF function main() { # Verify enough arguments if [ $# != 1 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tests/stability/scability_test.sh b/tests/stability/scability_test.sh index 69408f5347..dee1d1bbf0 100755 --- a/tests/stability/scability_test.sh +++ b/tests/stability/scability_test.sh @@ -30,7 +30,7 @@ EOF function main() { # Verify enough arguments if [ $# != 2 ]; then - echo >&2 "error: Not enough arguments [$@]" + echo >&2 "error: Not enough arguments [$*]" help exit 1 fi diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index 7deca9eda7..02e95f73d4 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -273,8 +273,8 @@ get_test_config() { local config="${script_dir}/${distro}/config.sh" source ${config} - echo -e "INIT_PROCESS:\t\t$INIT_PROCESS" - echo -e "ARCH_EXCLUDE_LIST:\t\t${ARCH_EXCLUDE_LIST[@]}" + printf "INIT_PROCESS:\t\t%s\n" "${INIT_PROCESS:-}" + printf "ARCH_EXCLUDE_LIST:\t\t%s\n" "${ARCH_EXCLUDE_LIST[@]:-}" } check_function_exist()