From 6e03b6ba57d0c92dd1d285aec45ca6839d04cd53 Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Mon, 30 Sep 2019 11:24:11 +0200 Subject: [PATCH] test: Shellcheck - correct rule: "Can't use =~ in [ ]" Correct shellcheck rule SC2074: Can't use =~ in [ ]. Use [[..]] instead. Signed-off-by: Maciej Wawryk Change-Id: I34ae5e6d6fef37be3ad5d79efe4f06cf318aa696 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469825 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 2 +- test/iscsi_tgt/perf/iscsi_target.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index f03414933..d621f2e50 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -243,7 +243,7 @@ if hash shellcheck 2>/dev/null; then SC1083,SC1090,SC1091,SC1113,SC2001,SC2002,SC2003,SC2004,SC2005,\ SC2010,SC2012,SC2013,SC2015,SC2016,SC2018,SC2019,SC2022,\ SC2027,SC2030,SC2031,SC2034,SC2035,SC2039,SC2043,SC2044,SC2045,SC2046,\ -SC2068,SC2074,SC2086,SC2088,SC2089,SC2090,SC2091,SC2094,\ +SC2068,SC2086,SC2088,SC2089,SC2090,SC2091,SC2094,\ SC2097,SC2098,SC2103,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\ SC2129,SC2140,SC2142,SC2143,SC2145,SC2146,SC2148,SC2152,SC2153,SC2154,SC2155,\ SC2162,SC2164,SC2165,SC2166,SC2167,SC2174,SC2178,SC2181,\ diff --git a/test/iscsi_tgt/perf/iscsi_target.sh b/test/iscsi_tgt/perf/iscsi_target.sh index 6c7d41b8c..69158d3ac 100755 --- a/test/iscsi_tgt/perf/iscsi_target.sh +++ b/test/iscsi_tgt/perf/iscsi_target.sh @@ -91,9 +91,9 @@ timing_exit run_iscsi_app timing_enter iscsi_config bdevs=($($rpc_py bdev_get_bdevs | jq -r '.[].name')) -if [ $DISKNO == "ALL" ] || [ $DISKNO == "all" ]; then +if [[ $DISKNO == "ALL" ]] || [[ $DISKNO == "all" ]]; then DISKNO=${#bdevs[@]} -elif [ $DISKNO -gt ${#bdevs[@]} ] || [ ! $DISKNO =~ ^[0-9]+$ ]; then +elif [[ $DISKNO -gt ${#bdevs[@]} ]] || [[ ! $DISKNO =~ ^[0-9]+$ ]]; then error "Required device number ($DISKNO) is not a valid number or it's larger than the number of devices found (${#bdevs[@]})" fi