Skip to content

Commit 34a1c02

Browse files
matttbeintel-lab-lkp
authored andcommitted
selftests: mptcp: simult_flows: unify errors msgs
In order to unify what is printed in case of error, similar to what is done in mptcp_connect.sh and mptcp_join.sh, it is interesting to do the following modifications in simult_flows.sh: - Print the rc errors at the end of the line. - Print the MIB counters. - Use the same ss options: add -M (MPTCP sockets) and -e (detailed socket information). While at it, also print of the 'max' time only in case of success, because 'mptcp_connect.c' will already print this info in case of error, e.g.: transfer slower than expected! runtime 11948 ms, expected 11921 ms Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent f289bc8 commit 34a1c02

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ do_transfer()
155155
sleep 1
156156
fi
157157

158+
NSTAT_HISTORY=/tmp/${ns3}.nstat ip netns exec ${ns3} \
159+
nstat -n
160+
NSTAT_HISTORY=/tmp/${ns1}.nstat ip netns exec ${ns1} \
161+
nstat -n
162+
158163
timeout ${timeout_test} \
159164
ip netns exec ${ns3} \
160165
./mptcp_connect -jt ${timeout_poll} -l -p $port -T $max_time \
@@ -180,25 +185,31 @@ do_transfer()
180185
kill ${cappid_connector}
181186
fi
182187

188+
NSTAT_HISTORY=/tmp/${ns3}.nstat ip netns exec ${ns3} \
189+
nstat | grep Tcp > /tmp/${ns3}.out
190+
NSTAT_HISTORY=/tmp/${ns1}.nstat ip netns exec ${ns1} \
191+
nstat | grep Tcp > /tmp/${ns1}.out
192+
183193
cmp $sin $cout > /dev/null 2>&1
184194
local cmps=$?
185195
cmp $cin $sout > /dev/null 2>&1
186196
local cmpc=$?
187197

188-
printf "%-16s" " max $max_time "
189198
if [ $retc -eq 0 ] && [ $rets -eq 0 ] && \
190199
[ $cmpc -eq 0 ] && [ $cmps -eq 0 ]; then
200+
printf "%-16s" " max $max_time "
191201
mptcp_lib_pr_ok
192202
cat "$capout"
193203
return 0
194204
fi
195205

196-
mptcp_lib_pr_fail
197-
echo "client exit code $retc, server $rets" 1>&2
206+
mptcp_lib_pr_fail "client exit code $retc, server $rets"
198207
echo -e "\nnetns ${ns3} socket stat for $port:" 1>&2
199-
ip netns exec ${ns3} ss -nita 1>&2 -o "sport = :$port"
208+
ip netns exec ${ns3} ss -Menita 1>&2 -o "sport = :$port"
209+
cat /tmp/${ns3}.out
200210
echo -e "\nnetns ${ns1} socket stat for $port:" 1>&2
201-
ip netns exec ${ns1} ss -nita 1>&2 -o "dport = :$port"
211+
ip netns exec ${ns1} ss -Menita 1>&2 -o "dport = :$port"
212+
cat /tmp/${ns1}.out
202213
ls -l $sin $cout
203214
ls -l $cin $sout
204215

0 commit comments

Comments
 (0)