Skip to contentSkip to conversation

selftests: mptcp: misc. small fixes

PATCH In review Matthieu Baerts (NGI0) 2 participants 6 messages Sep 10, 2024

Subsystems (3)
lore
Share & tools
lore

Matthieu Baerts (NGI0)

author maintainer
#0 lore raw

cover selftests: mptcp: misc. small fixes

Here are some various fixes for the MPTCP selftests.

Patch 1 fixes a recently modified test to continue to work as expected on older kernels. This is a fix for a recent fix that can be backported up to v5.15.

Patch 2 and 3 include dependences when exporting or installing the tests. Two fixes for v6.11-rc1.

Because the fixes are quite straightforward, I suggest to send these patches soon after to Netdev, hopefully to be included before the final v6.11.

---
Matthieu Baerts (NGI0) (3):
selftests: mptcp: join: restrict fullmesh endp on 1st sf
selftests: mptcp: include lib.sh file
selftests: mptcp: include net_helper.sh file

 tools/testing/selftests/net/mptcp/Makefile      | 2 ++
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

---
base-commit: 085cc64096c367f8c90237934304f82384d37e5d
change-id: 20240910-selftests-mptcp-fix-install-a9a4edad7d0c

Best regards,

Signature · 1 line
Matthieu Baerts (NGI0) <[email protected]>
author maintainer
#1 lore raw

PATCH 1/3 selftests: mptcp: join: restrict fullmesh endp on 1st sf

A new endpoint using the IP of the initial subflow has been recently added to increase the code coverage. But it breaks the test when using old kernels not having commit 86e39e04482b ("mptcp: keep track of local endpoint still available for each msk"), e.g. on v5.15.

Similar to commit d4c81bbb8600 ("selftests: mptcp: join: support local endpoint being tracked or not"), it is possible to add the new endpoint conditionally, by checking if "mptcp_pm_subflow_check_next" is present in kallsyms: this is not directly linked to the commit introducing this symbol but for the parent one which is linked anyway. So we can know in advance what will be the expected behaviour, and add the new endpoint only when it makes sense to do so.

Fixes 4878f9f8421f ("selftests: mptcp: join: validate fullmesh endp on 1st sf")
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +3 -1
index 3564cd06643c..e8d0a01b4144 100755
@@ -3130,7 +3130,9 @@ fullmesh_tests()
 		pm_nl_set_limits $ns1 1 3
 		pm_nl_set_limits $ns2 1 3
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
-		pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,fullmesh
+		if mptcp_lib_kallsyms_has "mptcp_pm_subflow_check_next$"; then
+			pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,fullmesh
+		fi
 		fullmesh=1 speed=slow \
 			run_tests $ns1 $ns2 10.0.1.1
 		chk_join_nr 3 3 3
Signature · 1 line
2.45.2
author maintainer
#2 lore raw

PATCH 2/3 selftests: mptcp: include lib.sh file

In reply to Matthieu Baerts (NGI0)

The lib.sh file from the parent directory is used by the MPTCP selftests and it needs to be present when running the tests.

This file then needs to be listed in the Makefile to be included when exporting or installing the tests, e.g. with:

  make -C tools/testing/selftests \
          TARGETS=net/mptcp \
          install INSTALL_PATH=$KSFT_INSTALL_PATH

cd $KSFT_INSTALL_PATH
./run_kselftest.sh -c net/mptcp

Fixes f265d3119a29 ("selftests: mptcp: lib: use setup/cleanup_ns helpers")
---
 tools/testing/selftests/net/mptcp/Makefile | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/net/mptcp/Makefile +2 -0
index 7b936a926859..68924053a1e6 100644
@@ -11,6 +11,8 @@ TEST_GEN_FILES = mptcp_connect pm_nl_ctl mptcp_sockopt mptcp_inq
 
 TEST_FILES := mptcp_lib.sh settings
 
+TEST_INCLUDES := ../lib.sh
+
 EXTRA_CLEAN := *.pcap
 
 include ../../lib.mk
Signature · 1 line
2.45.2
author maintainer
#3 lore raw

PATCH 3/3 selftests: mptcp: include net_helper.sh file

In reply to Matthieu Baerts (NGI0)

Similar to the previous commit, the net_helper.sh file from the parent directory is used by the MPTCP selftests and it needs to be present when running the tests.

This file then needs to be listed in the Makefile to be included when exporting or installing the tests, e.g. with:

  make -C tools/testing/selftests \
          TARGETS=net/mptcp \
          install INSTALL_PATH=$KSFT_INSTALL_PATH

cd $KSFT_INSTALL_PATH
./run_kselftest.sh -c net/mptcp

Fixes 1af3bc912eac ("selftests: mptcp: lib: use wait_local_port_listen helper")
---
 tools/testing/selftests/net/mptcp/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/Makefile +1 -1
index 68924053a1e6..5d796622e730 100644
@@ -11,7 +11,7 @@ TEST_GEN_FILES = mptcp_connect pm_nl_ctl mptcp_sockopt mptcp_inq
 
 TEST_FILES := mptcp_lib.sh settings
 
-TEST_INCLUDES := ../lib.sh
+TEST_INCLUDES := ../lib.sh ../net_helper.sh
 
 EXTRA_CLEAN := *.pcap
 
Signature · 1 line
2.45.2
#4 lore raw
In reply to Matthieu Baerts (NGI0)

Hi Matthieu,

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/10797305656

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

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)

author maintainer
#5 lore raw
In reply to Matthieu Baerts (NGI0)

Hello,

Quoted 6 lines · On 10/09/2024 18:51, Matthieu Baerts (NGI0) wrote:

Here are some various fixes for the MPTCP selftests.

Patch 1 fixes a recently modified test to continue to work as expected on older kernels. This is a fix for a recent fix that can be backported up to v5.15.

Quoted 6 lines

Patch 2 and 3 include dependences when exporting or installing the tests. Two fixes for v6.11-rc1.

Because the fixes are quite straightforward, I suggest to send these patches soon after to Netdev, hopefully to be included before the final v6.11.

Just applied in our tree:

New patches for t/upstream-net and t/upstream:
- db11527f3688: selftests: mptcp: join: restrict fullmesh endp on 1st sf
- 685e393ba885: selftests: mptcp: include lib.sh file
- 2c8af9766f26: selftests: mptcp: include net_helper.sh file
- Results: 1bde6ee4cd32..a6bb83c9a6f1 (export-net)
- Results: 085cc64096c3..b4ced873ec79 (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/7c3c5b71ac72ab6539d1bd49156b9732688d7f6c/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/242ed77d7ffdf2b73e373dd8fe3d8282eee6f9f4/checks

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.