========== shellcheck - FAILED ====== Checking before the patch ====== ====== Checking the tree with the patch ====== tools/testing/selftests/vsock/vmtest.sh is a new file, but not shellcheck compliant New warnings added New errors added --- /tmp/tmp.yT5a1i16iA 2025-06-09 14:03:10.414496493 -0700 +++ /tmp/tmp.uXKIA7qftw 2025-06-09 14:03:11.157491886 -0700 @@ -0,0 +1,264 @@ + +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 93: + if [[ -s "${QEMU_PIDFILE}" ]]; then + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 94: + pkill -SIGTERM -F "${QEMU_PIDFILE}" > /dev/null 2>&1 + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 99: + if [[ -e "${QEMU_PIDFILE}" ]]; then + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 100: + rm "${QEMU_PIDFILE}" + ^------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 178: + 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 184: + if ! make -j$(nproc); then + ^------^ SC2046 (warning): Quote this to prevent word splitting. + + +In vmtest.sh line 188: + 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 210: + ${kernel_opt} \ + ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. + +Did you mean: + "${kernel_opt}" \ + + +In vmtest.sh line 243: + local port=$1 + ^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 244: + local interval=$2 + ^---------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 245: + local max_intervals=$3 + ^--------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 246: + local protocol=tcp + ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 247: + local pattern + ^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 248: + local i + ^-----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 250: + pattern=":$(printf "%04X" "${port}") " + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 253: + [ "${protocol}" = "tcp" ] && pattern="${pattern}0A" + ^------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^--------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 254: + for i in $(seq "${max_intervals}"); do + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^--------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 255: + if awk '{print $2" "$4}' /proc/net/"${protocol}"* | \ + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 257: + break + ^---^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 259: + sleep "${interval}" + ^-----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 264: + local port=$1 + ^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). + + +In vmtest.sh line 266: + vm_ssh <