On Thu, 13 Jul 2023, Matthieu Baerts wrote:
> Recently, I wanted to understand why the userspace_pm.sh test was
> failing on some arch according to lkft reports. There was nothing in the
> logs apart from seeing the expected event had been missing. I then
> realised the output of pm_nl_ctl was muted but also this tool was not
> looking if there were errors after having sent some Netlink commands.
>
> I don't think it is a good idea to mute the output and ignore errors,
> especially here in the tests where we do want to validate these Netlink
> commands. So now the tool checks for errors and the output is no longer
> discarded.
>
> Note that I didn't manage to read the error message set by the kernel. I
> think the rtattr pointer in nl_error() is wrong. I think it should get
> info from &err->msg instead of nh. Anyway, here we at least print errno
> and just in case someone wants to have a look, it is easy to test:
>
> ./pm_nl_ctl ann 1.1.1.1 token 12 id 0
>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
> Changes in v2:
> - Patch 1/2: mute expected errors in selftests
> - Link to v1: https://lore.kernel.org/r/20230705-mptcp-issue-368-pm_nl_ctl_ack-v1-0-40bcff40cb6b@tessares.net
>
Thanks for the fix, v2 LGTM:
Reviewed-by: Mat Martineau <martineau@kernel.org>
> ---
> Matthieu Baerts (2):
> selftests: mptcp: pm_nl_ctl: always look for errors
> selftests: mptcp: userspace_pm: unmute unexpected errors
>
> tools/testing/selftests/net/mptcp/pm_netlink.sh | 6 +-
> tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 33 ++++---
> tools/testing/selftests/net/mptcp/userspace_pm.sh | 100 +++++++++++-----------
> 3 files changed, 75 insertions(+), 64 deletions(-)
> ---
> base-commit: 3ee02a7d38ae4c5fc98a3f833f2a6f44f4b4b15a
> change-id: 20230705-mptcp-issue-368-pm_nl_ctl_ack-bb1625f5bdda
>
> Best regards,
> --
> Matthieu Baerts <matthieu.baerts@tessares.net>
>
>
>