diff mbox series

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

Message ID 16b3bbadb28abcca8a16ac51c915b5b10085cf36.1700841412.git.geliang.tang@suse.com (mailing list archive)
State Accepted, archived
Commit 44d5ff2290a9ea30f5da338f6efa682ae45dc479
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next,v2] Squash to "selftests: mptcp: add mptcp_lib_check_transfer" | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ warning Unstable: 1 failed test(s): selftest_simult_flows
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅

Commit Message

Geliang Tang Nov. 24, 2023, 3:57 p.m. UTC
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(-)

Comments

MPTCP CI Nov. 24, 2023, 6:19 p.m. UTC | #1
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Unstable: 1 failed test(s): selftest_simult_flows 
Matthieu Baerts (NGI0) Nov. 27, 2023, 5:56 p.m. UTC | #2
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
diff mbox series

Patch

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