ShellCheck - shell script analysis tool version: 0.10.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.4A4aBPpkFc and /tmp/tmp.oW2etDyZEj Tree base: 27468e3d00ef ("selftests/vsock: improve logging in vmtest.sh") Now at: dc9d3810b5a4 ("selftests/vsock: invoke vsock_test through helpers") ====== Checking before the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 11: readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 12: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 26: readonly QEMU_PIDFILE=$(mktemp /tmp/qemu_vsock_vmtest_XXXX.pid) ^----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 46: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 57: readonly LOG_LEVEL_ERROR=3 ^-------------^ SC2034 (warning): LOG_LEVEL_ERROR appears unused. Verify use (or export if used externally). In vmtest.sh line 136: for dep in vng ${QEMU} busybox pkill ssh; do ^-----^ SC2153 (info): Possible misspelling: QEMU may not be assigned. Did you mean qemu? In vmtest.sh line 183: pushd "${KERNEL_CHECKOUT}" &>/dev/null ^-- SC2164 (warning): Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. Did you mean: pushd "${KERNEL_CHECKOUT}" &>/dev/null || exit In vmtest.sh line 189: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 193: popd &>/dev/null ^--------------^ SC2164 (warning): Use 'popd ... || exit' or 'popd ... || return' in case popd fails. Did you mean: popd &>/dev/null || exit In vmtest.sh line 215: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 310: LOG_PREFIX=host log $@ ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. In vmtest.sh line 314: LOG_PREFIX=guest log $@ ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. In vmtest.sh line 317: } ^-- SC1089 (error): Parsing stopped here. Is this keyword correctly matched up? For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2034 -- LOG_LEVEL_ERROR appears unused. V... https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 11: readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 12: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 26: readonly QEMU_PIDFILE=$(mktemp /tmp/qemu_vsock_vmtest_XXXX.pid) ^----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 46: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 57: readonly LOG_LEVEL_ERROR=3 ^-------------^ SC2034 (warning): LOG_LEVEL_ERROR appears unused. Verify use (or export if used externally). In vmtest.sh line 136: for dep in vng ${QEMU} busybox pkill ssh; do ^-----^ SC2153 (info): Possible misspelling: QEMU may not be assigned. Did you mean qemu? In vmtest.sh line 183: pushd "${KERNEL_CHECKOUT}" &>/dev/null ^-- SC2164 (warning): Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. Did you mean: pushd "${KERNEL_CHECKOUT}" &>/dev/null || exit In vmtest.sh line 189: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 193: popd &>/dev/null ^--------------^ SC2164 (warning): Use 'popd ... || exit' or 'popd ... || return' in case popd fails. Did you mean: popd &>/dev/null || exit In vmtest.sh line 215: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 321: log_host() { ^-- SC2120 (warning): log_host references arguments, but none are ever passed. In vmtest.sh line 322: LOG_PREFIX=host log $@ ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. In vmtest.sh line 325: log_guest() { ^-- SC2120 (warning): log_guest references arguments, but none are ever passed. In vmtest.sh line 326: LOG_PREFIX=guest log $@ ^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements. In vmtest.sh line 346: 2>&1 | log_guest ^-------^ SC2119 (info): Use log_guest "$@" if function's $1 should mean script's $1. In vmtest.sh line 357: 2>&1 | log_guest & ^-------^ SC2119 (info): Use log_guest "$@" if function's $1 should mean script's $1. In vmtest.sh line 395: --control-port="${port}" 2>&1 | log_host ^------^ SC2119 (info): Use log_host "$@" if function's $1 should mean script's $1. In vmtest.sh line 404: --control-port="${port}" 2>&1 | log_host & ^------^ SC2119 (info): Use log_host "$@" if function's $1 should mean script's $1. In vmtest.sh line 435: } ^-- SC1089 (error): Parsing stopped here. Is this keyword correctly matched up? For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2034 -- LOG_LEVEL_ERROR appears unused. V... https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...