Netdev List
 help / color / mirror / Atom feed
* [PATCHv2 net] selftests: pmtu.sh: fix result checking
@ 2023-10-31  3:47 Hangbin Liu
  2023-10-31  4:41 ` Po-Hsu Lin
  2023-11-03  9:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Hangbin Liu @ 2023-10-31  3:47 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Shuah Khan, David Ahern, linux-kselftest, Po-Hsu Lin, Hangbin Liu

In the PMTU test, when all previous tests are skipped and the new test
passes, the exit code is set to 0. However, the current check mistakenly
treats this as an assignment, causing the check to pass every time.

Consequently, regardless of how many tests have failed, if the latest test
passes, the PMTU test will report a pass.

Fixes: 2a9d3716b810 ("selftests: pmtu.sh: improve the test result processing")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
v2: use "-eq" instead of "=" to make less error-prone
---
 tools/testing/selftests/net/pmtu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index f838dd370f6a..b3b2dc5a630c 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -2048,7 +2048,7 @@ run_test() {
 	case $ret in
 		0)
 			all_skipped=false
-			[ $exitcode=$ksft_skip ] && exitcode=0
+			[ $exitcode -eq $ksft_skip ] && exitcode=0
 		;;
 		$ksft_skip)
 			[ $all_skipped = true ] && exitcode=$ksft_skip
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-03  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31  3:47 [PATCHv2 net] selftests: pmtu.sh: fix result checking Hangbin Liu
2023-10-31  4:41 ` Po-Hsu Lin
2023-11-03  9:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox