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.zO34gUlJuS and /tmp/tmp.Aj98MYEQPX Tree base: 5442a9da6978 ("veth: more robust handing of race to avoid txq getting stuck") Now at: eb666a24be75 ("selftests: net: lib: Do not overwrite error messages") ====== Checking before the patch ====== Checking tools/testing/selftests/net/forwarding/lib_sh_test.sh - da4f691beeeb769f4cd92aac63c17bd2f9c3e433786e88a47931ae4cf40e2ed8 In lib_sh_test.sh line 86: return $RET ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$RET" In lib_sh_test.sh line 108: [[ $out == $expect_retmsg ]] ^------------^ SC2053 (warning): Quote the right-hand side of == in [[ ]] to prevent glob matching. In lib_sh_test.sh line 111: log_test "RET $(echo ${tests[@]}) -> ${status_names[$ret]}" ^-----------------^ SC2116 (style): Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. ^---------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In lib_sh_test.sh line 116: ret_subtest $ksft_pass "" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" In lib_sh_test.sh line 118: ret_subtest $ksft_pass "" tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" tpass In lib_sh_test.sh line 119: ret_subtest $ksft_fail "tfail" tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail In lib_sh_test.sh line 120: ret_subtest $ksft_xfail "txfail" txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail In lib_sh_test.sh line 122: ret_subtest $ksft_pass "" tpass tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" tpass tpass In lib_sh_test.sh line 123: ret_subtest $ksft_fail "tfail" tpass tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tpass tfail In lib_sh_test.sh line 124: ret_subtest $ksft_xfail "txfail" tpass txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" tpass txfail In lib_sh_test.sh line 126: ret_subtest $ksft_fail "tfail" tfail tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail tpass In lib_sh_test.sh line 127: ret_subtest $ksft_xfail "txfail" txfail tpass ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail tpass In lib_sh_test.sh line 129: ret_subtest $ksft_fail "tfail" tfail tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail tfail In lib_sh_test.sh line 130: ret_subtest $ksft_fail "tfail" tfail txfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail txfail In lib_sh_test.sh line 132: ret_subtest $ksft_fail "tfail" txfail tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" txfail tfail In lib_sh_test.sh line 134: ret_subtest $ksft_xfail "txfail" txfail txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail txfail In lib_sh_test.sh line 141: return $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$EXIT_STATUS" In lib_sh_test.sh line 147: local tests=$1; shift ^---^ SC2178 (warning): Variable was used as an array but is now assigned a string. In lib_sh_test.sh line 157: out=$(TESTS="$tests" exit_status_tests_run) ^----^ SC2128 (warning): Expanding an array without an index only gives the first element. In lib_sh_test.sh line 163: log_test "EXIT_STATUS $tests$what -> ${status_names[$exit_status]}" ^----^ SC2128 (warning): Expanding an array without an index only gives the first element. In lib_sh_test.sh line 168: exit_status_subtest $ksft_pass ":" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" ":" In lib_sh_test.sh line 170: exit_status_subtest $ksft_pass "pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass" In lib_sh_test.sh line 171: exit_status_subtest $ksft_fail "fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail" In lib_sh_test.sh line 172: exit_status_subtest $ksft_pass "xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail" In lib_sh_test.sh line 173: exit_status_subtest $ksft_skip "skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip" In lib_sh_test.sh line 175: exit_status_subtest $ksft_pass "pass pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass pass" In lib_sh_test.sh line 176: exit_status_subtest $ksft_fail "pass fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "pass fail" In lib_sh_test.sh line 177: exit_status_subtest $ksft_pass "pass xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass xfail" In lib_sh_test.sh line 178: exit_status_subtest $ksft_skip "pass skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "pass skip" In lib_sh_test.sh line 180: exit_status_subtest $ksft_fail "fail pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail pass" In lib_sh_test.sh line 181: exit_status_subtest $ksft_pass "xfail pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail pass" In lib_sh_test.sh line 182: exit_status_subtest $ksft_skip "skip pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip pass" In lib_sh_test.sh line 184: exit_status_subtest $ksft_fail "fail fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail fail" In lib_sh_test.sh line 185: exit_status_subtest $ksft_fail "fail xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail xfail" In lib_sh_test.sh line 186: exit_status_subtest $ksft_fail "fail skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail skip" In lib_sh_test.sh line 188: exit_status_subtest $ksft_fail "xfail fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "xfail fail" In lib_sh_test.sh line 189: exit_status_subtest $ksft_fail "skip fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "skip fail" In lib_sh_test.sh line 191: exit_status_subtest $ksft_pass "xfail xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail xfail" In lib_sh_test.sh line 192: exit_status_subtest $ksft_skip "xfail skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "xfail skip" In lib_sh_test.sh line 193: exit_status_subtest $ksft_skip "skip xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip xfail" In lib_sh_test.sh line 195: exit_status_subtest $ksft_skip "skip skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip skip" In lib_sh_test.sh line 198: exit_status_subtest $ksft_pass "slow_xfail" ": slow" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "slow_xfail" ": slow" In lib_sh_test.sh line 201: exit_status_subtest $ksft_fail "slow_xfail" ": fast" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "slow_xfail" ": fast" In lib_sh_test.sh line 208: exit $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit "$EXIT_STATUS" For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2053 -- Quote the right-hand side of == i... https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind... Checking tools/testing/selftests/net/lib.sh - c03467c29b10bc5091e0c288a3bb791664845bf18d1bc2e796311e58cd726204 In lib.sh line 78: local start_time="$(date -u +%s%3N)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 87: local current_time="$(date -u +%s%3N)" ^----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 115: local current=$("$@") ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 118: ((current $expr)) ^-- SC1105 (error): Shells disambiguate (( differently or not at all. For subshell, add spaces around ( . For ((, fix parsing errors. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ((current "$expr")) In lib.sh line 126: local base=$("$@") ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 135: local base=$("$@") ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 145: if ! which $prog_name >/dev/null 2>/dev/null; then ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! which "$prog_name" >/dev/null 2>/dev/null; then In lib.sh line 147: if ! which $prog_name >/dev/null; then ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! which "$prog_name" >/dev/null; then In lib.sh line 235: echo "$id 1" | ip netns exec $ns tee /sys/bus/netdevsim/new_device >/dev/null ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$id 1" | ip netns exec "$ns" tee /sys/bus/netdevsim/new_device >/dev/null In lib.sh line 236: local dev=$(ip netns exec $ns ls /sys/bus/netdevsim/devices/netdevsim$id/net) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local dev=$(ip netns exec "$ns" ls /sys/bus/netdevsim/devices/netdevsim"$id"/net) In lib.sh line 237: ip -netns $ns link set dev $dev name nsim$id ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -netns "$ns" link set dev "$dev" name nsim"$id" In lib.sh line 238: ip -netns $ns link set dev nsim$id up ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -netns "$ns" link set dev nsim"$id" up In lib.sh line 240: echo nsim$id ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo nsim"$id" In lib.sh line 282: tc -j -s filter show dev $dev $dir pref $pref \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -j -s filter show dev "$dev" "$dir" pref "$pref" \ In lib.sh line 293: tc $netns -j -s filter show $id \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc "$netns" -j -s filter show "$id" \ In lib.sh line 305: tc -n $ns qdisc add dev $dev root handle 1: prio bands 2 \ ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" root handle 1: prio bands 2 \ In lib.sh line 308: tc -n $ns qdisc add dev $dev parent 1:1 handle 11: pfifo ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" parent 1:1 handle 11: pfifo In lib.sh line 309: tc -n $ns qdisc add dev $dev parent 1:2 handle 12: pfifo ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" parent 1:2 handle 12: pfifo In lib.sh line 311: tc -n $ns filter add dev $dev parent 1: protocol ipv$ipver \ ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" filter add dev "$dev" parent 1: protocol ipv"$ipver" \ In lib.sh line 312: flower $flower_expr classid 1:2 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: flower "$flower_expr" classid 1:2 In lib.sh line 319: tc -n $ns -j -s qdisc show dev $dev handle 12: | jq .[0].packets ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" -j -s qdisc show dev "$dev" handle 12: | jq .[0].packets In lib.sh line 327: RET=$(ksft_status_merge $RET $ksft_status) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RET=$(ksft_status_merge $RET "$ksft_status") In lib.sh line 328: if (( $? )); then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In lib.sh line 350: read a ^--^ SC2162 (info): read without -r will mangle backslashes. In lib.sh line 408: EXIT_STATUS=$(ksft_exit_status_merge $EXIT_STATUS $RET) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: EXIT_STATUS=$(ksft_exit_status_merge $EXIT_STATUS "$RET") In lib.sh line 409: return $RET ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$RET" In lib.sh line 414: RET=$ksft_skip retmsg= log_test "$@" ^-- SC1007 (warning): Remove space after = if trying to assign a value (for empty string, use var='' ... ). In lib.sh line 419: RET=$ksft_xfail retmsg= log_test "$@" ^-- SC1007 (warning): Remove space after = if trying to assign a value (for empty string, use var='' ... ). In lib.sh line 435: $current_test ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$current_test" In lib.sh line 471: check_fail $err "$what succeeded, but should have failed" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_fail "$err" "$what succeeded, but should have failed" In lib.sh line 473: check_err $err "$what failed" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_err "$err" "$what failed" In lib.sh line 503: kind=$(ip -j -d link show dev $dev | ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kind=$(ip -j -d link show dev "$dev" | In lib.sh line 516: ip -j link show dev $if_name | jq -r '.[]["address"]' ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -j link show dev "$if_name" | jq -r '.[]["address"]' In lib.sh line 524: { kill $pid && wait $pid; } 2>/dev/null ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: { kill "$pid" && wait "$pid"; } 2>/dev/null In lib.sh line 533: return $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$EXIT_STATUS" In lib.sh line 542: exit $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit "$EXIT_STATUS" In lib.sh line 568: local old_addr=$(mac_get "$name") ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 578: local state=$(ip -j link show "$name" | ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 639: [ ${protocol} = "tcp" ] && pattern="${pattern}0A" ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "${protocol}" = "tcp" ] && pattern="${pattern}0A" In lib.sh line 641: if ip netns exec "${listener_ns}" awk '{print $2" "$4}' \ ^---------------^ SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. In lib.sh line 663: output=$(echo $output | jq -r $jq_opts "$jq_exp") ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: output=$(echo "$output" | jq -r "$jq_opts" "$jq_exp") In lib.sh line 668: echo $output ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$output" In lib.sh line 670: [ ! -z "$output" ] ^-- SC2236 (style): Use -n instead of ! -z. For more information: https://www.shellcheck.net/wiki/SC1105 -- Shells disambiguate (( differentl... https://www.shellcheck.net/wiki/SC1007 -- Remove space after = if trying to... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/forwarding/lib_sh_test.sh - da4f691beeeb769f4cd92aac63c17bd2f9c3e433786e88a47931ae4cf40e2ed8 In lib_sh_test.sh line 91: return $RET ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$RET" In lib_sh_test.sh line 113: [[ $out == $expect_retmsg ]] ^------------^ SC2053 (warning): Quote the right-hand side of == in [[ ]] to prevent glob matching. In lib_sh_test.sh line 116: log_test "RET $(echo ${tests[@]}) -> ${status_names[$ret]}" ^-----------------^ SC2116 (style): Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. ^---------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In lib_sh_test.sh line 121: ret_subtest $ksft_pass "" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" In lib_sh_test.sh line 123: ret_subtest $ksft_pass "" tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" tpass In lib_sh_test.sh line 124: ret_subtest $ksft_fail "tfail" tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail In lib_sh_test.sh line 125: ret_subtest $ksft_xfail "txfail" txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail In lib_sh_test.sh line 127: ret_subtest $ksft_pass "" tpass tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_pass" "" tpass tpass In lib_sh_test.sh line 128: ret_subtest $ksft_fail "tfail" tpass tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tpass tfail In lib_sh_test.sh line 129: ret_subtest $ksft_xfail "txfail" tpass txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" tpass txfail In lib_sh_test.sh line 131: ret_subtest $ksft_fail "tfail" tfail tpass ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail tpass In lib_sh_test.sh line 132: ret_subtest $ksft_xfail "txfail" txfail tpass ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail tpass In lib_sh_test.sh line 134: ret_subtest $ksft_fail "tfail" tfail tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail tfail In lib_sh_test.sh line 135: ret_subtest $ksft_fail "tfail" tfail txfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" tfail txfail In lib_sh_test.sh line 137: ret_subtest $ksft_fail "tfail" txfail tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail" txfail tfail In lib_sh_test.sh line 139: ret_subtest $ksft_xfail "txfail" txfail txfail ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_xfail" "txfail" txfail txfail In lib_sh_test.sh line 141: ret_subtest $ksft_fail "tfail2" tfail2 tfail ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ret_subtest "$ksft_fail" "tfail2" tfail2 tfail In lib_sh_test.sh line 148: return $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$EXIT_STATUS" In lib_sh_test.sh line 154: local tests=$1; shift ^---^ SC2178 (warning): Variable was used as an array but is now assigned a string. In lib_sh_test.sh line 164: out=$(TESTS="$tests" exit_status_tests_run) ^----^ SC2128 (warning): Expanding an array without an index only gives the first element. In lib_sh_test.sh line 170: log_test "EXIT_STATUS $tests$what -> ${status_names[$exit_status]}" ^----^ SC2128 (warning): Expanding an array without an index only gives the first element. In lib_sh_test.sh line 175: exit_status_subtest $ksft_pass ":" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" ":" In lib_sh_test.sh line 177: exit_status_subtest $ksft_pass "pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass" In lib_sh_test.sh line 178: exit_status_subtest $ksft_fail "fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail" In lib_sh_test.sh line 179: exit_status_subtest $ksft_pass "xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail" In lib_sh_test.sh line 180: exit_status_subtest $ksft_skip "skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip" In lib_sh_test.sh line 182: exit_status_subtest $ksft_pass "pass pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass pass" In lib_sh_test.sh line 183: exit_status_subtest $ksft_fail "pass fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "pass fail" In lib_sh_test.sh line 184: exit_status_subtest $ksft_pass "pass xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "pass xfail" In lib_sh_test.sh line 185: exit_status_subtest $ksft_skip "pass skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "pass skip" In lib_sh_test.sh line 187: exit_status_subtest $ksft_fail "fail pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail pass" In lib_sh_test.sh line 188: exit_status_subtest $ksft_pass "xfail pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail pass" In lib_sh_test.sh line 189: exit_status_subtest $ksft_skip "skip pass" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip pass" In lib_sh_test.sh line 191: exit_status_subtest $ksft_fail "fail fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail fail" In lib_sh_test.sh line 192: exit_status_subtest $ksft_fail "fail xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail xfail" In lib_sh_test.sh line 193: exit_status_subtest $ksft_fail "fail skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "fail skip" In lib_sh_test.sh line 195: exit_status_subtest $ksft_fail "xfail fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "xfail fail" In lib_sh_test.sh line 196: exit_status_subtest $ksft_fail "skip fail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "skip fail" In lib_sh_test.sh line 198: exit_status_subtest $ksft_pass "xfail xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "xfail xfail" In lib_sh_test.sh line 199: exit_status_subtest $ksft_skip "xfail skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "xfail skip" In lib_sh_test.sh line 200: exit_status_subtest $ksft_skip "skip xfail" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip xfail" In lib_sh_test.sh line 202: exit_status_subtest $ksft_skip "skip skip" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_skip" "skip skip" In lib_sh_test.sh line 205: exit_status_subtest $ksft_pass "slow_xfail" ": slow" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_pass" "slow_xfail" ": slow" In lib_sh_test.sh line 208: exit_status_subtest $ksft_fail "slow_xfail" ": fast" ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit_status_subtest "$ksft_fail" "slow_xfail" ": fast" In lib_sh_test.sh line 215: exit $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit "$EXIT_STATUS" For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2053 -- Quote the right-hand side of == i... https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind... Checking tools/testing/selftests/net/lib.sh - c03467c29b10bc5091e0c288a3bb791664845bf18d1bc2e796311e58cd726204 In lib.sh line 78: local start_time="$(date -u +%s%3N)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 87: local current_time="$(date -u +%s%3N)" ^----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 115: local current=$("$@") ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 118: ((current $expr)) ^-- SC1105 (error): Shells disambiguate (( differently or not at all. For subshell, add spaces around ( . For ((, fix parsing errors. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ((current "$expr")) In lib.sh line 126: local base=$("$@") ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 135: local base=$("$@") ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 145: if ! which $prog_name >/dev/null 2>/dev/null; then ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! which "$prog_name" >/dev/null 2>/dev/null; then In lib.sh line 147: if ! which $prog_name >/dev/null; then ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! which "$prog_name" >/dev/null; then In lib.sh line 235: echo "$id 1" | ip netns exec $ns tee /sys/bus/netdevsim/new_device >/dev/null ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$id 1" | ip netns exec "$ns" tee /sys/bus/netdevsim/new_device >/dev/null In lib.sh line 236: local dev=$(ip netns exec $ns ls /sys/bus/netdevsim/devices/netdevsim$id/net) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local dev=$(ip netns exec "$ns" ls /sys/bus/netdevsim/devices/netdevsim"$id"/net) In lib.sh line 237: ip -netns $ns link set dev $dev name nsim$id ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -netns "$ns" link set dev "$dev" name nsim"$id" In lib.sh line 238: ip -netns $ns link set dev nsim$id up ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -netns "$ns" link set dev nsim"$id" up In lib.sh line 240: echo nsim$id ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo nsim"$id" In lib.sh line 282: tc -j -s filter show dev $dev $dir pref $pref \ ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -j -s filter show dev "$dev" "$dir" pref "$pref" \ In lib.sh line 293: tc $netns -j -s filter show $id \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc "$netns" -j -s filter show "$id" \ In lib.sh line 305: tc -n $ns qdisc add dev $dev root handle 1: prio bands 2 \ ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" root handle 1: prio bands 2 \ In lib.sh line 308: tc -n $ns qdisc add dev $dev parent 1:1 handle 11: pfifo ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" parent 1:1 handle 11: pfifo In lib.sh line 309: tc -n $ns qdisc add dev $dev parent 1:2 handle 12: pfifo ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" qdisc add dev "$dev" parent 1:2 handle 12: pfifo In lib.sh line 311: tc -n $ns filter add dev $dev parent 1: protocol ipv$ipver \ ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" filter add dev "$dev" parent 1: protocol ipv"$ipver" \ In lib.sh line 312: flower $flower_expr classid 1:2 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: flower "$flower_expr" classid 1:2 In lib.sh line 319: tc -n $ns -j -s qdisc show dev $dev handle 12: | jq .[0].packets ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc -n "$ns" -j -s qdisc show dev "$dev" handle 12: | jq .[0].packets In lib.sh line 327: RET=$(ksft_status_merge $RET $ksft_status) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: RET=$(ksft_status_merge $RET "$ksft_status") In lib.sh line 328: if (( $? )); then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In lib.sh line 350: read a ^--^ SC2162 (info): read without -r will mangle backslashes. In lib.sh line 408: EXIT_STATUS=$(ksft_exit_status_merge $EXIT_STATUS $RET) ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: EXIT_STATUS=$(ksft_exit_status_merge $EXIT_STATUS "$RET") In lib.sh line 409: return $RET ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$RET" In lib.sh line 414: RET=$ksft_skip retmsg= log_test "$@" ^-- SC1007 (warning): Remove space after = if trying to assign a value (for empty string, use var='' ... ). In lib.sh line 419: RET=$ksft_xfail retmsg= log_test "$@" ^-- SC1007 (warning): Remove space after = if trying to assign a value (for empty string, use var='' ... ). In lib.sh line 435: $current_test ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$current_test" In lib.sh line 471: check_fail $err "$what succeeded, but should have failed" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_fail "$err" "$what succeeded, but should have failed" In lib.sh line 473: check_err $err "$what failed" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_err "$err" "$what failed" In lib.sh line 503: kind=$(ip -j -d link show dev $dev | ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kind=$(ip -j -d link show dev "$dev" | In lib.sh line 516: ip -j link show dev $if_name | jq -r '.[]["address"]' ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -j link show dev "$if_name" | jq -r '.[]["address"]' In lib.sh line 524: { kill $pid && wait $pid; } 2>/dev/null ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: { kill "$pid" && wait "$pid"; } 2>/dev/null In lib.sh line 533: return $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$EXIT_STATUS" In lib.sh line 542: exit $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit "$EXIT_STATUS" In lib.sh line 568: local old_addr=$(mac_get "$name") ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 578: local state=$(ip -j link show "$name" | ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In lib.sh line 639: [ ${protocol} = "tcp" ] && pattern="${pattern}0A" ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: [ "${protocol}" = "tcp" ] && pattern="${pattern}0A" In lib.sh line 641: if ip netns exec "${listener_ns}" awk '{print $2" "$4}' \ ^---------------^ SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. In lib.sh line 663: output=$(echo $output | jq -r $jq_opts "$jq_exp") ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: output=$(echo "$output" | jq -r "$jq_opts" "$jq_exp") In lib.sh line 668: echo $output ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "$output" In lib.sh line 670: [ ! -z "$output" ] ^-- SC2236 (style): Use -n instead of ! -z. For more information: https://www.shellcheck.net/wiki/SC1105 -- Shells disambiguate (( differentl... https://www.shellcheck.net/wiki/SC1007 -- Remove space after = if trying to... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...