linux/tools/testing/selftests/net/mptcp
Geliang Tang ce72fea219 selftests: mptcp: diag: use mptcp_lib_get_info_value
When running diag.sh in a loop, chk_dump_one will report the following
"grep: write error":

 13 ....chk 2 cestab                                  [ OK ]
 grep: write error
 14 ....chk dump_one                                  [ OK ]
 15 ....chk 2->0 msk in use after flush               [ OK ]
 16 ....chk 2->0 cestab after flush                   [ OK ]

This error is caused by a broken pipe. When the output of 'ss' is processed
by grep, 'head -n 1' will exit immediately after getting the first line,
causing the subsequent pipe to close. At this time, if 'grep' is still
trying to write data to the closed pipe, it will trigger a SIGPIPE signal,
causing a write error.

One solution is not to use this problematic "head -n 1" command, but to use
mptcp_lib_get_info_value() helper defined in mptcp_lib.sh to get the value
of 'token'.

Fixes: ba24001665 ("selftests: mptcp: add a test for mptcp_diag_dump_one")
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Tested-by: Gang Yan <yangang@kylinos.cn>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250421-net-mptcp-pm-defer-freeing-v1-2-e731dc6e86b9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-23 16:27:58 -07:00
..
.gitignore selftests: mptcp: ignore mptcp_diag binary 2025-03-31 16:52:39 -07:00
Makefile selftests: mptcp: Add a tool to get specific msk_info 2025-03-04 16:57:37 -08:00
config selftests: mptcp: add missing kconfig for NF Mangle 2024-02-01 09:06:37 -08:00
diag.sh selftests: mptcp: diag: use mptcp_lib_get_info_value 2025-04-23 16:27:58 -07:00
mptcp_connect.c selftests: mptcp: close fd_in before returning in main_loop 2025-03-31 16:52:39 -07:00
mptcp_connect.sh selftests: mptcp: connect: better display the files size 2025-01-15 13:21:15 -08:00
mptcp_diag.c selftests: mptcp: Add a tool to get specific msk_info 2025-03-04 16:57:37 -08:00
mptcp_inq.c selftests/net: mptcp: fix uninitialized variable warnings 2023-11-27 18:12:07 -08:00
mptcp_join.sh selftests: mptcp: validate MPJoin HMacFailure counters 2025-04-08 16:16:17 -07:00
mptcp_lib.sh selftests: mptcp: add -m with ss in case of errors 2025-01-15 13:21:15 -08:00
mptcp_sockopt.c selftests: mptcp: add MPTCP_FULL_INFO testcase 2023-06-21 22:45:58 -07:00
mptcp_sockopt.sh selftests: mptcp: move stats info in case of errors to lib.sh 2025-01-15 13:21:15 -08:00
pm_netlink.sh selftests: mptcp: reset the last TS before the first test 2024-09-09 16:52:04 -07:00
pm_nl_ctl.c selftests: mptcp: pm_nl_ctl: remove re-definition 2024-09-03 15:25:43 -07:00
settings selftests: mptcp: increase timeout to 30 min 2024-02-01 09:06:37 -08:00
simult_flows.sh selftests: net: Fix minor typos in MPTCP and psock tests 2025-02-19 19:02:48 -08:00
userspace_pm.sh selftests: mptcp: add pm sysctl mapping tests 2025-03-20 10:14:49 +01:00