* [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier
@ 2026-05-15 2:11 Matthieu Baerts (NGI0)
2026-05-15 3:19 ` MPTCP CI
2026-05-15 3:59 ` Matthieu Baerts
0 siblings, 2 replies; 4+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-15 2:11 UTC (permalink / raw)
To: MPTCP Linux; +Cc: Matthieu Baerts (NGI0)
Using the format specifier +%s%3N with GNU date is honoured, and only
prints 3 digits of the nanoseconds portion of the seconds since epoch,
which corresponds to the milliseconds.
The uutils implementation of date currently does not honour this, and
always prints all 9 digits. This is a known issue [1], but can be worked
around by adapting this test to use nanoseconds instead of microseconds,
and then divide it by 1e6.
This fix is similar to what has been done on systemd side [2].
Link: https://github.com/uutils/coreutils/issues/11658 [1]
Link: https://github.com/systemd/systemd/pull/41627
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 +++---
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
index a6447f7a31fe..d158678fa6ab 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
@@ -401,7 +401,7 @@ do_transfer()
mptcp_lib_wait_local_port_listen "${listener_ns}" "${port}"
local start
- start=$(date +%s%3N)
+ start=$(date +%s%N)
ip netns exec ${connector_ns} \
./mptcp_connect -t ${timeout_poll} -p $port -s ${cl_proto} \
$extra_args $connect_addr < "$cin" > "$cout" &
@@ -423,7 +423,7 @@ do_transfer()
fi
local stop
- stop=$(date +%s%3N)
+ stop=$(date +%s%N)
if $capture; then
sleep 1
@@ -439,7 +439,7 @@ do_transfer()
fi
local duration
- duration=$((stop-start))
+ duration=$(((stop-start) / 1000000))
printf "(duration %05sms) " "${duration}"
if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ] || [ ${timeout_pid} -ne 0 ]; then
mptcp_lib_pr_fail "client exit code $retc, server $rets"
diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 989a5975dcea..9d3efbfb3015 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -236,7 +236,7 @@ mptcp_lib_kversion_ge() {
}
mptcp_lib_subtests_last_ts_reset() {
- MPTCP_LIB_SUBTESTS_LAST_TS_MS="$(date +%s%3N)"
+ MPTCP_LIB_SUBTESTS_LAST_TS_MS="$(date +%s%N)"
}
mptcp_lib_subtests_last_ts_reset
@@ -255,7 +255,7 @@ __mptcp_lib_result_check_duplicated() {
__mptcp_lib_result_add() {
local result="${1}"
local time="time="
- local ts_prev_ms
+ local ts_prev_ns
shift
local id=$((${#MPTCP_LIB_SUBTESTS[@]} + 1))
@@ -265,9 +265,9 @@ __mptcp_lib_result_add() {
# not to add two '#'
[[ "${*}" != *"#"* ]] && time="# ${time}"
- ts_prev_ms="${MPTCP_LIB_SUBTESTS_LAST_TS_MS}"
+ ts_prev_ns="${MPTCP_LIB_SUBTESTS_LAST_TS_MS}"
mptcp_lib_subtests_last_ts_reset
- time+="$((MPTCP_LIB_SUBTESTS_LAST_TS_MS - ts_prev_ms))ms"
+ time+="$(((MPTCP_LIB_SUBTESTS_LAST_TS_MS - ts_prev_ns) / 1000000))ms"
MPTCP_LIB_SUBTESTS+=("${result} ${id} - ${KSFT_TEST}: ${*} ${time}")
}
---
base-commit: 5964bb11dac34466d64d9d939e8498db9f576f6c
change-id: 20260515-mptcp-sft-uutils-0-8-0-08e3c2c5afa8
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier
2026-05-15 2:11 [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier Matthieu Baerts (NGI0)
@ 2026-05-15 3:19 ` MPTCP CI
2026-05-15 3:59 ` Matthieu Baerts
1 sibling, 0 replies; 4+ messages in thread
From: MPTCP CI @ 2026-05-15 3:19 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: mptcp
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! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/25896910569
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/73e82c988ae5
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1095088
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier
2026-05-15 2:11 [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier Matthieu Baerts (NGI0)
2026-05-15 3:19 ` MPTCP CI
@ 2026-05-15 3:59 ` Matthieu Baerts
2026-05-15 4:15 ` Matthieu Baerts
1 sibling, 1 reply; 4+ messages in thread
From: Matthieu Baerts @ 2026-05-15 3:59 UTC (permalink / raw)
To: MPTCP Linux
Hello,
On 15/05/2026 04:11, Matthieu Baerts (NGI0) wrote:
> Using the format specifier +%s%3N with GNU date is honoured, and only
> prints 3 digits of the nanoseconds portion of the seconds since epoch,
> which corresponds to the milliseconds.
>
> The uutils implementation of date currently does not honour this, and
> always prints all 9 digits. This is a known issue [1], but can be worked
> around by adapting this test to use nanoseconds instead of microseconds,
> and then divide it by 1e6.
>
> This fix is similar to what has been done on systemd side [2].
I suggest applying this patch, and sending to netdev-net, not to block
those using uutils, e.g. on Ubuntu 26.04.
I will apply a small change, see below.
(...)
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> index 989a5975dcea..9d3efbfb3015 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> @@ -236,7 +236,7 @@ mptcp_lib_kversion_ge() {
> }
>
> mptcp_lib_subtests_last_ts_reset() {
> - MPTCP_LIB_SUBTESTS_LAST_TS_MS="$(date +%s%3N)"
> + MPTCP_LIB_SUBTESTS_LAST_TS_MS="$(date +%s%N)"
The suffix should then be _NS instead of _MS.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier
2026-05-15 3:59 ` Matthieu Baerts
@ 2026-05-15 4:15 ` Matthieu Baerts
0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2026-05-15 4:15 UTC (permalink / raw)
To: MPTCP Linux
On 15/05/2026 05:59, Matthieu Baerts wrote:
> Hello,
>
> On 15/05/2026 04:11, Matthieu Baerts (NGI0) wrote:
>> Using the format specifier +%s%3N with GNU date is honoured, and only
>> prints 3 digits of the nanoseconds portion of the seconds since epoch,
>> which corresponds to the milliseconds.
>>
>> The uutils implementation of date currently does not honour this, and
>> always prints all 9 digits. This is a known issue [1], but can be worked
>> around by adapting this test to use nanoseconds instead of microseconds,
>> and then divide it by 1e6.
>>
>> This fix is similar to what has been done on systemd side [2].
>
> I suggest applying this patch, and sending to netdev-net, not to block
> those using uutils, e.g. on Ubuntu 26.04.
>
> I will apply a small change, see below.
Now in our tree:
New patches for t/upstream-net and t/upstream:
- ddfbd0a8f455: selftests: mptcp: drop nanoseconds width specifier
- Results: abcff95a440d..c6403a142d47 (export-net)
- Results: 564a2979a856..17d8ed7a3a1c (export)
Tests are now in progress:
- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/91d16c37e15ffff4ea145b5b7c897f2f4e5cfd3d/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/bae8b1e40c2d814e5d571dfa0885a59722911bb6/checks
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-15 4:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 2:11 [PATCH mptcp-net] selftests: mptcp: drop nanoseconds width specifier Matthieu Baerts (NGI0)
2026-05-15 3:19 ` MPTCP CI
2026-05-15 3:59 ` Matthieu Baerts
2026-05-15 4:15 ` Matthieu Baerts
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.