]> sourceware.org Git - lvm2.git/commitdiff
tests: utils.sh double quote
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 29 Jun 2017 08:12:21 +0000 (10:12 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 29 Jun 2017 20:23:17 +0000 (22:23 +0200)
test/lib/utils.sh

index 60979cc32ac344332cafc1c2b5fc9272eef1f749..c15eef32fdc57a07a49d976696e9d39a9e35f502 100644 (file)
@@ -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"
This page took 0.034245 seconds and 5 git commands to generate.