diff mbox series

[mptcp-next] Squash to "selftests: mptcp: print test results with colors"

Message ID 6f47bafed58fcc6fd3236b12134b23ff012d5643.1709791100.git.tanggeliang@kylinos.cn (mailing list archive)
State Accepted, archived
Commit 346ae0576b559cdaa29fcb1614b66bb7aad71357
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next] Squash to "selftests: mptcp: print test results with colors" | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
matttbe/shellcheck success No ShellCheck issues
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ fail Script error! ❓
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅

Commit Message

Geliang Tang March 7, 2024, 5:58 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

_printf is dropped now, use mptcp_lib_pr_fail instead.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

MPTCP CI March 7, 2024, 6:47 a.m. UTC | #1
Hi Geliang,

Thank you for your modifications, that's great!

Our CI (GitHub Action) did some validations and here is its report:

- KVM Validation: normal:
  - Success! ✅:
  - Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8183741163

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/b5adaaf15cb4


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
MPTCP CI March 7, 2024, 7:04 a.m. UTC | #2
Hi Geliang,

Thank you for your modifications, that's great!

Our CI (Cirrus) did some validations with a debug kernel and here is its report:

- KVM Validation: debug (except selftest_mptcp_join):
  - Script error! ❓:
  - Task: https://cirrus-ci.com/task/5071392522108928
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5071392522108928/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6197292428951552
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6197292428951552/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/b5adaaf15cb4


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Matthieu Baerts March 7, 2024, 9:35 a.m. UTC | #3
Hi Geliang,

On 07/03/2024 06:58, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> _printf is dropped now, use mptcp_lib_pr_fail instead.

Good catch.

> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> index 9fc9e574bc27..30652a1c548b 100755
> --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> @@ -242,8 +242,7 @@ check_expected_one()
>  		test_fail
>  	fi
>  
> -	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
> -		"${var}" "${!exp}" "${!var}"
> +	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."

Maybe best to use 'mptcp_lib_print_err()' instead?
Because a "[FAIL]" will already be printed via test_fail() called just
above.

I will apply this patch with mptcp_lib_print_err instead. Please tell me
if it's not OK.

>  	return 1
>  }
>  

Cheers,
Matt
Geliang Tang March 7, 2024, 9:49 a.m. UTC | #4
Hi Matt,

On Thu, Mar 07, 2024 at 10:35:43AM +0100, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 07/03/2024 06:58, Geliang Tang wrote:
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > _printf is dropped now, use mptcp_lib_pr_fail instead.
> 
> Good catch.
> 
> > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> > ---
> >  tools/testing/selftests/net/mptcp/userspace_pm.sh | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > index 9fc9e574bc27..30652a1c548b 100755
> > --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
> > @@ -242,8 +242,7 @@ check_expected_one()
> >  		test_fail
> >  	fi
> >  
> > -	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
> > -		"${var}" "${!exp}" "${!var}"
> > +	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."
> 
> Maybe best to use 'mptcp_lib_print_err()' instead?
> Because a "[FAIL]" will already be printed via test_fail() called just
> above.
> 
> I will apply this patch with mptcp_lib_print_err instead. Please tell me
> if it's not OK.

Yes, mptcp_lib_print_err is much better.

Thanks,
-Geliang

> 
> >  	return 1
> >  }
> >  
> 
> Cheers,
> Matt
> -- 
> Sponsored by the NGI0 Core fund.
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh
index 9fc9e574bc27..30652a1c548b 100755
--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh
+++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh
@@ -242,8 +242,7 @@  check_expected_one()
 		test_fail
 	fi
 
-	_printf "\tExpected value for '%s': '%s', got '%s'.\n" \
-		"${var}" "${!exp}" "${!var}"
+	mptcp_lib_pr_fail "Expected value for '${var}': '${!exp}', got '${!var}'."
 	return 1
 }