tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New env var to force using colours.
Most CIs these days support colours in the serial but they will execute
scripts in a non interactive mode and colours will then not be displayed
by default. So we need a way to force displaying them when we are in
this mode:
SELFTESTS_MPTCP_LIB_COLOR_FORCE=1
Note that it is still possible to force disabling them if needed via the
standard NO_COLOR=1 env var way.
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
Notes:
to be squashed in "selftests: mptcp: join: colored results"
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 1080d5d2430b..92a5befe8039 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -10,8 +10,9 @@ readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g')
MPTCP_LIB_SUBTESTS=()
-# only if supported and not disabled, see no-color.org
-if [ -t 1 ] && [ "${NO_COLOR:-}" != "1" ]; then
+# only if supported (or forced) and not disabled, see no-color.org
+if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
+ [ "${NO_COLOR:-}" != "1" ]; then
readonly MPTCP_LIB_COLOR_RED="\E[1;31m"
readonly MPTCP_LIB_COLOR_GREEN="\E[1;32m"
readonly MPTCP_LIB_COLOR_YELLOW="\E[1;33m"
base-commit: 18d38b0f6b8f3d12bbd55c179b87d3ab014fef48
--
2.40.1
On Fri, 28 Jul 2023, Matthieu Baerts wrote:
> New env var to force using colours.
>
> Most CIs these days support colours in the serial but they will execute
> scripts in a non interactive mode and colours will then not be displayed
> by default. So we need a way to force displaying them when we are in
> this mode:
>
> SELFTESTS_MPTCP_LIB_COLOR_FORCE=1
>
> Note that it is still possible to force disabling them if needed via the
> standard NO_COLOR=1 env var way.
>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
>
> Notes:
> to be squashed in "selftests: mptcp: join: colored results"
>
Looks ok to squash, thanks Matthieu.
> tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> index 1080d5d2430b..92a5befe8039 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> @@ -10,8 +10,9 @@ readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g')
>
> MPTCP_LIB_SUBTESTS=()
>
> -# only if supported and not disabled, see no-color.org
> -if [ -t 1 ] && [ "${NO_COLOR:-}" != "1" ]; then
> +# only if supported (or forced) and not disabled, see no-color.org
> +if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
> + [ "${NO_COLOR:-}" != "1" ]; then
> readonly MPTCP_LIB_COLOR_RED="\E[1;31m"
> readonly MPTCP_LIB_COLOR_GREEN="\E[1;32m"
> readonly MPTCP_LIB_COLOR_YELLOW="\E[1;33m"
>
> base-commit: 18d38b0f6b8f3d12bbd55c179b87d3ab014fef48
> --
> 2.40.1
>
>
>
Hi Matthieu,
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):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5430554259095552
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5430554259095552/summary/summary.txt
- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4726866817318912
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4726866817318912/summary/summary.txt
- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5852766724161536
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5852766724161536/summary/summary.txt
- KVM Validation: normal (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6556454165938176
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6556454165938176/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/2db7493f2845
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 (Tessares)
© 2016 - 2026 Red Hat, Inc.