@@ -173,7 +173,8 @@ do_transfer()
wait $spid
local rets=$?
- printf "%-25s %35s" "transfer ${ip}" " "
+ TEST_COUNT=$((TEST_COUNT+1))
+ printf "%02u %-25s %35s" "$TEST_COUNT" "transfer ${ip}" " "
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
@@ -190,7 +191,8 @@ do_transfer()
fi
mptcp_lib_print_ok "[ OK ]"
- printf "%-25s %35s" "mark ${ip}" " "
+ TEST_COUNT=$((TEST_COUNT+1))
+ printf "%02u %-25s %35s" "$TEST_COUNT" "mark ${ip}" " "
if [ $local_addr = "::" ];then
check_mark $listener_ns 6 || retc=1
check_mark $connector_ns 6 || retc=1
@@ -238,7 +240,8 @@ do_mptcp_sockopt_tests()
ip netns exec "$ns3" ./mptcp_sockopt
lret=$?
- printf "%-25s %35s" "sockopt v4" " "
+ TEST_COUNT=$((TEST_COUNT+1))
+ printf "%02u %-25s %35s" "$TEST_COUNT" "sockopt v4" " "
if [ $lret -ne 0 ]; then
mptcp_lib_print_err "[ FAIL ] SOL_MPTCP getsockopt"
mptcp_lib_result_fail "sockopt v4"
@@ -251,7 +254,8 @@ do_mptcp_sockopt_tests()
ip netns exec "$ns3" ./mptcp_sockopt -6
lret=$?
- printf "%-25s %35s" "sockopt v6" " "
+ TEST_COUNT=$((TEST_COUNT+1))
+ printf "%02u %-25s %35s" "$TEST_COUNT" "sockopt v6" " "
if [ $lret -ne 0 ]; then
mptcp_lib_print_err "[ FAIL] SOL_MPTCP getsockopt (ipv6)"
mptcp_lib_result_fail "sockopt v6"
@@ -281,7 +285,8 @@ run_tests()
do_tcpinq_test()
{
- printf "%-25s %35s" "TCP_INQ: $*" " "
+ TEST_COUNT=$((TEST_COUNT+1))
+ printf "%02u %-25s %35s" "$TEST_COUNT" "TCP_INQ: $*" " "
ip netns exec "$ns3" ./mptcp_inq "$@"
local lret=$?
if [ $lret -ne 0 ];then
This patch prints out TEST_COUNT for every tests in script mptcp_sockopt.sh. The output looks like: 01 transfer ipv4 [ OK ] 02 mark ipv4 [ OK ] 03 transfer ipv6 [ OK ] 04 mark ipv6 [ OK ] PASS: all packets had packet mark set 05 sockopt v4 [ OK ] 06 sockopt v6 [ OK ] PASS: SOL_MPTCP getsockopt has expected information 07 TCP_INQ: -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -t tcp 08 TCP_INQ: -6 -t tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -6 -t tcp 09 TCP_INQ: -r tcp [ OK ] PASS: TCP_INQ cmsg/ioctl -r tcp 10 TCP_INQ: -6 -r tcp [ OK ] Having test counters helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)