test: Use $((..)) instead of deprecated $[..]

Fix SC2007: Use $((..)) instead of deprecated $[..].
SC2007 removed from check_format.sh exclude list.

Change-Id: Ifd858857e461d785d6d6f101acca13c326ee637e
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Karol Latecki 2019-08-05 15:43:47 +02:00 committed by Jim Harris
parent 1a3e41f281
commit 0f0cd0a87b
4 changed files with 8 additions and 8 deletions

View File

@ -241,7 +241,7 @@ if hash shellcheck 2>/dev/null; then
# Error descriptions can also be found at: https://github.com/koalaman/shellcheck/wiki
SHCK_EXCLUDE="SC1001,SC1003,SC1004,SC1010,\
SC1083,SC1087,SC1090,SC1091,SC1113,SC2001,SC2002,SC2003,SC2004,SC2005,\
SC2007,SC2009,SC2010,SC2012,SC2013,SC2015,SC2016,SC2018,SC2019,SC2022,SC2026,\
SC2009,SC2010,SC2012,SC2013,SC2015,SC2016,SC2018,SC2019,SC2022,SC2026,\
SC2027,SC2030,SC2031,SC2034,SC2035,SC2039,SC2043,SC2044,SC2045,SC2046,SC2048,\
SC2059,SC2064,SC2068,SC2074,SC2086,SC2088,SC2089,SC2090,SC2091,SC2094,\
SC2097,SC2098,SC2103,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\

View File

@ -651,7 +651,7 @@ function waitforblk()
local i=0
while ! lsblk -l -o NAME | grep -q -w $1; do
[ $i -lt 15 ] || break
i=$[$i+1]
i=$((i+1))
sleep 1
done
@ -667,7 +667,7 @@ function waitforblk_disconnect()
local i=0
while lsblk -l -o NAME | grep -q -w $1; do
[ $i -lt 15 ] || break
i=$[$i+1]
i=$((i+1))
sleep 1
done
@ -683,7 +683,7 @@ function waitforfile()
local i=0
while [ ! -e $1 ]; do
[ $i -lt 200 ] || break
i=$[$i+1]
i=$((i+1))
sleep 0.1
done

View File

@ -21,13 +21,13 @@ function create_nv_cache_bdev() {
local cache_bdf=$3
local num_punits=$4
local bytes_to_mb=$[1024 * 1024]
local bytes_to_mb=$((1024 * 1024))
local chunk_size=$(get_chunk_size $ocssd_bdf)
# We need at least 2 bands worth of data + 1 block
local size=$[2 * 4096 * $chunk_size * $num_punits + 1]
local size=$((2 * 4096 * $chunk_size * $num_punits + 1))
# Round the size up to the nearest megabyte
local size=$[($size + $bytes_to_mb) / $bytes_to_mb]
local size=$((($size + $bytes_to_mb) / $bytes_to_mb))
# Create NVMe bdev on specified device and split it so that it has the desired size
local nvc_bdev=$($rootdir/scripts/rpc.py construct_nvme_bdev -b $name -t PCIe -a $cache_bdf)

View File

@ -35,7 +35,7 @@ do
done
for i in $(seq 1 $NVMF_SUBSYS); do
k=$[$i-1]
k=$((i-1))
nvme connect -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
waitforblk "nvme${k}n1"