From: Matthieu Baerts <matthieu.bae...@tessares.net>

Very occasionally, MPTCP selftests fail. Yeah, I saw that at least once!

Here we provide more details in case of errors with mptcp_join.sh script
like it was done with mptcp_connect.sh, see
commit 767389c8dd55 ("selftests: mptcp: dump more info on errors")

Suggested-by: Paolo Abeni <pab...@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.bae...@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martin...@linux.intel.com>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh 
b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 56ffdad01526..abeb24b7f8ec 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -78,6 +78,7 @@ cleanup_partial()
 
        for netns in "$ns1" "$ns2"; do
                ip netns del $netns
+               rm -f /tmp/$netns.{nstat,out}
        done
 }
 
@@ -233,6 +234,11 @@ do_transfer()
                sleep 1
        fi
 
+       NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
+               nstat -n
+       NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \
+               nstat -n
+
        if [ $speed = "fast" ]; then
                mptcp_connect="./mptcp_connect -j"
        elif [ $speed = "slow" ]; then
@@ -383,12 +389,19 @@ do_transfer()
            kill $cappid
        fi
 
+       NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
+               nstat | grep Tcp > /tmp/${listener_ns}.out
+       NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \
+               nstat | grep Tcp > /tmp/${connector_ns}.out
+
        if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
                echo " client exit code $retc, server $rets" 1>&2
                echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
-               ip netns exec ${listener_ns} ss -nita 1>&2 -o "sport = :$port"
+               ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
+               cat /tmp/${listener_ns}.out
                echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2
-               ip netns exec ${connector_ns} ss -nita 1>&2 -o "dport = :$port"
+               ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = 
:$port"
+               cat /tmp/${connector_ns}.out
 
                cat "$capout"
                ret=1
-- 
2.31.1

Reply via email to