Commit ef1bd93b authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Jakub Kicinski
Browse files

selftests: mptcp: shellcheck: support v0.11.0



This v0.11.0 version introduces SC2329:

  Warn when (non-escaping) functions are never invoked.

Except that, similar to SC2317, ShellCheck is currently unable to figure
out functions that are invoked via trap, or indirectly, when calling
functions via variables. It is then needed to disable this new SC2329.

Reviewed-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250908-net-mptcp-misc-fixes-6-17-rc5-v1-3-5f2168a66079@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6f021e95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ flush_pids()
}

# This function is used in the cleanup trap
#shellcheck disable=SC2317
#shellcheck disable=SC2317,SC2329
cleanup()
{
	ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ ns4=""
TEST_GROUP=""

# This function is used in the cleanup trap
#shellcheck disable=SC2317
#shellcheck disable=SC2317,SC2329
cleanup()
{
	rm -f "$cin_disconnect"
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@

# ShellCheck incorrectly believes that most of the code here is unreachable
# because it's invoked by variable name, see how the "tests" array is used
#shellcheck disable=SC2317
#shellcheck disable=SC2317,SC2329

. "$(dirname "${0}")/mptcp_lib.sh"

+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ init()
}

# This function is used in the cleanup trap
#shellcheck disable=SC2317
#shellcheck disable=SC2317,SC2329
cleanup()
{
	mptcp_lib_ns_exit "${ns1}" "${ns2}" "${ns_sbox}"
+3 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ ns1=""
err=$(mktemp)

# This function is used in the cleanup trap
#shellcheck disable=SC2317
#shellcheck disable=SC2317,SC2329
cleanup()
{
	rm -f "${err}"
@@ -70,8 +70,9 @@ format_endpoints() {
	mptcp_lib_pm_nl_format_endpoints "${@}"
}

# This function is invoked indirectly
#shellcheck disable=SC2317,SC2329
get_endpoint() {
	# shellcheck disable=SC2317 # invoked indirectly
	mptcp_lib_pm_nl_get_endpoint "${ns1}" "${@}"
}

Loading