From 98ab2228f8e9911caa72dc49c4e9b0f64bc154c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 21 Apr 2026 12:32:08 +0200 Subject: [PATCH] tests: Fix shellcheck issues in scability_test.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix shellcheck warnings and notes identified by running shellcheck --severity=style. Signed-off-by: Fabiano FidĂȘncio --- tests/stability/scability_test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/stability/scability_test.sh b/tests/stability/scability_test.sh index 8e4080cc7f..d8bc5792d8 100755 --- a/tests/stability/scability_test.sh +++ b/tests/stability/scability_test.sh @@ -8,9 +8,11 @@ set -o pipefail # General env SCRIPT_PATH=$(dirname "$(readlink -f "$0")") +# shellcheck source=/dev/null source "${SCRIPT_PATH}/common_stability.bash" NUM_CONTAINERS="$1" +# shellcheck disable=SC2034 TIMEOUT_LAUNCH="$2" PAYLOAD_ARGS="${PAYLOAD_ARGS:-tail -f /dev/null}" IMAGE="${IMAGE:-quay.io/prometheus/busybox:latest}" @@ -29,7 +31,7 @@ EOF function main() { # Verify enough arguments - if [ $# != 2 ]; then + if [[ $# != 2 ]]; then echo >&2 "error: Not enough arguments [$*]" help exit 1 @@ -40,15 +42,19 @@ function main() { local not_started_count="${NUM_CONTAINERS}" clean_env_ctr + # shellcheck disable=SC2154 sudo -E "${CTR_EXE}" i pull "${IMAGE}" info "Creating ${NUM_CONTAINERS} containers" for ((i=1; i<= "${NUM_CONTAINERS}"; i++)); do - containers+=($(random_name)) + local name + name=$(random_name) + containers+=("${name}") + # shellcheck disable=SC2154 sudo -E "${CTR_EXE}" run -d --runtime "${CTR_RUNTIME}" "${IMAGE}" "${containers[-1]}" sh -c "${PAYLOAD_ARGS}" ((not_started_count--)) - info "$not_started_count remaining containers" + info "${not_started_count} remaining containers" done # Check that the requested number of containers are running