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.SVqd9yjJli and /tmp/tmp.jCsaZlVZIu Tree base: 2653e51fa5ee ("nsim: Add support for VLAN filters") Now at: aca9a4cca7f7 ("selftests: Add macsec offload VLAN tests") ====== Checking before the patch ====== Checking tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh - 96396ff6ab6bdd3c996088938f8cfa96ad87ac1a24714cc19d3162809b71da2e In ethtool-common.sh line 31: if [ $code $cop 0 ]; then ^-- SC1009 (info): The mentioned syntax error was in this if expression. ^-- SC1073 (error): Couldn't parse this test expression. Fix to allow more checks. ^-- SC1072 (error): Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again. For more information: https://www.shellcheck.net/wiki/SC1072 -- Expected test to end here (don't ... https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi... https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in... Checking tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh - d7c076f3dce2185860296c7ae81d57cf894317635df9ce6dae2554f7f7f89409 In macsec-offload.sh line 4: source ethtool-common.sh ^---------------^ SC1094 (warning): Parsing of sourced file failed. Ignoring it. In macsec-offload.sh line 11: if ! ethtool -k $NSIM_NETDEV | grep -q 'macsec-hw-offload: on'; then ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ethtool -k "$NSIM_NETDEV" | grep -q 'macsec-hw-offload: on'; then In macsec-offload.sh line 16: if ! ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac 2>/dev/null; then ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec offload mac 2>/dev/null; then In macsec-offload.sh line 26: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}" type macsec port 4 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}" type macsec port 4 offload mac In macsec-offload.sh line 29: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}2" type macsec address "aa:bb:cc:dd:ee:ff" port 5 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}2" type macsec address "aa:bb:cc:dd:ee:ff" port 5 offload mac In macsec-offload.sh line 32: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}3" type macsec sci abbacdde01020304 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}3" type macsec sci abbacdde01020304 offload mac In macsec-offload.sh line 35: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}4" type macsec port 8 offload mac 2> /dev/null ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}4" type macsec port 8 offload mac 2> /dev/null In macsec-offload.sh line 73: ip link del $dev ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link del "$dev" In macsec-offload.sh line 82: ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec offload mac In macsec-offload.sh line 92: check $? ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. In macsec-offload.sh line 96: ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec In macsec-offload.sh line 101: check $? ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. In macsec-offload.sh line 111: if [ $num_errors -eq 0 ]; then ^---------^ SC2154 (warning): num_errors is referenced but not assigned. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$num_errors" -eq 0 ]; then In macsec-offload.sh line 112: echo "PASSED all $((num_passes)) checks" ^--------^ SC2154 (warning): num_passes is referenced but not assigned. For more information: https://www.shellcheck.net/wiki/SC1094 -- Parsing of sourced file failed. I... https://www.shellcheck.net/wiki/SC2154 -- num_errors is referenced but not ... https://www.shellcheck.net/wiki/SC2319 -- This $? refers to a condition, no... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh - 96396ff6ab6bdd3c996088938f8cfa96ad87ac1a24714cc19d3162809b71da2e In ethtool-common.sh line 31: if [ $code $cop 0 ]; then ^-- SC1009 (info): The mentioned syntax error was in this if expression. ^-- SC1073 (error): Couldn't parse this test expression. Fix to allow more checks. ^-- SC1072 (error): Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again. For more information: https://www.shellcheck.net/wiki/SC1072 -- Expected test to end here (don't ... https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi... https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in... Checking tools/testing/selftests/drivers/net/netdevsim/macsec-offload.sh - d7c076f3dce2185860296c7ae81d57cf894317635df9ce6dae2554f7f7f89409 In macsec-offload.sh line 4: source ethtool-common.sh ^---------------^ SC1094 (warning): Parsing of sourced file failed. Ignoring it. In macsec-offload.sh line 11: if ! ethtool -k $NSIM_NETDEV | grep -q 'macsec-hw-offload: on'; then ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ethtool -k "$NSIM_NETDEV" | grep -q 'macsec-hw-offload: on'; then In macsec-offload.sh line 16: if ! ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac 2>/dev/null; then ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec offload mac 2>/dev/null; then In macsec-offload.sh line 26: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}" type macsec port 4 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}" type macsec port 4 offload mac In macsec-offload.sh line 29: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}2" type macsec address "aa:bb:cc:dd:ee:ff" port 5 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}2" type macsec address "aa:bb:cc:dd:ee:ff" port 5 offload mac In macsec-offload.sh line 32: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}3" type macsec sci abbacdde01020304 offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}3" type macsec sci abbacdde01020304 offload mac In macsec-offload.sh line 35: ip link add link $NSIM_NETDEV "${MACSEC_NETDEV}4" type macsec port 8 offload mac 2> /dev/null ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" "${MACSEC_NETDEV}4" type macsec port 8 offload mac 2> /dev/null In macsec-offload.sh line 73: ip link del $dev ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link del "$dev" In macsec-offload.sh line 82: ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec offload mac In macsec-offload.sh line 92: check $? ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. In macsec-offload.sh line 96: ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec In macsec-offload.sh line 101: check $? ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. In macsec-offload.sh line 133: if [ -f $VLAN_DFS ]; then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ -f "$VLAN_DFS" ]; then In macsec-offload.sh line 134: ip link add link $NSIM_NETDEV $MACSEC_NETDEV type macsec offload mac ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" $MACSEC_NETDEV type macsec offload mac In macsec-offload.sh line 141: ip link add link $NSIM_NETDEV ${MACSEC_NETDEV}2 type macsec port 5 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link add link "$NSIM_NETDEV" ${MACSEC_NETDEV}2 type macsec port 5 In macsec-offload.sh line 146: check $? || echo "VID 20 should NOT be on $MACSEC_NETDEV2 with offload OFF" ^-------------^ SC2153 (info): Possible misspelling: MACSEC_NETDEV2 may not be assigned. Did you mean MACSEC_NETDEV? In macsec-offload.sh line 170: if [ $num_errors -eq 0 ]; then ^---------^ SC2154 (warning): num_errors is referenced but not assigned. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$num_errors" -eq 0 ]; then In macsec-offload.sh line 171: echo "PASSED all $((num_passes)) checks" ^--------^ SC2154 (warning): num_passes is referenced but not assigned. For more information: https://www.shellcheck.net/wiki/SC1094 -- Parsing of sourced file failed. I... https://www.shellcheck.net/wiki/SC2154 -- num_errors is referenced but not ... https://www.shellcheck.net/wiki/SC2319 -- This $? refers to a condition, no...