diff --git a/test/lib/check.sh b/test/lib/check.sh index 3c7b81a5c..ed4f8d724 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -240,10 +240,10 @@ in_sync() { fi if [[ ${a[$(( idx - 1 ))]} =~ a ]] ; then - [ $ignore_a -eq 0 ] && \ + [ "$ignore_a" = 0 ] && \ die "$lvm_name ($type$snap) in-sync, but 'a' characters in health status" echo "$lvm_name ($type$snap) is not in-sync" - [ $ignore_a -eq 1 ] && return 0 + [ "$ignore_a" = 1 ] && return 0 return 1 fi diff --git a/test/lib/utils.sh b/test/lib/utils.sh index f2a4bde44..36fbf0602 100644 --- a/test/lib/utils.sh +++ b/test/lib/utils.sh @@ -39,7 +39,7 @@ rand_bytes() { # Ensure that $data has length at least 50+$n while :; do - len=$(echo "$data" | wc -c) + len=${#data} # number of chars in $data test "$n_plus_50" -le "$len" && break; data=$( (echo "$data"; eval "$cmds") 2>&1 | gzip ) done @@ -112,7 +112,7 @@ stacktrace() { # i=1 - ignoring innermost frame - it is always stacktrace function local i=1 n=${#BASH_LINENO[*]} # n-=1 - ignoring last frame as well - it is not interesting - let n-=1 + n=$(( n - 1 )) echo "## - $0:${BASH_LINENO[$((n-1))]}" while [[ $i -lt $n ]]; do