From: Arshad Hussain Date: Tue, 15 Mar 2022 09:07:12 +0000 (+0530) Subject: LU-15626 tests: Fix "error" reported by shellcheck for sanity-lnet X-Git-Tag: 2.15.0-RC3~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5de5c86e36c299298ff2d5134d04f9086ccb4148;p=fs%2Flustre-release.git LU-15626 tests: Fix "error" reported by shellcheck for sanity-lnet This patch fixes "error" issues reported by shellcheck for file lustre/tests/sanity-lnet.sh Test-Parameters: trivial testlist=sanity-lnet Signed-off-by: Arshad Hussain Change-Id: I55777e6b65a40c90225c40c29e16fbeb44c3411b Reviewed-on: https://review.whamcloud.com/46824 Reviewed-by: Aurelien Degremont Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index aa52943..ccea0d3 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -25,7 +25,7 @@ LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} . $LUSTRE/tests/test-framework.sh CLEANUP=${CLEANUP:-:} SETUP=${SETUP:-:} -init_test_env $@ +init_test_env "$@" . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging @@ -92,8 +92,8 @@ load_lnet() { } do_lnetctl() { - $LCTL mark "$LNETCTL $@" - echo "$LNETCTL $@" + $LCTL mark "$LNETCTL $*" + echo "$LNETCTL $*" $LNETCTL "$@" } @@ -101,7 +101,7 @@ TESTNS='test_ns' FAKE_IF="test1pg" FAKE_IP="10.1.2.3" do_ns() { - echo "ip netns exec $TESTNS $@" + echo "ip netns exec $TESTNS $*" ip netns exec $TESTNS "$@" } @@ -1545,8 +1545,8 @@ add_health_test_drop_rules() { local hstatus=$1 local lnid rnid - for lnid in ${LNIDS[@]}; do - for rnid in ${RNIDS[@]}; do + for lnid in "${LNIDS[@]}"; do + for rnid in "${RNIDS[@]}"; do $LCTL net_drop_add -s $lnid -d $rnid -m GET -r 1 -e ${hstatus} done done @@ -1887,7 +1887,7 @@ check_ping_count() { local count local found=false - for count in ${ping_count[@]}; do + for count in "${ping_count[@]}"; do if [[ $count -eq $expect ]]; then if [[ $expect -ne 0 ]] && $found ; then error "Found more than one interface matching \"$expect\" ping count" @@ -2316,8 +2316,8 @@ test_216() { error "Initial ping failed $?" local src dst - for src in ${nids[@]}; do - for dst in ${nids[@]}; do + for src in "${nids[@]}"; do + for dst in "${nids[@]}"; do $LCTL net_drop_add -r 1 -s $src -d $dst -e network_timeout done done