OSDN Git Service

selftests: mptcp: pm_nl_ctl: always look for errors
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Sun, 30 Jul 2023 08:05:17 +0000 (10:05 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Aug 2023 03:11:53 +0000 (20:11 -0700)
commit1dc88d241f9260fac6477ad040a5f1edbc3c2968
tree73eb2ba7ffb364318bb85bf826983e4194d9e31c
parent9466df1a27d55842bec496d3a84e98ee938c31aa
selftests: mptcp: pm_nl_ctl: always look for errors

If a Netlink command for the MPTCP path-managers is not valid, it is
important to check if there are errors. If yes, they need to be reported
instead of being ignored and exiting without errors.

Now if no replies are expected, an ACK from the kernelspace is asked by
the userspace in order to always expect a reply. We can use the same
buffer that is currently always >1024 bytes. Then we can check if there
is an error (err->error), print it if any and report the error.

After this modification, it is required to mute expected errors in
mptcp_join.sh and pm_netlink.sh selftests:

- when trying to add a bad endpoint, e.g. duplicated
- when trying to set the two limits above the hard limit

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-3-7e9cc530a9cd@tessares.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh
tools/testing/selftests/net/mptcp/pm_netlink.sh
tools/testing/selftests/net/mptcp/pm_nl_ctl.c