@@ -7,11 +7,7 @@ time_start=$(date +%s)
optstring="S:R:d:e:l:r:h4cm:f:tC"
final_ret=0
-sin=""
-sout=""
cin_disconnect=""
-cin=""
-cout=""
ksft_skip=4
capture=false
timeout_poll=30
@@ -128,8 +124,6 @@ TEST_GROUP=""
cleanup()
{
rm -f "$cin_disconnect" "$cout_disconnect"
- rm -f "$cin" "$cout"
- rm -f "$sin" "$sout"
rm -f "$capout"
mptcp_lib_ns_exit
@@ -145,10 +139,6 @@ if [ $? -ne 0 ];then
exit $ksft_skip
fi
-sin=$(mktemp)
-sout=$(mktemp)
-cin=$(mktemp)
-cout=$(mktemp)
capout=$(mktemp)
cin_disconnect="$cin".disconnect
cout_disconnect="$cout".disconnect
@@ -12,14 +12,10 @@
. "$(dirname "${0}")/mptcp_lib.sh"
-sin=""
sinfail=""
-sout=""
-cin=""
cinfail=""
cinsent=""
tmpfile=""
-cout=""
capout=""
ksft_skip=4
iptables="iptables"
@@ -155,11 +151,7 @@ init() {
check_tools
- sin=$(mktemp)
- sout=$(mktemp)
- cin=$(mktemp)
cinsent=$(mktemp)
- cout=$(mktemp)
mptcp_lib_evts_init
trap cleanup EXIT
@@ -170,8 +162,8 @@ init() {
cleanup()
{
- rm -f "$cin" "$cout" "$sinfail"
- rm -f "$sin" "$sout" "$cinsent" "$cinfail"
+ rm -f "$sinfail"
+ rm -f "$cinsent" "$cinfail"
rm -f "$tmpfile"
mptcp_lib_evts_remove
cleanup_partial
@@ -25,6 +25,11 @@ TEST_COUNT=0
MPTCP_LIB_SUBTESTS=()
+sin=$(mktemp)
+sout=$(mktemp)
+cin=$(mktemp)
+cout=$(mktemp)
+
# only if supported (or forced) and not disabled, see no-color.org
if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
[ "${NO_COLOR:-}" != "1" ]; then
@@ -509,4 +514,5 @@ mptcp_lib_cleanup()
{
echo "cleanup"
rm -f $mptcp_lib_err
+ rm -f "$sin" "$sout" "$cin" "$cout"
}
@@ -3,10 +3,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"
-sin=""
-sout=""
-cin=""
-cout=""
ksft_skip=4
timeout_poll=30
timeout_test=$((timeout_poll * 2 + 1))
@@ -71,8 +67,6 @@ init()
cleanup()
{
mptcp_lib_ns_exit
- rm -f "$cin" "$cout"
- rm -f "$sin" "$sout"
mptcp_lib_cleanup
}
@@ -331,10 +325,6 @@ do_tcpinq_tests()
return $?
}
-sin=$(mktemp)
-sout=$(mktemp)
-cin=$(mktemp)
-cout=$(mktemp)
init
make_file "$cin" "client" 1
make_file "$sin" "server" 1
@@ -12,8 +12,6 @@ bail=0
slack=50
large=""
small=""
-sout=""
-cout=""
capout=""
size=0
@@ -26,7 +24,6 @@ usage() {
cleanup()
{
- rm -f "$cout" "$sout"
rm -f "$large" "$small"
rm -f "$capout"
@@ -52,8 +49,6 @@ setup()
{
large=$(mktemp)
small=$(mktemp)
- sout=$(mktemp)
- cout=$(mktemp)
capout=$(mktemp)
size=$((2 * 2048 * 4096))
Export cin, cout, sin and sout vars into mptcp_lib.sh as public vars. Then they can be used in all test scripts unified. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 10 ---------- tools/testing/selftests/net/mptcp/mptcp_join.sh | 12 ++---------- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 6 ++++++ tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 10 ---------- tools/testing/selftests/net/mptcp/simult_flows.sh | 5 ----- 5 files changed, 8 insertions(+), 35 deletions(-)