selftests: mptcp: diag: fix shellcheck warnings
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Wed, 6 Mar 2024 09:42:56 +0000 (10:42 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Mar 2024 05:06:52 +0000 (21:06 -0800)
commit97633aa74d93cefabc0943f6b0d4cfdeb39177cf
treeb6247e6d9099782ad6617604391eeb2f2364977b
parent35bc143a8514ee72b2e9d6b8b385468608b93a53
selftests: mptcp: diag: fix shellcheck warnings

shellcheck recently helped to prevent issues. It is then good to fix the
other harmless issues in order to spot "real" ones later.

Here, two categories of warnings are now ignored:

- SC2317: Command appears to be unreachable. The cleanup() function is
  invoked indirectly via the EXIT trap.

- SC2086: Double quote to prevent globbing and word splitting. This is
  recommended, but the current usage is correct and there is no need to
  do all these modifications to be compliant with this rule.

For the modifications:

  - SC2034: ksft_skip appears unused.
  - SC2046: Quote '$(get_msk_inuse)' to prevent word splitting.
  - SC2006: Use $(...) notation instead of legacy backticks `...`.

Now this script is shellcheck (0.9.0) compliant. We can easily spot new
issues.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240306-upstream-net-next-20240304-selftests-mptcp-shared-code-shellcheck-v2-7-bc79e6e5e6a0@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/diag.sh