From e764b4ca5dc6132e16cb6e8c3eaf3a1a89c7ba5f Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Tue, 5 Nov 2019 13:06:34 +0100 Subject: [PATCH] test: Shellcheck - correct rule: Assigning an array to a string Correct shellcheck rule SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. Signed-off-by: Maciej Wawryk Change-Id: Id74c55b7e1c41b6469e84ac388cf8a5bd8e562a6 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473276 Community-CI: Broadcom SPDK FC-NVMe CI Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- scripts/check_format.sh | 2 +- scripts/vagrant/create_vbox.sh | 2 +- scripts/vagrant/create_vhost_vm.sh | 2 +- test/nvmf/nvmf.sh | 2 +- test/vhost/common.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 237171922..4e6470360 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -242,7 +242,7 @@ if hash shellcheck 2>/dev/null; then # This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors. SHCK_EXCLUDE="SC1083,SC2002,\ SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\ -SC2097,SC2098,SC2119,SC2120,SC2124,SC2126,SC2128,\ +SC2097,SC2098,SC2119,SC2120,SC2126,SC2128,\ SC2129,SC2140,SC2142,SC2143,SC2154,SC2155,\ SC2162" # SPDK fails some error checks which have been deprecated in later versions of shellcheck. diff --git a/scripts/vagrant/create_vbox.sh b/scripts/vagrant/create_vbox.sh index 02e42e1c2..0cb9c131d 100755 --- a/scripts/vagrant/create_vbox.sh +++ b/scripts/vagrant/create_vbox.sh @@ -113,7 +113,7 @@ done shift "$((OPTIND-1))" # Discard the options and sentinel -- -SPDK_VAGRANT_DISTRO="$@" +SPDK_VAGRANT_DISTRO=( "$@" ) case "$SPDK_VAGRANT_DISTRO" in centos7) diff --git a/scripts/vagrant/create_vhost_vm.sh b/scripts/vagrant/create_vhost_vm.sh index a64b3d420..696ce5102 100755 --- a/scripts/vagrant/create_vhost_vm.sh +++ b/scripts/vagrant/create_vhost_vm.sh @@ -70,7 +70,7 @@ export INSTALL_DEPS shift "$((OPTIND-1))" # Discard the options and sentinel -- -SPDK_VAGRANT_DISTRO="$@" +SPDK_VAGRANT_DISTRO=( "$@" ) case "$SPDK_VAGRANT_DISTRO" in ubuntu16) diff --git a/test/nvmf/nvmf.sh b/test/nvmf/nvmf.sh index 16012626f..e98c2779b 100755 --- a/test/nvmf/nvmf.sh +++ b/test/nvmf/nvmf.sh @@ -13,7 +13,7 @@ timing_enter nvmf_tgt trap "exit 1" SIGINT SIGTERM EXIT -TEST_ARGS=$@ +TEST_ARGS=( "$@" ) run_test suite test/nvmf/target/filesystem.sh $TEST_ARGS run_test suite test/nvmf/target/discovery.sh $TEST_ARGS diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 2ba1c1890..2948cd756 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -139,7 +139,7 @@ function vhost_run() return 1 fi - local cmd="$vhost_app -r $vhost_dir/rpc.sock $@" + local cmd="$vhost_app -r $vhost_dir/rpc.sock $*" notice "Loging to: $vhost_log_file" notice "Socket: $vhost_socket"