diff options
author | Geliang Tang <geliang.tang@suse.com> | 2023-11-29 02:18:57 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-11-30 07:06:18 +0300 |
commit | 3a96dea9f88763cfa29e15f681f95fca8952ec77 (patch) | |
tree | 083301e3ec9ad4b5b13c73215ca9d5731f2eb7ef /tools/testing/selftests/net/mptcp/mptcp_join.sh | |
parent | 119931cc88ce7073b9a289c13abaf2348d55fdfa (diff) | |
download | linux-3a96dea9f88763cfa29e15f681f95fca8952ec77.tar.xz |
selftests: mptcp: add mptcp_lib_make_file
To avoid duplicated code in different MPTCP selftests, we can add
and use helpers defined in mptcp_lib.sh.
make_file() helper in mptcp_sockopt.sh and userspace_pm.sh are the same.
Export it into mptcp_lib.sh and rename it as mptcp_lib_kill_wait(). Use
it in both mptcp_connect.sh and mptcp_join.sh.
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-13-8d6b94150f6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/mptcp/mptcp_join.sh')
-rwxr-xr-x | tools/testing/selftests/net/mptcp/mptcp_join.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index a5d66d1bfeb4..37f434cbfa44 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1171,8 +1171,7 @@ make_file() local who=$2 local size=$3 - dd if=/dev/urandom of="$name" bs=1024 count=$size 2> /dev/null - echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "$name" + mptcp_lib_make_file $name 1024 $size print_info "Test file (size $size KB) for $who" } |