Commit 4b3a6e87 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

test: Shellcheck - correct rule: Useless echo



Correct shellcheck rule SC2005: Useless echo?
Instead of echo $(cmd), just use cmd

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent f1131f1d
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="SC1001,SC1003,\
SC1083,SC1113,SC2001,SC2002,SC2003,SC2004,SC2005,\
SC1083,SC1113,SC2001,SC2002,SC2003,SC2004,\
SC2010,SC2012,SC2013,SC2016,\
SC2034,SC2045,SC2046,\
SC2068,SC2086,SC2089,SC2090,\
+2 −2
Original line number Diff line number Diff line
# Common utility functions to be sourced by the libftl test scripts

function get_chunk_size() {
	echo $($rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" | \
		grep 'Logical blks per chunk' | sed 's/[^0-9]//g')
	$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" |
		grep 'Logical blks per chunk' | sed 's/[^0-9]//g'
}

function has_separate_md() {
+6 −6
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ function get_cores(){
function get_cores_numa_node(){
	local cores=$1
	for core in $cores; do
		echo $(lscpu -p=cpu,node | grep "^$core\b" | awk -F ',' '{print $2}')
		lscpu -p=cpu,node | grep "^$core\b" | awk -F ',' '{print $2}'
	done
}

@@ -55,20 +55,20 @@ function get_numa_node(){
			local driver=$(grep DRIVER /sys/bus/pci/devices/$bdf/uevent |awk -F"=" '{print $2}')
			# Use this check to ommit blacklisted devices ( not binded to driver with setup.sh script )
			if [ "$driver" = "vfio-pci" ] || [ "$driver" = "uio_pci_generic" ]; then
				echo $(cat /sys/bus/pci/devices/$bdf/numa_node)
				cat /sys/bus/pci/devices/$bdf/numa_node
			fi
		done
	elif [ "$plugin" = "bdev" ] || [ "$plugin" = "bdevperf" ]; then
		local bdevs=$(discover_bdevs $ROOT_DIR $BASE_DIR/bdev.conf)
		for name in $disks; do
			local bdev_bdf=$(jq -r ".[] | select(.name==\"$name\").driver_specific.nvme.pci_address" <<< $bdevs)
			echo $(cat /sys/bus/pci/devices/$bdev_bdf/numa_node)
			cat /sys/bus/pci/devices/$bdev_bdf/numa_node
		done
	else
		# Only target not mounted NVMes
		for bdf in $(iter_pci_class_code 01 08 02); do
			if is_bdf_not_mounted $bdf; then
				echo $(cat /sys/bus/pci/devices/$bdf/numa_node)
				cat /sys/bus/pci/devices/$bdf/numa_node
			fi
		done
	fi
@@ -85,7 +85,7 @@ function get_disks(){
		done
	elif [ "$plugin" = "bdev" ] || [ "$plugin" = "bdevperf" ]; then
		local bdevs=$(discover_bdevs $ROOT_DIR $BASE_DIR/bdev.conf)
		echo $(jq -r '.[].name' <<< $bdevs)
		jq -r '.[].name' <<< $bdevs
	else
		# Only target not mounted NVMes
		for bdf in $(iter_pci_class_code 01 08 02); do
@@ -297,7 +297,7 @@ function run_nvme_fio(){

function run_bdevperf(){
	echo "** Running bdevperf test, this can take a while, depending on the run-time setting."
	echo $($BDEVPERF_DIR/bdevperf -c $BASE_DIR/bdev.conf -q $IODEPTH -o $BLK_SIZE -w $RW -M $MIX -t $RUNTIME)
	$BDEVPERF_DIR/bdevperf -c $BASE_DIR/bdev.conf -q $IODEPTH -o $BLK_SIZE -w $RW -M $MIX -t $RUNTIME
	sleep 1
}