Skip to content

Commit

Permalink
selftests: mptcp: reset the last TS before the first test
Browse files Browse the repository at this point in the history
Just to slightly improve the precision of the duration of the first
test.

In mptcp_join.sh, the last append_prev_results is now done as soon as
the last test is over: this will add the last result in the list, and
get a more precise time for this last test.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe authored and intel-lab-lkp committed Aug 21, 2024
1 parent 608aff4 commit 12deb63
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ stop_if_error()
make_file "$cin" "client"
make_file "$sin" "server"

mptcp_lib_subtests_last_ts_reset

check_mptcp_disabled

stop_if_error "The kernel configuration is not valid for MPTCP"
Expand Down
3 changes: 2 additions & 1 deletion tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3868,9 +3868,11 @@ if [ ${#tests[@]} -eq 0 ]; then
tests=("${all_tests_names[@]}")
fi

mptcp_lib_subtests_last_ts_reset
for subtests in "${tests[@]}"; do
"${subtests}"
done
append_prev_results

if [ ${ret} -ne 0 ]; then
echo
Expand All @@ -3881,7 +3883,6 @@ if [ ${ret} -ne 0 ]; then
echo
fi

append_prev_results
mptcp_lib_result_print_all_tap

exit $ret
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ init
make_file "$cin" "client" 1
make_file "$sin" "server" 1
trap cleanup EXIT
mptcp_lib_subtests_last_ts_reset

run_tests $ns1 $ns2 10.0.1.1
run_tests $ns1 $ns2 dead:beef:1::1
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/net/mptcp/pm_netlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ check()
fi
}

mptcp_lib_subtests_last_ts_reset

check "show_endpoints" "" "defaults addr list"

default_limits="$(get_limits)"
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/simult_flows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ while getopts "bcdhi" option;do
done

setup
mptcp_lib_subtests_last_ts_reset
run_test 10 10 0 0 "balanced bwidth"
run_test 10 10 1 25 "balanced bwidth with unbalanced delay"

Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/net/mptcp/userspace_pm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ mptcp_lib_events "${ns2}" "${client_evts}" client_evts_pid
server_evts=$(mktemp)
mptcp_lib_events "${ns1}" "${server_evts}" server_evts_pid
sleep 0.5
mptcp_lib_subtests_last_ts_reset

print_title "Init"
print_test "Created network namespaces ns1, ns2"
Expand Down

0 comments on commit 12deb63

Please sign in to comment.