Patch "selftests: mptcp: join: fix ShellCheck warnings" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests: mptcp: join: fix ShellCheck warnings

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-mptcp-join-fix-shellcheck-warnings.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 0fcd72df8847d3a62eb34a084862157ce0564a94 Mon Sep 17 00:00:00 2001
From: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx>
Date: Fri, 14 Apr 2023 17:47:10 +0200
Subject: selftests: mptcp: join: fix ShellCheck warnings

From: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx>

commit 0fcd72df8847d3a62eb34a084862157ce0564a94 upstream.

Most of the code had an issue according to ShellCheck.

That's mainly due to the fact it incorrectly believes most of the code
was unreachable because it's invoked by variable name, see how the
"tests" array is used.

Once SC2317 has been ignored, three small warnings were still visible:

 - SC2155: Declare and assign separately to avoid masking return values.

 - SC2046: Quote this to prevent word splitting: can be ignored because
   "ip netns pids" can display more than one pid.

 - SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

This probably didn't fix any actual issues but it might help spotting
new interesting warnings reported by ShellCheck as just before,
ShellCheck was reporting issues for most lines making it a bit useless.

Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -8,6 +8,10 @@
 
 . "$(dirname "${0}")/mptcp_lib.sh"
 
+# 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
+
 ret=0
 sin=""
 sinfail=""
@@ -357,8 +361,9 @@ check_transfer()
 
 	local line
 	if [ -n "$bytes" ]; then
+		local out_size
 		# when truncating we must check the size explicitly
-		local out_size=$(wc -c $out | awk '{print $1}')
+		out_size=$(wc -c $out | awk '{print $1}')
 		if [ $out_size -ne $bytes ]; then
 			echo "[ FAIL ] $what output file has wrong size ($out_size, $bytes)"
 			fail_test
@@ -487,6 +492,7 @@ kill_wait()
 
 kill_tests_wait()
 {
+	#shellcheck disable=SC2046
 	kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1)
 	wait
 }
@@ -1726,7 +1732,7 @@ chk_subflow_nr()
 
 	cnt1=$(ss -N $ns1 -tOni | grep -c token)
 	cnt2=$(ss -N $ns2 -tOni | grep -c token)
-	if [ "$cnt1" != "$subflow_nr" -o "$cnt2" != "$subflow_nr" ]; then
+	if [ "$cnt1" != "$subflow_nr" ] || [ "$cnt2" != "$subflow_nr" ]; then
 		echo "[fail] got $cnt1:$cnt2 subflows expected $subflow_nr"
 		fail_test
 		dump_stats=1


Patches currently in stable-queue which might be from matthieu.baerts@xxxxxxxxxxxx are

queue-6.1/selftests-mptcp-join-fix-shellcheck-warnings.patch
queue-6.1/selftests-mptcp-join-support-rm_addr-for-used-endpoints-or-not.patch
queue-6.1/selftests-mptcp-pm-nl-skip-fullmesh-flag-checks-if-not-supported.patch
queue-6.1/selftests-mptcp-lib-skip-if-missing-symbol.patch
queue-6.1/selftests-mptcp-join-skip-fullmesh-flag-tests-if-not-supported.patch
queue-6.1/selftests-mptcp-join-skip-fastclose-tests-if-not-supported.patch
queue-6.1/selftests-mptcp-remove-duplicated-entries-in-usage.patch
queue-6.1/selftests-mptcp-sockopt-skip-getsockopt-checks-if-not-supported.patch
queue-6.1/selftests-mptcp-join-skip-backup-if-set-flag-on-id-not-supported.patch
queue-6.1/selftests-mptcp-userspace-pm-skip-if-ip-tool-is-unavailable.patch
queue-6.1/selftests-mptcp-join-helpers-to-skip-tests.patch
queue-6.1/selftests-mptcp-lib-skip-if-not-below-kernel-version.patch
queue-6.1/selftests-mptcp-userspace-pm-skip-if-not-supported.patch
queue-6.1/selftests-mptcp-join-skip-implicit-tests-if-not-supported.patch
queue-6.1/selftests-mptcp-sockopt-relax-expected-returned-size.patch
queue-6.1/selftests-mptcp-pm-nl-remove-hardcoded-default-limits.patch
queue-6.1/selftests-mptcp-join-skip-check-if-mib-counter-not-supported.patch
queue-6.1/selftests-mptcp-join-use-iptables-legacy-if-available.patch
queue-6.1/selftests-mptcp-join-support-local-endpoint-being-tracked-or-not.patch
queue-6.1/selftests-mptcp-connect-skip-transp-tests-if-not-supported.patch
queue-6.1/selftests-mptcp-join-skip-mpc-backups-tests-if-not-supported.patch
queue-6.1/selftests-mptcp-connect-skip-disconnect-tests-if-not-supported.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux