Commit fdc82d3b authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

test: Shellcheck - correct rule: Double quote array



Correct shellcheck rule SC2068: Double quote array expansions to avoid re-splitting elements.

Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iefc4f0104249f4d437a66c3d9c7a195f4f6f6da3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475690


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 25f601cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ if hash shellcheck 2>/dev/null; then
	# Error descriptions can also be found at: https://github.com/koalaman/shellcheck/wiki
	# 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,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120"
	# 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
+4 −4
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ if [ -n "$1" ]; then
	driver_to_bind=$1
fi

for driver in ${allowed_drivers[@]}; do
for driver in "${allowed_drivers[@]}"; do
	if [ $driver == $driver_to_bind ]; then
		bad_driver=false
	fi
@@ -40,7 +40,7 @@ if service qat_service start; then
fi

# configure virtual functions for the QAT cards.
for qat_bdf in ${qat_pci_bdfs[@]}; do
for qat_bdf in "${qat_pci_bdfs[@]}"; do
	echo "$num_vfs" > /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs
	num_vfs=$(cat /sys/bus/pci/drivers/c6xx/$qat_bdf/sriov_numvfs)
	echo "$qat_bdf set to $num_vfs VFs"
@@ -55,7 +55,7 @@ if (( ${#qat_vf_bdfs[@]} != ${#qat_pci_bdfs[@]}*num_vfs )); then
fi

# Unbind old driver if necessary.
for vf in ${qat_vf_bdfs[@]}; do
for vf in "${qat_vf_bdfs[@]}"; do
	old_driver=$(basename $(readlink -f /sys/bus/pci/devices/${vf}/driver))
	if [ $old_driver != "driver" ]; then
		echo "unbinding driver $old_driver from qat VF at BDF $vf"
@@ -81,7 +81,7 @@ else
fi

echo -n "8086 37c9" > /sys/bus/pci/drivers/$driver_to_bind/new_id
for vf in ${qat_vf_bdfs[@]}; do
for vf in "${qat_vf_bdfs[@]}"; do
	if ! ls -l /sys/bus/pci/devices/$vf/driver | grep -q $driver_to_bind; then
		echo "unable to bind the driver to the device at bdf $vf"
		if [ "$driver_to_bind" == "uio_pci_generic" ]; then
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ function configure_linux_pci {
		if ! $mount; then
			linux_bind_driver "$bdf" "$driver_name"
		else
			for name in ${blknames[@]}; do
			for name in "${blknames[@]}"; do
				pci_dev_echo "$bdf" "Active mountpoints on /dev/$name, so not binding PCI dev"
			done
		fi
+3 −3
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ function nbd_stop_disks() {
	local nbd_list=($2)
	local i

	for i in ${nbd_list[@]}; do
	for i in "${nbd_list[@]}"; do
		$rootdir/scripts/rpc.py -s $rpc_server nbd_stop_disk $i
		waitfornbd_exit $(basename $i)
	done
@@ -69,12 +69,12 @@ function nbd_dd_data_verify() {
	if [ "$operation" = "write" ]; then
		# data write
		dd if=/dev/urandom of=$tmp_file bs=4096 count=256
		for i in ${nbd_list[@]}; do
		for i in "${nbd_list[@]}"; do
			dd if=$tmp_file of=$i bs=4096 count=256 oflag=direct
		done
	elif [ "$operation" = "verify" ]; then
		# data read and verify
		for i in ${nbd_list[@]}; do
		for i in "${nbd_list[@]}"; do
			cmp -b -n 1M $tmp_file $i
		done
		rm $tmp_file
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ else
	$rootdir/scripts/gen_ftl.sh -a $device -n nvme0 -l 0-3 -u $uuid > $FTL_BDEV_CONF
fi

for test in ${tests[@]}; do
for test in "${tests[@]}"; do
	timing_enter $test
	fio_bdev $testdir/config/fio/$test.fio
	timing_exit $test
Loading