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.pBynIC2gmM and /tmp/tmp.IRELlYJ5MA Tree base: 58bae918d73e ("Merge branch 'net-sched-teql-enforce-hierarchy-placement'") Now at: b222f01658dc ("selftests: net: amt: wait longer for connection before sending packets") ====== Checking before the patch ====== Checking tools/testing/selftests/net/amt.sh - d3851748df781e9b1d47393736f70f71071c94bb89b088f962d33658bb7a1241 In amt.sh line 76: readonly LISTENER=$(mktemp -u listener-XXXXXXXX) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 77: readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 78: readonly RELAY=$(mktemp -u relay-XXXXXXXX) ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 79: readonly SOURCE=$(mktemp -u source-XXXXXXXX) ^----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 80: readonly SMCROUTEDIR="$(mktemp -d)" ^---------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 90: smcpid=$(< $SMCROUTEDIR/amt.pid) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: smcpid=$(< "$SMCROUTEDIR"/amt.pid) In amt.sh line 91: kill $smcpid ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill "$smcpid" In amt.sh line 93: rm -rf $SMCROUTEDIR ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf "$SMCROUTEDIR" In amt.sh line 176: ip netns exec "${RELAY}" smcrouted -P $SMCROUTEDIR/amt.pid ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "${RELAY}" smcrouted -P "$SMCROUTEDIR"/amt.pid In amt.sh line 187: if [ $REMOTE == "\"10.0.0.2\"" ]; then ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$REMOTE" == "\"10.0.0.2\"" ]; then In amt.sh line 197: for i in `seq 10`; do ^------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Did you mean: for i in $(seq 10); do In amt.sh line 207: for i in `seq 10`; do ^-^ SC2034 (warning): i appears unused. Verify use (or export if used externally). ^------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Did you mean: for i in $(seq 10); do In amt.sh line 217: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. For more information: https://www.shellcheck.net/wiki/SC2034 -- i appears unused. Verify use (or ... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/amt.sh - d3851748df781e9b1d47393736f70f71071c94bb89b088f962d33658bb7a1241 In amt.sh line 78: readonly LISTENER=$(mktemp -u listener-XXXXXXXX) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 79: readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 80: readonly RELAY=$(mktemp -u relay-XXXXXXXX) ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 81: readonly SOURCE=$(mktemp -u source-XXXXXXXX) ^----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 82: readonly SMCROUTEDIR="$(mktemp -d)" ^---------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In amt.sh line 92: smcpid=$(< $SMCROUTEDIR/amt.pid) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: smcpid=$(< "$SMCROUTEDIR"/amt.pid) In amt.sh line 93: kill $smcpid ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill "$smcpid" In amt.sh line 95: rm -rf $SMCROUTEDIR ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf "$SMCROUTEDIR" In amt.sh line 178: ip netns exec "${RELAY}" smcrouted -P $SMCROUTEDIR/amt.pid ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip netns exec "${RELAY}" smcrouted -P "$SMCROUTEDIR"/amt.pid In amt.sh line 189: if [ $REMOTE == "\"10.0.0.2\"" ]; then ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$REMOTE" == "\"10.0.0.2\"" ]; then In amt.sh line 199: for i in `seq 10`; do ^------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Did you mean: for i in $(seq 10); do In amt.sh line 209: for i in `seq 10`; do ^------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`. Did you mean: for i in $(seq 10); do In amt.sh line 219: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In amt.sh line 252: wait_local_port_listen ${LISTENER} 4000 udp ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_local_port_listen "${LISTENER}" 4000 udp In amt.sh line 259: wait_local_port_listen ${LISTENER} 6000 udp ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_local_port_listen "${LISTENER}" 6000 udp For more information: https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...