2023-07-12 16:26:48

by Matthieu Baerts

[permalink] [raw]
Subject: [PATCH net-next 0/4] selftests: mptcp: join: pass args in new env vars

In this series, Geliang did some refactoring in the mptcp_join.sh file.

Patch 1 reduces the scope of some global env vars, only used by some
tests: easier to deal with.

Patch 2 uses a dedicated env var for fastclose case instead of re-using
addr_nr_ns2 with embedded info, clearer.

Patch 3 is similar but for the fullmesh case.

Patch 4 moves a positional but optional argument of run_tests() to an
env var like it has already been done with the other args, cleaner.

Signed-off-by: Matthieu Baerts <[email protected]>
---
Geliang Tang (4):
selftests: mptcp: set all env vars as local ones
selftests: mptcp: add fastclose env var
selftests: mptcp: add fullmesh env var
selftests: mptcp: add speed env var

tools/testing/selftests/net/mptcp/mptcp_join.sh | 271 +++++++++++++-----------
1 file changed, 151 insertions(+), 120 deletions(-)
---
base-commit: e0f0a5db5f8c413cbbf48607f711c2a21023ee66
change-id: 20230712-upstream-net-next-20230712-selftests-mptcp-use-local-env-ad964224bc2a

Best regards,
--
Matthieu Baerts <[email protected]>



2023-07-12 16:31:53

by Matthieu Baerts

[permalink] [raw]
Subject: [PATCH net-next 1/4] selftests: mptcp: set all env vars as local ones

From: Geliang Tang <[email protected]>

It would be better to move the declaration of all the env variables to
do_transfer(), run_tests(), or pm_nl_set_endpoint() as local variables,
instead of exporting them globally at the beginning of the file.

Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Matthieu Baerts <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index e6c9d5451c5b..b0aaeead56c4 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -49,11 +49,12 @@ TEST_COUNT=0
TEST_NAME=""
nr_blank=40

-export FAILING_LINKS=""
-export test_linkfail=0
-export addr_nr_ns1=0
-export addr_nr_ns2=0
-export sflags=""
+# These var are used only in some tests, make sure they are not already set
+unset FAILING_LINKS
+unset test_linkfail
+unset addr_nr_ns1
+unset addr_nr_ns2
+unset sflags

# generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) ||
# (ip6 && (ip6[74] & 0xf0) == 0x30)'"
@@ -100,7 +101,6 @@ init_partial()
stats_dumped=0
check_invert=0
validate_checksum=$checksum
- FAILING_LINKS=""

# ns1 ns2
# ns1eth1 ns2eth1
@@ -828,6 +828,10 @@ pm_nl_set_endpoint()
local connector_ns="$2"
local connect_addr="$3"

+ local addr_nr_ns1=${addr_nr_ns1:-0}
+ local addr_nr_ns2=${addr_nr_ns2:-0}
+ local sflags=${sflags:-""}
+
# let the mptcp subflow be established in background before
# do endpoint manipulation
if [ $addr_nr_ns1 != "0" ] || [ $addr_nr_ns2 != "0" ]; then
@@ -979,6 +983,7 @@ do_transfer()

local port=$((10000 + TEST_COUNT - 1))
local cappid
+ local FAILING_LINKS=${FAILING_LINKS:-""}

:> "$cout"
:> "$sout"
@@ -1158,6 +1163,7 @@ run_tests()
local speed="${4:-fast}"

local size
+ local test_linkfail=${test_linkfail:-0}

# The values above 2 are reused to make test files
# with the given sizes (KB)

--
2.40.1


2023-07-14 03:58:29

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next 0/4] selftests: mptcp: join: pass args in new env vars

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <[email protected]>:

On Wed, 12 Jul 2023 18:03:15 +0200 you wrote:
> In this series, Geliang did some refactoring in the mptcp_join.sh file.
>
> Patch 1 reduces the scope of some global env vars, only used by some
> tests: easier to deal with.
>
> Patch 2 uses a dedicated env var for fastclose case instead of re-using
> addr_nr_ns2 with embedded info, clearer.
>
> [...]

Here is the summary with links:
- [net-next,1/4] selftests: mptcp: set all env vars as local ones
https://git.kernel.org/netdev/net-next/c/662aa22d7dcd
- [net-next,2/4] selftests: mptcp: add fastclose env var
https://git.kernel.org/netdev/net-next/c/080b7f5733fd
- [net-next,3/4] selftests: mptcp: add fullmesh env var
https://git.kernel.org/netdev/net-next/c/4aadde088a58
- [net-next,4/4] selftests: mptcp: add speed env var
https://git.kernel.org/netdev/net-next/c/e571fb09c893

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html