test: Shellcheck - apply rule SC2152

Can only return 0-255. Other data should be written to stdout.

Change-Id: Idb8b387f438121e6b6afe62840ddee752872d7d7
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472605
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Pawel Kaminski 2019-10-28 08:23:22 -04:00 committed by Tomasz Zawadzki
parent 56621dea3c
commit 39e8a95c71
4 changed files with 10 additions and 10 deletions

View File

@ -243,7 +243,7 @@ if hash shellcheck 2>/dev/null; then
SHCK_EXCLUDE="SC1083,SC2002,SC2004,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2148,SC2152,SC2154,SC2155,SC2162"
SC2129,SC2140,SC2142,SC2143,SC2148,SC2154,SC2155,SC2162"
# 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
# so that we can still run with older versions of shellcheck.

View File

@ -90,7 +90,7 @@ function raid_function_test() {
nbd_start_disks $rpc_server $raid_bdev $nbd
count=$(nbd_get_count $rpc_server)
if [ $count -ne 1 ]; then
return -1
return 1
fi
raid_unmap_data_verify $nbd $rpc_server
@ -98,7 +98,7 @@ function raid_function_test() {
nbd_stop_disks $rpc_server $nbd
count=$(nbd_get_count $rpc_server)
if [ $count -ne 0 ]; then
return -1
return 1
fi
killprocess $raid_pid

View File

@ -89,7 +89,7 @@ function nbd_rpc_data_verify() {
nbd_start_disks $rpc_server "${bdev_list[*]}" "${nbd_list[*]}"
count=$(nbd_get_count $rpc_server)
if [ $count -ne ${#nbd_list[@]} ]; then
return -1
return 1
fi
nbd_dd_data_verify "${nbd_list[*]}" "write"
@ -98,7 +98,7 @@ function nbd_rpc_data_verify() {
nbd_stop_disks $rpc_server "${nbd_list[*]}"
count=$(nbd_get_count $rpc_server)
if [ $count -ne 0 ]; then
return -1
return 1
fi
return 0
@ -116,7 +116,7 @@ function nbd_rpc_start_stop_verify() {
count=$(nbd_get_count $rpc_server)
if [ $count -ne 0 ]; then
return -1
return 1
fi
return 0

View File

@ -655,7 +655,7 @@ function discover_bdevs()
if [ ! -e $config_file ]; then
echo "Invalid Configuration File: $config_file"
return -1
return 1
fi
# Start the bdev service to query for the list of available
@ -737,7 +737,7 @@ function fio_config_gen()
if [ -e "$config_file" ]; then
echo "Configuration File Already Exists!: $config_file"
return -1
return 1
fi
if [ -z "$workload" ]; then
@ -784,12 +784,12 @@ function fio_config_add_job()
if [ ! -e "$config_file" ]; then
echo "Configuration File Doesn't Exist: $config_file"
return -1
return 1
fi
if [ -z "$filename" ]; then
echo "No filename provided"
return -1
return 1
fi
echo "[job_$filename]" >> $config_file