ShellCheck - shell script analysis tool version: 0.11.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.VvoggVRjvJ and /tmp/tmp.linzDKFuze Tree base: c92089f9a213 ("selftests/vsock: use ss to wait for listeners instead of /proc/net") Now at: a7645f49ea44 ("selftests/vsock: add tests for proc sys vsock ns_mode") ====== Checking before the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 13: 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 14: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 43: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 107: add_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 115: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 129: del_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 138: ns_set_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 162: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 241: 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 247: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 251: 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 313: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 344: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 379: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 390: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 417: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 444: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 452: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 455: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 485: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 493: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 527: log_guest() { ^-- SC2120 (warning): log_guest references arguments, but none are ever passed. ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 531: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 543: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 555: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 630: host_oops_cnt_after=$(dmesg | grep -i 'Oops' | wc -l) ^------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2120 -- log_guest references arguments, b... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 13: 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 14: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 43: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 139: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 162: ns_set_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 186: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 279: 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 285: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 289: 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 351: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 382: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 417: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 428: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 455: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 482: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 490: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 493: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 523: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 531: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 565: log_guest() { ^-- SC2120 (warning): log_guest references arguments, but none are ever passed. ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 569: test_ns_host_vsock_ns_mode_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 579: test_ns_host_vsock_ns_mode_write_once_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 595: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 607: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 619: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 699: host_oops_cnt_after=$(dmesg | grep -i 'Oops' | wc -l) ^------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2120 -- log_guest references arguments, b... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...