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.Qv0x4D5XtU and /tmp/tmp.5kN50PmqRy Tree base: 1f3f4fcb6c16 ("selftests/vsock: add tests for proc sys vsock ns_mode") Now at: 5e51df924eba ("selftests/vsock: add namespace tests for CID collisions") ====== 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 144: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 167: ns_set_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 191: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 284: 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 290: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 294: 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 356: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 387: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 422: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 433: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 460: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 487: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 495: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 498: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 528: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 536: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 570: 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 574: 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 584: 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 600: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 612: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 624: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 641: test_ns_vm_local_mode_rejected() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 724: 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 160: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 183: ns_set_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 207: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 300: 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 306: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 310: 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 372: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 403: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 438: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 449: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 476: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 503: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 511: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 514: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 544: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 552: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 586: 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 590: 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 600: namespaces_can_boot_same_cid() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 622: test_ns_global_same_cid_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 632: test_ns_local_global_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 642: test_ns_global_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 652: test_ns_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 662: 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 678: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 690: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 702: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 719: test_ns_vm_local_mode_rejected() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 802: 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 ...