Skip to content

Commit 2399c14

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
selftests: mptcp: sockopt: save nstat infos
Similar to the way nstat information is stored in mptcp_connect.sh and mptcp_join.sh scripts, this patch adds a similar way for mptcp_sockopt.sh and displays the nstat information when errors occur. Please apply this patch before the commit "selftests: mptcp: simult_flows: unify errors msgs" when merging it. Signed-off-by: Geliang Tang <[email protected]>
1 parent dabd9bd commit 2399c14

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ do_transfer()
169169
cmsg+=",TCPINQ"
170170
fi
171171

172+
NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
173+
nstat -n
174+
NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \
175+
nstat -n
176+
172177
timeout ${timeout_test} \
173178
ip netns exec ${listener_ns} \
174179
$mptcp_connect -t ${timeout_poll} -l -M 1 -p $port -s ${srv_proto} -c "${cmsg}" \
@@ -189,14 +194,20 @@ do_transfer()
189194
wait $spid
190195
local rets=$?
191196

197+
NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
198+
nstat | grep Tcp > /tmp/${listener_ns}.out
199+
NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \
200+
nstat | grep Tcp > /tmp/${connector_ns}.out
201+
192202
print_title "Transfer ${ip:2}"
193203
if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
194204
mptcp_lib_pr_fail "client exit code $retc, server $rets"
195205
echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
196206
ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
197-
207+
cat /tmp/${listener_ns}.out
198208
echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2
199209
ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = :$port"
210+
cat /tmp/${connector_ns}.out
200211

201212
mptcp_lib_result_fail "transfer ${ip}"
202213

0 commit comments

Comments
 (0)