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.Rw7Xfn7Nwk and /tmp/tmp.L72oidMeHF Tree base: 550459411de9 ("net/sched: ets: use old 'nbands' while purging unused classes") Now at: b81cb3dba06e ("selftests: net/forwarding: test purge of active DWRR classes") ====== Checking before the patch ====== Checking tools/testing/selftests/net/forwarding/sch_ets.sh - 4a8e6f16a92b74b5ea86a47bf8bbfbbf1494b6b5fe47b7d57ab8263c4537206b In sch_ets.sh line 25: tc qdisc add dev $swp2 root handle 1: tbf \ ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc qdisc add dev "$swp2" root handle 1: tbf \ In sch_ets.sh line 27: defer tc qdisc del dev $swp2 root ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: defer tc qdisc del dev "$swp2" root In sch_ets.sh line 37: for stream in ${streams[@]}; do ^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets.sh line 38: qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: qdisc_parent_stats_get "$swp2" 10:$((stream + 1)) .bytes For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Checking tools/testing/selftests/net/forwarding/sch_ets_tests.sh - 180cc78dc7c4fabe309106874b7113445b7abf9ae7c7a09c6453c8390aa0a39f In sch_ets_tests.sh line 1: # SPDX-License-Identifier: GPL-2.0 ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In sch_ets_tests.sh line 46: RET=0 ^-^ SC2034 (warning): RET appears unused. Verify use (or export if used externally). In sch_ets_tests.sh line 54: local ratio=$(echo "scale=2; 100 * $d / $total" | bc -l) ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 56: test $(echo "$ratio > 95.0" | bc -l) -eq 1 ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. In sch_ets_tests.sh line 61: test $(echo "$ratio < 5" | bc -l) -eq 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. In sch_ets_tests.sh line 89: echo "Testing $(qdisc_describe), streams ${streams[@]}" ^-----------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. In sch_ets_tests.sh line 91: for stream in ${streams[@]}; do ^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets_tests.sh line 92: ets_start_traffic $stream ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_start_traffic "$stream" In sch_ets_tests.sh line 98: t0=($(collect_stats "${streams[@]}")) ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 102: t1=($(collect_stats "${streams[@]}")) ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 103: d=($(for ((i = 0; i < ${#streams[@]}; i++)); do ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 106: total=$(echo ${d[@]} | sed 's/ /+/g' | bc) ^-----^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets_tests.sh line 111: notraf_eval "band $stream" ${d[$i]} $total ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: notraf_eval "band $stream" "${d[$i]}" "$total" In sch_ets_tests.sh line 113: strict_eval "band $stream" ${d[$i]} $total ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: strict_eval "band $stream" "${d[$i]}" "$total" In sch_ets_tests.sh line 120: ${WS[$low_stream]} ${WS[$stream]} \ ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${WS[$low_stream]}" "${WS[$stream]}" \ In sch_ets_tests.sh line 121: ${d[0]} ${d[$i]} ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${d[0]}" "${d[$i]}" In sch_ets_tests.sh line 152: local nstreams=$(if ((nbands > 3)); then echo 3; else echo $nbands; fi) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 153: local priomap=$(seq 0 $((nstreams - 1))) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 156: WS=($( ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 161: echo ${quanta[$i]} ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "${quanta[$i]}" In sch_ets_tests.sh line 165: ets_change_qdisc $dev $nstrict "$priomap" ${quanta[@]} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. Did you mean: ets_change_qdisc "$dev" "$nstrict" "$priomap" ${quanta[@]} In sch_ets_tests.sh line 170: ets_qdisc_setup $put 0 3300 3300 3300 ^--^ SC2154 (warning): put is referenced but not assigned. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 3300 3300 3300 In sch_ets_tests.sh line 175: ets_qdisc_setup $put 0 5000 3500 1500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 5000 3500 1500 In sch_ets_tests.sh line 180: ets_qdisc_setup $put 3 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 3 In sch_ets_tests.sh line 185: ets_qdisc_setup $put 1 5000 2500 1500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 1 5000 2500 1500 In sch_ets_tests.sh line 190: tc class change dev $put classid 10:2 ets quantum 8000 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc class change dev "$put" classid 10:2 ets quantum 8000 In sch_ets_tests.sh line 196: ets_qdisc_setup $put 0 5000 2500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 5000 2500 For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ... https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/forwarding/sch_ets.sh - 4a8e6f16a92b74b5ea86a47bf8bbfbbf1494b6b5fe47b7d57ab8263c4537206b In sch_ets.sh line 26: tc qdisc add dev $swp2 root handle 1: tbf \ ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc qdisc add dev "$swp2" root handle 1: tbf \ In sch_ets.sh line 28: defer tc qdisc del dev $swp2 root ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: defer tc qdisc del dev "$swp2" root In sch_ets.sh line 38: for stream in ${streams[@]}; do ^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets.sh line 39: qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: qdisc_parent_stats_get "$swp2" 10:$((stream + 1)) .bytes For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Checking tools/testing/selftests/net/forwarding/sch_ets_tests.sh - 180cc78dc7c4fabe309106874b7113445b7abf9ae7c7a09c6453c8390aa0a39f In sch_ets_tests.sh line 1: # SPDX-License-Identifier: GPL-2.0 ^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. In sch_ets_tests.sh line 46: RET=0 ^-^ SC2034 (warning): RET appears unused. Verify use (or export if used externally). In sch_ets_tests.sh line 54: local ratio=$(echo "scale=2; 100 * $d / $total" | bc -l) ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 56: test $(echo "$ratio > 95.0" | bc -l) -eq 1 ^-----------------------------^ SC2046 (warning): Quote this to prevent word splitting. In sch_ets_tests.sh line 61: test $(echo "$ratio < 5" | bc -l) -eq 1 ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting. In sch_ets_tests.sh line 89: echo "Testing $(qdisc_describe), streams ${streams[@]}" ^-----------^ SC2145 (error): Argument mixes string and array. Use * or separate argument. In sch_ets_tests.sh line 91: for stream in ${streams[@]}; do ^-----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets_tests.sh line 92: ets_start_traffic $stream ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_start_traffic "$stream" In sch_ets_tests.sh line 98: t0=($(collect_stats "${streams[@]}")) ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 102: t1=($(collect_stats "${streams[@]}")) ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 103: d=($(for ((i = 0; i < ${#streams[@]}; i++)); do ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 106: total=$(echo ${d[@]} | sed 's/ /+/g' | bc) ^-----^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In sch_ets_tests.sh line 111: notraf_eval "band $stream" ${d[$i]} $total ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: notraf_eval "band $stream" "${d[$i]}" "$total" In sch_ets_tests.sh line 113: strict_eval "band $stream" ${d[$i]} $total ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: strict_eval "band $stream" "${d[$i]}" "$total" In sch_ets_tests.sh line 120: ${WS[$low_stream]} ${WS[$stream]} \ ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${WS[$low_stream]}" "${WS[$stream]}" \ In sch_ets_tests.sh line 121: ${d[0]} ${d[$i]} ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${d[0]}" "${d[$i]}" In sch_ets_tests.sh line 152: local nstreams=$(if ((nbands > 3)); then echo 3; else echo $nbands; fi) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 153: local priomap=$(seq 0 $((nstreams - 1))) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In sch_ets_tests.sh line 156: WS=($( ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting). In sch_ets_tests.sh line 161: echo ${quanta[$i]} ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "${quanta[$i]}" In sch_ets_tests.sh line 165: ets_change_qdisc $dev $nstrict "$priomap" ${quanta[@]} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. Did you mean: ets_change_qdisc "$dev" "$nstrict" "$priomap" ${quanta[@]} In sch_ets_tests.sh line 170: ets_qdisc_setup $put 0 3300 3300 3300 ^--^ SC2154 (warning): put is referenced but not assigned. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 3300 3300 3300 In sch_ets_tests.sh line 175: ets_qdisc_setup $put 0 5000 3500 1500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 5000 3500 1500 In sch_ets_tests.sh line 180: ets_qdisc_setup $put 3 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 3 In sch_ets_tests.sh line 185: ets_qdisc_setup $put 1 5000 2500 1500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 1 5000 2500 1500 In sch_ets_tests.sh line 190: tc class change dev $put classid 10:2 ets quantum 8000 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc class change dev "$put" classid 10:2 ets quantum 8000 In sch_ets_tests.sh line 196: ets_qdisc_setup $put 0 5000 2500 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 0 5000 2500 In sch_ets_tests.sh line 230: ets_change_qdisc $put 2 "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3" "1514 1514" ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_change_qdisc "$put" 2 "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3" "1514 1514" In sch_ets_tests.sh line 231: tc qdisc add dev $put handle 20: parent 10:4 plug ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: tc qdisc add dev "$put" handle 20: parent 10:4 plug In sch_ets_tests.sh line 232: start_traffic_pktsize 100 $h1.10 192.0.2.1 192.0.2.2 00:c1:a0:c1:a0:00 "-c 1" ^-^ SC2154 (warning): h1 is referenced but not assigned. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: start_traffic_pktsize 100 "$h1".10 192.0.2.1 192.0.2.2 00:c1:a0:c1:a0:00 "-c 1" In sch_ets_tests.sh line 233: ets_qdisc_setup $put 2 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ets_qdisc_setup "$put" 2 For more information: https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ... https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ... https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...