Thread (11 messages) 11 messages, 3 authors, 2025-02-28

Re: [PATCH v2 1/3] selftests/net: have `gro.sh -t` return a correct exit code

flat view

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2025-02-27 21:31:18
Also in: linux-kselftest, lkml

Kevin Krakauer wrote:
On Thu, Feb 27, 2025 at 11:20:15AM -0500, Willem de Bruijn wrote:
quoted
quoted
---
 tools/testing/selftests/net/gro.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/gro.sh b/tools/testing/selftests/net/gro.sh
index 02c21ff4ca81..aabd6e5480b8 100755
--- a/tools/testing/selftests/net/gro.sh
+++ b/tools/testing/selftests/net/gro.sh
@@ -100,5 +100,6 @@ trap cleanup EXIT
 if [[ "${test}" == "all" ]]; then
   run_all_tests
 else
-  run_test "${proto}" "${test}"
+  exit_code=$(run_test "${proto}" "${test}")
+  exit $exit_code
 fi;
This is due to run_test ending with echo ${exit_code}, which itself
always succeeds. Rather than the actual exit_code of the process it
ran, right?

It looks a bit odd, but this is always how run_all_tests uses
run_test.
Yep. I could change this to use exit codes and $? if that's desirable,
but IME using echo to return is fairly common.
Thanks. No need to change it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help