Commit 119e911a authored by Pawel Kaminski's avatar Pawel Kaminski Committed by Tomasz Zawadzki
Browse files

test: Shellcheck - apply rule SC2178



Variable was used as an array but is now assigned a string.

Change-Id: I79e59d80be96657a9c2fc66f9d205458f9db67b2
Signed-off-by: default avatarPawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468366


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
parent 7f0efebd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ SC2027,SC2030,SC2031,SC2034,SC2035,SC2039,SC2043,SC2044,SC2045,SC2046,\
SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2103,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2145,SC2146,SC2148,SC2152,SC2153,SC2154,SC2155,\
SC2162,SC2164,SC2165,SC2166,SC2167,SC2174,SC2178,\
SC2162,SC2164,SC2165,SC2166,SC2167,SC2174,\
SC2206,SC2207,SC2214,SC2223,SC2230,SC2231"
	# SPDK fails some error checks which have been deprecated in later versions of shellcheck.
	# We will not try to fix these error checks, but instead just leave the error types here
+2 −2
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ function configure_linux_pci {
				pci_dev_echo "$bdf" "Skipping un-whitelisted Virtio device at $bdf"
				continue
			fi
			blknames=''
			blknames=()
			get_virtio_names_from_bdf "$bdf" blknames
			for blkname in $blknames; do
				if [ "$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)" != "0" ]; then
@@ -601,7 +601,7 @@ function status_linux {
			fi
			device=$(cat /sys/bus/pci/devices/$bdf/device)
			vendor=$(cat /sys/bus/pci/devices/$bdf/vendor)
			blknames=''
			blknames=()
			get_virtio_names_from_bdf "$bdf" blknames
			echo -e "$bdf\t${vendor#0x}\t${device#0x}\t$node\t\t${driver:--}\t\t$blknames"
		done
+2 −2
Original line number Diff line number Diff line
@@ -37,8 +37,8 @@ BASE_DIR=$(readlink -f $(dirname $0))
disk_names=$(get_disks $PLUGIN)
disks_numa=$(get_numa_node $PLUGIN "$disk_names")
cores=$(get_cores "$CPUS_ALLOWED")
no_cores=($cores)
no_cores=${#no_cores[@]}
no_cores_array=($cores)
no_cores=${#no_cores_array[@]}

if $PRECONDITIONING; then
	HUGEMEM=8192 $ROOT_DIR/scripts/setup.sh
+1 −2
Original line number Diff line number Diff line
@@ -190,8 +190,7 @@ if [[ $run_precondition == true ]]; then
	# Using the same precondition routine possible for lvols thanks
	# to --clear-method option. Lvols should not UNMAP on creation.
    $rootdir/scripts/gen_nvme.sh > $rootdir/nvme.cfg
    nvmes=$(cat $rootdir/nvme.cfg | grep -oP "Nvme\d+")
    nvmes=($nvmes)
    mapfile -t nvmes < <(cat $rootdir/nvme.cfg | grep -oP "Nvme\d+")
    fio_filename=$(printf ":%sn1" "${nvmes[@]}")
    fio_filename=${fio_filename:1}
    $precond_fio_bin --name="precondition" \