Skip to content

Commit

Permalink
selftests: mptcp: add last time actions tests
Browse files Browse the repository at this point in the history
This patch adds a new helper show_mptcp_info() to show the counters in
mptcp_info of the given infos. Use it to show newly added last_data_sent,
last_data_recv and last_ack_recv in mptcp_info in endpoint_tests().

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Mar 18, 2024
1 parent 7ba04cb commit b7734ff
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,25 @@ chk_subflows_total()
fi
}

show_mptcp_info()
{
local info

for info in "${@}"; do
local cnt1
local cnt2

cnt1=$(ss -N $ns1 -inmHM | mptcp_lib_get_info_value "$info" "$info")
cnt2=$(ss -N $ns2 -inmHM | mptcp_lib_get_info_value "$info" "$info")
print_check "mptcp_info ${info:0:15}=$cnt1:$cnt2"
if [ -z "$cnt1" ] || [ -z "$cnt2" ]; then
print_skip
else
print_ok
fi
done
}

chk_link_usage()
{
local ns=$1
Expand Down Expand Up @@ -3589,6 +3608,7 @@ endpoint_tests()
$ns2 10.0.2.2 id 1 flags implicit
chk_mptcp_info subflows 1 subflows 1
chk_mptcp_info add_addr_signal 1 add_addr_accepted 1
show_mptcp_info last_data_sent last_data_recv last_ack_recv

pm_nl_add_endpoint $ns2 10.0.2.2 id 33 2>/dev/null
pm_nl_check_endpoint "ID change is prevented" \
Expand All @@ -3612,6 +3632,7 @@ endpoint_tests()
wait_mpj $ns2
chk_subflow_nr "before delete" 2
chk_mptcp_info subflows 1 subflows 1
show_mptcp_info last_data_sent last_data_recv last_ack_recv

pm_nl_del_endpoint $ns2 2 10.0.2.2
sleep 0.5
Expand Down

0 comments on commit b7734ff

Please sign in to comment.