mbox series

[mptcp-next,v6,0/9] use helpers in lib.sh and net_helpers.sh

Message ID 20240527-selftests-net-lib-fixes-v6-0-72411ff2460e@kernel.org (mailing list archive)
Headers show
Series use helpers in lib.sh and net_helpers.sh | expand

Message

Matthieu Baerts (NGI0) May 27, 2024, 10:58 a.m. UTC
(This is a new version for the series created by Geliang. @Geliang: I
 hope that's OK for you like that, it was easier to describing the
 modifications by email. I validated my changes by running MPTCP
 selftests only)

This set uses the public helpers defined in net selftests to replace
helpers in mptcp_lib.sh.

v6:
 - Replace "rename ns in setup_ns" by "remove 'ns' var in setup_ns": we
   don't need it, avoid extra conflicts.

v5: (Matt)
 - New patches: 1-6: some unrelated fixes, some modifications to avoid
   adding workaround on our side (changing variable names, trap, etc.)
 - "rename ns in setup_ns": drop the modifications in cleanup_ns, exit
   in case of error, and updated commit message.
 - Drop patches 2, 4, 5/6 from v4.

v4:
 - two more fixes added
 - exit when setup_ns fails in mptcp_lib_ns_init

v3:
 - address Matt's comments in v2 (thanks, it's very useful.)
 - don't rename ns in diag.sh, but in lib.sh
 - ns in get_counter needs to be renamed too
 - add a ns_name valid check in setup_ns
 - drop $NS_LIST in mptcp_lib_ns_init
 - don't drop mptcp_lib_ns_init, use cleanup_ns in it
 - don't use cleanup_all_ns, still use mptcp_lib_ns_init

v2:
 - only patch 3 updated, mptcp_join.sh, move cleanup_all_ns from
   cleanup_partial to cleanup, setup_ns will delete existing
   namespaces automatically.
 - update commit logs.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v6:
- Link to v5: https://lore.kernel.org/r/20240524-selftests-net-lib-fixes-v5-0-b9e0968571a3@kernel.org

---
Geliang Tang (3):
      selftests: net: lib: remove 'ns' var in setup_ns
      selftests: mptcp: lib: use setup/cleanup_ns helpers
      selftests: mptcp: lib: use wait_local_port_listen helper

Matthieu Baerts (NGI0) (6):
      selftests: net: lib: set 'i' as local
      selftests: net: lib: support errexit with busywait
      selftests: net: lib: avoid error removing empty netns name
      selftests: net: lib: ignore possible error
      selftests: net: lib: remove ns from list after clean-up
      selftests: net: lib: do not set ns var as readonly

 tools/testing/selftests/net/lib.sh             | 71 +++++++++++++++-----------
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 33 ++++--------
 2 files changed, 50 insertions(+), 54 deletions(-)
---
base-commit: 55aceb609c1baec3e762e938e2028df7ecd545e1
change-id: 20240524-selftests-net-lib-fixes-5a70b8d3b828

Best regards,

Comments

MPTCP CI May 27, 2024, 11:47 a.m. UTC | #1
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9253831822

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/01b4afee398d
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=856116


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)
Geliang Tang May 28, 2024, 1:19 p.m. UTC | #2
On Mon, 2024-05-27 at 12:58 +0200, Matthieu Baerts (NGI0) wrote:
> (This is a new version for the series created by Geliang. @Geliang: I
>  hope that's OK for you like that, it was easier to describing the
>  modifications by email. I validated my changes by running MPTCP
>  selftests only)
> 
> This set uses the public helpers defined in net selftests to replace
> helpers in mptcp_lib.sh.
> 
> v6:
>  - Replace "rename ns in setup_ns" by "remove 'ns' var in setup_ns":
> we
>    don't need it, avoid extra conflicts.
> 
> v5: (Matt)
>  - New patches: 1-6: some unrelated fixes, some modifications to
> avoid
>    adding workaround on our side (changing variable names, trap,
> etc.)
>  - "rename ns in setup_ns": drop the modifications in cleanup_ns,
> exit
>    in case of error, and updated commit message.
>  - Drop patches 2, 4, 5/6 from v4.
> 
> v4:
>  - two more fixes added
>  - exit when setup_ns fails in mptcp_lib_ns_init
> 
> v3:
>  - address Matt's comments in v2 (thanks, it's very useful.)
>  - don't rename ns in diag.sh, but in lib.sh
>  - ns in get_counter needs to be renamed too
>  - add a ns_name valid check in setup_ns
>  - drop $NS_LIST in mptcp_lib_ns_init
>  - don't drop mptcp_lib_ns_init, use cleanup_ns in it
>  - don't use cleanup_all_ns, still use mptcp_lib_ns_init
> 
> v2:
>  - only patch 3 updated, mptcp_join.sh, move cleanup_all_ns from
>    cleanup_partial to cleanup, setup_ns will delete existing
>    namespaces automatically.
>  - update commit logs.
> 
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Thanks Matt, please add my tag:

