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

test: Shellcheck - correct rule: Use "${var:?}"\



Correct shellcheck rule SC2115: Use "${var:?}" to
ensure this never expands to /* .

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent a8dee6d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ echo -e "\t[mon.a]" >> "$ceph_conf"
echo -e "\tmon addr = ${mon_ip}:12046" >> "$ceph_conf"

# create mon
rm -rf ${mon_dir}/*
rm -rf "${mon_dir:?}/"*
mkdir -p ${mon_dir}
mkdir -p ${pid_dir}
rm -f /etc/ceph/ceph.client.admin.keyring
+1 −1
Original line number Diff line number Diff line
@@ -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,SC2004,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2115,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2097,SC2098,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2148,SC2152,SC2153,SC2154,SC2155,\
SC2162,SC2164,SC2165,SC2166,SC2167,\
SC2230"
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ function host1_start_nvmf()

	notice "Starting nvmf_tgt instance on local server"
	mkdir -p $nvmf_dir
	rm -rf $nvmf_dir/*
	rm -rf "${nvmf_dir:?}/"*

	trap 'host1_cleanup_nvmf SIGKILL; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
	$rootdir/app/nvmf_tgt/nvmf_tgt -s 512 -m 0xF -r $nvmf_dir/nvmf_rpc.sock --wait-for-rpc &
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ function error()
	trap - ERR
	set +e
	umount "$test_folder_name"
	rm -rf "$testdir/$test_folder_name"
	rm -rf "${testdir:?}/${test_folder_name:?}"
	exit 1
}

@@ -37,7 +37,7 @@ mount /dev/$disk_name"1" $test_folder_name

echo "INFO: Removing folder and unmounting $test_folder_name"
umount "$test_folder_name"
rm -rf "$testdir/$test_folder_name"
rm -rf "${testdir:?}/${test_folder_name:?}"

echo "INFO: Deleting partition"
echo -e "d\n1\nw" | fdisk /dev/$disk_name
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ function error()
	trap - ERR
	set +e
	umount "$test_folder_name"
	rm -rf "$testdir/$test_folder_name"
	rm -rf "${testdir:?}/${test_folder_name:?}"
	exit 1
}

@@ -45,4 +45,4 @@ mount /dev/$disk_name"1" $test_folder_name
echo "INFO: Creating a test file $test_file_name"
truncate -s "200M" $test_folder_name/$test_file_name
umount "$test_folder_name"
rm -rf "$testdir/$test_folder_name"
rm -rf "${testdir:?}/${test_folder_name:?}"
Loading