[PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_check_transfer"

Geliang Tang posted 1 patch 5 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/16b3bbadb28abcca8a16ac51c915b5b10085cf36.1700841412.git.geliang.tang@suse.com
Maintainers: Matthieu Baerts <matttbe@kernel.org>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_check_transfer"
Posted by Geliang Tang 5 months, 3 weeks ago
Keep consistency with other functions in mptcp_lib.sh.

Use KSFT_PASS and KSFT_FAIL.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
v2:
 - Use KSFT_PASS and KSFT_FAIL.
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 1f8be9dd0e20..4b30a9634f16 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -258,8 +258,7 @@ mptcp_lib_make_file() {
 }
 
 # $1: file
-mptcp_lib_print_file_err()
-{
+mptcp_lib_print_file_err() {
 	ls -l "${1}" 1>&2
 	echo "Trailing bytes are: "
 	tail -c 27 "${1}"
@@ -276,10 +275,10 @@ mptcp_lib_check_transfer() {
 		mptcp_lib_print_file_err "$in"
 		mptcp_lib_print_file_err "$out"
 
-		return 1
+		return ${KSFT_FAIL}
 	fi
 
-	return 0
+	return ${KSFT_PASS}
 }
 
 # $1: ns, $2: port
-- 
2.35.3
Re: [PATCH mptcp-next v2] Squash to "selftests: mptcp: add mptcp_lib_check_transfer"
Posted by Matthieu Baerts 5 months, 2 weeks ago
Hi Geliang,

On 24/11/2023 16:57, Geliang Tang wrote:
> Keep consistency with other functions in mptcp_lib.sh.

Good idea, thank you for the patch!

> Use KSFT_PASS and KSFT_FAIL.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> v2:
>  - Use KSFT_PASS and KSFT_FAIL.

In fact, I prefer and applied the v1: these KSFT_{PASS,FAIL,SKIP}
variables are the exit code we can use when using the selftests
framework. That's what we can pass to "exit", but I don't think it
doesn't really apply to function return code, and it is currently not
used for that.

New patches for t/upstream:
- 44d5ff2290a9: "squashed" in "selftests: mptcp: add
mptcp_lib_check_transfer"
- Results: d4787f01696d..1ee636354037 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20231127T175348

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.