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.6nX543RHix and /tmp/tmp.HTP2WmOiWP Tree base: 990300b1fe9b ("selftests: hsr: Check duplicates on HSR with VLAN") Now at: dd1157ebec22 ("selftests: hsr: Add tests for faulty links") ====== Checking before the patch ====== Checking tools/testing/selftests/net/hsr/hsr_ping.sh - 5293a5cd9ad2d3974447f3107cee3aaec92822c2a0453c8aa65339049c431fdf In hsr_ping.sh line 17: usage $0 ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: usage "$0" In hsr_ping.sh line 24: usage $0 ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: usage "$0" In hsr_ping.sh line 38: do_ping "$ns1" 100.64.$netid.2 ^--^ SC2154 (warning): ns1 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" 100.64."$netid".2 In hsr_ping.sh line 39: do_ping "$ns1" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" 100.64."$netid".3 In hsr_ping.sh line 40: do_ping "$ns2" 100.64.$netid.1 ^--^ SC2154 (warning): ns2 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" 100.64."$netid".1 In hsr_ping.sh line 41: do_ping "$ns2" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" 100.64."$netid".3 In hsr_ping.sh line 42: do_ping "$ns3" 100.64.$netid.1 ^--^ SC2154 (warning): ns3 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" 100.64."$netid".1 In hsr_ping.sh line 43: do_ping "$ns3" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" 100.64."$netid".2 In hsr_ping.sh line 46: do_ping "$ns1" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" dead:beef:"$netid"::2 In hsr_ping.sh line 47: do_ping "$ns1" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" dead:beef:"$netid"::3 In hsr_ping.sh line 48: do_ping "$ns2" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" dead:beef:"$netid"::1 In hsr_ping.sh line 49: do_ping "$ns2" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" dead:beef:"$netid"::2 In hsr_ping.sh line 50: do_ping "$ns3" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" dead:beef:"$netid"::1 In hsr_ping.sh line 51: do_ping "$ns3" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" dead:beef:"$netid"::2 In hsr_ping.sh line 62: if [ $? -ne 0 ] ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In hsr_ping.sh line 67: let "WAIT = WAIT - 1" ^------------------^ SC2219 (style): Instead of 'let expr', prefer (( expr )) . In hsr_ping.sh line 74: do_ping_long "$ns1" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" 100.64."$netid".2 In hsr_ping.sh line 75: do_ping_long "$ns1" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" dead:beef:"$netid"::2 In hsr_ping.sh line 76: do_ping_long "$ns1" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" 100.64."$netid".3 In hsr_ping.sh line 77: do_ping_long "$ns1" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" dead:beef:"$netid"::3 In hsr_ping.sh line 80: do_ping_long "$ns2" 100.64.$netid.1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" 100.64."$netid".1 In hsr_ping.sh line 81: do_ping_long "$ns2" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" dead:beef:"$netid"::1 In hsr_ping.sh line 82: do_ping_long "$ns2" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" 100.64."$netid".3 In hsr_ping.sh line 83: do_ping_long "$ns2" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" dead:beef:"$netid"::3 In hsr_ping.sh line 86: do_ping_long "$ns3" 100.64.$netid.1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" 100.64."$netid".1 In hsr_ping.sh line 87: do_ping_long "$ns3" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" dead:beef:"$netid"::1 In hsr_ping.sh line 88: do_ping_long "$ns3" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" 100.64."$netid".2 In hsr_ping.sh line 89: do_ping_long "$ns3" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" dead:beef:"$netid"::2 In hsr_ping.sh line 146: ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version "$HSRv" proto 0 In hsr_ping.sh line 147: ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version "$HSRv" proto 0 In hsr_ping.sh line 148: ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version "$HSRv" proto 0 For more information: https://www.shellcheck.net/wiki/SC2154 -- ns1 is referenced but not assigned. https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2181 -- Check exit code directly with e.g... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/hsr/hsr_ping.sh - 5293a5cd9ad2d3974447f3107cee3aaec92822c2a0453c8aa65339049c431fdf In hsr_ping.sh line 17: usage $0 ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: usage "$0" In hsr_ping.sh line 24: usage $0 ^-- SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: usage "$0" In hsr_ping.sh line 38: do_ping "$ns1" 100.64.$netid.2 ^--^ SC2154 (warning): ns1 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" 100.64."$netid".2 In hsr_ping.sh line 39: do_ping "$ns1" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" 100.64."$netid".3 In hsr_ping.sh line 40: do_ping "$ns2" 100.64.$netid.1 ^--^ SC2154 (warning): ns2 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" 100.64."$netid".1 In hsr_ping.sh line 41: do_ping "$ns2" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" 100.64."$netid".3 In hsr_ping.sh line 42: do_ping "$ns3" 100.64.$netid.1 ^--^ SC2154 (warning): ns3 is referenced but not assigned. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" 100.64."$netid".1 In hsr_ping.sh line 43: do_ping "$ns3" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" 100.64."$netid".2 In hsr_ping.sh line 46: do_ping "$ns1" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" dead:beef:"$netid"::2 In hsr_ping.sh line 47: do_ping "$ns1" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns1" dead:beef:"$netid"::3 In hsr_ping.sh line 48: do_ping "$ns2" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" dead:beef:"$netid"::1 In hsr_ping.sh line 49: do_ping "$ns2" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns2" dead:beef:"$netid"::2 In hsr_ping.sh line 50: do_ping "$ns3" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" dead:beef:"$netid"::1 In hsr_ping.sh line 51: do_ping "$ns3" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping "$ns3" dead:beef:"$netid"::2 In hsr_ping.sh line 62: if [ $? -ne 0 ] ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In hsr_ping.sh line 67: let "WAIT = WAIT - 1" ^------------------^ SC2219 (style): Instead of 'let expr', prefer (( expr )) . In hsr_ping.sh line 74: do_ping_long "$ns1" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" 100.64."$netid".2 In hsr_ping.sh line 75: do_ping_long "$ns1" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" dead:beef:"$netid"::2 In hsr_ping.sh line 76: do_ping_long "$ns1" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" 100.64."$netid".3 In hsr_ping.sh line 77: do_ping_long "$ns1" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns1" dead:beef:"$netid"::3 In hsr_ping.sh line 80: do_ping_long "$ns2" 100.64.$netid.1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" 100.64."$netid".1 In hsr_ping.sh line 81: do_ping_long "$ns2" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" dead:beef:"$netid"::1 In hsr_ping.sh line 82: do_ping_long "$ns2" 100.64.$netid.3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" 100.64."$netid".3 In hsr_ping.sh line 83: do_ping_long "$ns2" dead:beef:$netid::3 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns2" dead:beef:"$netid"::3 In hsr_ping.sh line 86: do_ping_long "$ns3" 100.64.$netid.1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" 100.64."$netid".1 In hsr_ping.sh line 87: do_ping_long "$ns3" dead:beef:$netid::1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" dead:beef:"$netid"::1 In hsr_ping.sh line 88: do_ping_long "$ns3" 100.64.$netid.2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" 100.64."$netid".2 In hsr_ping.sh line 89: do_ping_long "$ns3" dead:beef:$netid::2 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: do_ping_long "$ns3" dead:beef:"$netid"::2 In hsr_ping.sh line 135: ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns1" link add name hsr1 type hsr slave1 ns1eth1 slave2 ns1eth2 supervision 45 version "$HSRv" proto 0 In hsr_ping.sh line 136: ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns2" link add name hsr2 type hsr slave1 ns2eth1 slave2 ns2eth2 supervision 45 version "$HSRv" proto 0 In hsr_ping.sh line 137: ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version $HSRv proto 0 ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$ns3" link add name hsr3 type hsr slave1 ns3eth1 slave2 ns3eth2 supervision 45 version "$HSRv" proto 0 For more information: https://www.shellcheck.net/wiki/SC2154 -- ns1 is referenced but not assigned. https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2181 -- Check exit code directly with e.g... Checking tools/testing/selftests/net/hsr/link_faults.sh - 77a351b1f35657858e31b0b6867e4b13a5f8a4ee9b8ea2061f02159dca6f12c9 In link_faults.sh line 18: setup_hsr_topo() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 39: ip link add vethA netns "$node1" type veth peer name vethB netns "$node2" ^----^ SC2154 (warning): node1 is referenced but not assigned (did you mean 'node'?). ^----^ SC2154 (warning): node2 is referenced but not assigned (did you mean 'node'?). In link_faults.sh line 40: ip link add vethA netns "$node2" type veth peer name vethB netns "$node3" ^----^ SC2154 (warning): node3 is referenced but not assigned (did you mean 'node'?). In link_faults.sh line 54: ip -net "$node1" link add name hsr1 type hsr proto 0 version $ver slave1 vethA slave2 vethB supervision 45 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$node1" link add name hsr1 type hsr proto 0 version "$ver" slave1 vethA slave2 vethB supervision 45 In link_faults.sh line 55: ip -net "$node2" link add name hsr2 type hsr proto 0 version $ver slave1 vethA slave2 vethB supervision 45 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$node2" link add name hsr2 type hsr proto 0 version "$ver" slave1 vethA slave2 vethB supervision 45 In link_faults.sh line 56: ip -net "$node3" link add name hsr3 type hsr proto 0 version $ver slave1 vethA slave2 vethB supervision 45 ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip -net "$node3" link add name hsr3 type hsr proto 0 version "$ver" slave1 vethA slave2 vethB supervision 45 In link_faults.sh line 77: setup_prp_topo() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 115: wait_for_hsr_node_table() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 119: while [ ${WAIT} -gt 0 ]; do ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: while [ "${WAIT}" -gt 0 ]; do In link_faults.sh line 124: !(echo "$nts" | grep -q "00:00:00:00:00:00"); then ^-- SC1035 (error): You are missing a required space after the !. In link_faults.sh line 134: setup_topo() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 151: check_ping() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 158: output=$(LANG=C ip netns exec "$node" ping $ping_args "$dst" | grep "packets transmitted") ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: output=$(LANG=C ip netns exec "$node" ping "$ping_args" "$dst" | grep "packets transmitted") In link_faults.sh line 167: tx="${BASH_REMATCH[1]}" ^-- SC2034 (warning): tx appears unused. Verify use (or export if used externally). In link_faults.sh line 170: rx="${BASH_REMATCH[1]}" ^-- SC2034 (warning): rx appears unused. Verify use (or export if used externally). In link_faults.sh line 185: test_clean() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 190: tname="${FUNCNAME} - ${proto}" ^---------^ SC2128 (warning): Expanding an array without an index only gives the first element. In link_faults.sh line 203: test_clean_hsrv0() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 208: test_clean_hsrv1() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 213: test_clean_prp() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 218: test_cut_link() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 223: tname="${FUNCNAME} - ${proto}" ^---------^ SC2128 (warning): Expanding an array without an index only gives the first element. In link_faults.sh line 245: test_cut_link_hsrv0() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 250: test_cut_link_hsrv1() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 255: test_cut_link_prp() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In link_faults.sh line 260: cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). For more information: https://www.shellcheck.net/wiki/SC1035 -- You are missing a required space ... https://www.shellcheck.net/wiki/SC2034 -- rx appears unused. Verify use (or... https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...