[PATCH mptcp-next v2 0/2] selftests: mptcp: pm_nl_ctl: display errors if any

Matthieu Baerts posted 2 patches 9 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20230713-mptcp-issue-368-pm._5Fnl._5Fctl._5Fack-v2-0-eb9582b8e24b@tessares.net
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
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(-)
[PATCH mptcp-next v2 0/2] selftests: mptcp: pm_nl_ctl: display errors if any
Posted by Matthieu Baerts 9 months, 3 weeks ago
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

---
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>
Re: [PATCH mptcp-next v2 0/2] selftests: mptcp: pm_nl_ctl: display errors if any
Posted by Mat Martineau 9 months, 3 weeks ago
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>
>
>
>
Re: [PATCH mptcp-next v2 0/2] selftests: mptcp: pm_nl_ctl: display errors if any
Posted by Matthieu Baerts 9 months, 2 weeks ago
Hi Mat,

On 15/07/2023 01:37, Mat Martineau wrote:
> 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>

Thank you for your review!

Now in our tree (feat. for net-next) with your RvB tag:

New patches for t/upstream:
- 5f1f8d5f478a: selftests: mptcp: pm_nl_ctl: always look for errors
- 9ed40a078338: selftests: mptcp: userspace_pm: unmute unexpected errors
- Results: 0c9d206ff536..87ca9f6d4f74 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230717T134429

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net