From c396053955c6481cfc753f498af9a61202ce2d91 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 29 Jun 2017 10:12:21 +0200 Subject: [PATCH] tests: utils.sh double quote --- test/lib/utils.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lib/utils.sh b/test/lib/utils.sh index 60979cc32..c15eef32f 100644 --- a/test/lib/utils.sh +++ b/test/lib/utils.sh @@ -35,16 +35,16 @@ rand_bytes() { cmds='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n' data=$( (eval "$cmds") 2>&1 | gzip ) - n_plus_50=$(expr $n + 50) + n_plus_50=$(( n + 50 )) # Ensure that $data has length at least 50+$n while :; do len=$(echo "$data" | wc -c) - test $n_plus_50 -le $len && break; + test "$n_plus_50" -le "$len" && break; data=$( (echo "$data"; eval "$cmds") 2>&1 | gzip ) done - echo "$data" | dd bs=1 skip=50 count=$n 2>/dev/null \ + echo "$data" | dd bs=1 skip=50 count="$n" 2>/dev/null \ | tr -c "$chars" "01234567$chars$chars$chars" } @@ -137,7 +137,7 @@ STACKTRACE() { for core in $(ls core* 2>/dev/null); do bin=$(gdb -batch -c "$core" 2>&1 | grep "generated by" | \ sed -e "s,.*generated by \`\([^ ']*\).*,\1,") - gdb -batch -c "$core" -x gdb_commands.txt $(which "$bin") + gdb -batch -c "$core" -x gdb_commands.txt "$(which "$bin")" done fi @@ -159,7 +159,7 @@ STACKTRACE() { sed -e "s,^,## STRACE: ," strace.log fi dmsetup info -c | grep1_ "$PREFIX" > out - if test $(wc -l < out) -gt 1 ; then + if test "$(wc -l < out)" -gt 1 ; then echo "<======== Info ========>" sed -e "s,^,## DMINFO: ," out echo "<======== Active table ========>" @@ -258,7 +258,7 @@ if test -z "${installed_testsuite+varset}"; then case "$PATH" in *"$abs_top_builddir/test/lib"*) ;; *) - PATH="$abs_top_builddir/test/lib":"$abs_top_builddir/test/api":$PATH + PATH="$abs_top_builddir/test/lib:$abs_top_builddir/test/api:$PATH" LD_LIBRARY_PATH=$(find -L "$abs_top_builddir/libdm/" "$abs_top_builddir/tools/"\ "$abs_top_builddir/daemons/" "$abs_top_builddir/liblvm/"\ -name "*.so" -printf "%h:")"$LD_LIBRARY_PATH" -- 2.43.5