From 39e8a95c714ae82f9bba2c84c88aa48a694b87c5 Mon Sep 17 00:00:00 2001 From: Pawel Kaminski Date: Mon, 28 Oct 2019 08:23:22 -0400 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472605 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- scripts/check_format.sh | 2 +- test/bdev/bdev_raid.sh | 4 ++-- test/bdev/nbd_common.sh | 6 +++--- test/common/autotest_common.sh | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 03bc7da55..5b81c38c8 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -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. diff --git a/test/bdev/bdev_raid.sh b/test/bdev/bdev_raid.sh index b5ea4024a..c9e94a9d8 100755 --- a/test/bdev/bdev_raid.sh +++ b/test/bdev/bdev_raid.sh @@ -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 diff --git a/test/bdev/nbd_common.sh b/test/bdev/nbd_common.sh index f557bffe9..a7041f742 100644 --- a/test/bdev/nbd_common.sh +++ b/test/bdev/nbd_common.sh @@ -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 diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index c28a376cb..7a1c2eb18 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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