Reviewed-by: Geliang Tang <geliang@kernel.org>

> ---
> Changes in v6:
> - Link to v5:
> https://lore.kernel.org/r/20240524-selftests-net-lib-fixes-v5-0-b9e0968571a3@kernel.org
> 
> ---
> Geliang Tang (3):
>       selftests: net: lib: remove 'ns' var in setup_ns
>       selftests: mptcp: lib: use setup/cleanup_ns helpers
>       selftests: mptcp: lib: use wait_local_port_listen helper
> 
> Matthieu Baerts (NGI0) (6):
>       selftests: net: lib: set 'i' as local
>       selftests: net: lib: support errexit with busywait
>       selftests: net: lib: avoid error removing empty netns name
>       selftests: net: lib: ignore possible error
>       selftests: net: lib: remove ns from list after clean-up
>       selftests: net: lib: do not set ns var as readonly
> 
>  tools/testing/selftests/net/lib.sh             | 71 +++++++++++++++-
> ----------
>  tools/testing/selftests/net/mptcp/mptcp_lib.sh | 33 ++++--------
>  2 files changed, 50 insertions(+), 54 deletions(-)
> ---
> base-commit: 55aceb609c1baec3e762e938e2028df7ecd545e1
> change-id: 20240524-selftests-net-lib-fixes-5a70b8d3b828
> 
> Best regards,
Matthieu Baerts (NGI0) June 3, 2024, 4:01 p.m. UTC | #3
Hi Geliang,

On 27/05/2024 12:58, Matthieu Baerts (NGI0) wrote:
> (This is a new version for the series created by Geliang. @Geliang: I
>  hope that's OK for you like that, it was easier to describing the
>  modifications by email. I validated my changes by running MPTCP
>  selftests only)
> 
> This set uses the public helpers defined in net selftests to replace
> helpers in mptcp_lib.sh.
> 
> v6:
>  - Replace "rename ns in setup_ns" by "remove 'ns' var in setup_ns": we
>    don't need it, avoid extra conflicts.

Now in our tree (fixes for -net and feat. for -next):

New patches for t/upstream-net and t/upstream:
- 531b9e5222f4: selftests: net: lib: set 'i' as local
- e47f89091b76: selftests: net: lib: support errexit with busywait
- 8266f8c1b153: selftests: net: lib: avoid error removing empty netns name
- Results: e85c0954b4e4..e83ba0520cf6 (export-net)
- Results: 5e8a75a149b7..c1dac3d16c4c (export)

New patches for t/upstream:
- 713a5cd1095c: selftests: net: lib: ignore possible error
- 74952f110c3d: selftests: net: lib: remove ns from list after clean-up
- 8d28d8be5404: selftests: net: lib: do not set ns var as readonly
- 3a8b0674ddc6: selftests: net: lib: remove 'ns' var in setup_ns
- f65043962737: selftests: mptcp: lib: use setup/cleanup_ns helpers
- 15270f7eb6d0: selftests: mptcp: lib: use wait_local_port_listen helper
- Results: c1dac3d16c4c..aedee3f57caf (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/21fc491d972666fdd691ae3c3f9a07177487b19a/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/928d380f179b846a4ba1ab0bfb21f1a215b5a469/checks

Cheers,
Matt