@@ -267,7 +267,8 @@ check_mptcp_disabled()
return 1
fi
- echo -n -e "New MPTCP socket can be blocked via sysctl\t\t"
+ TEST_COUNT=$((TEST_COUNT+1))
+ echo -n -e "0${TEST_COUNT} New MPTCP socket can be blocked via sysctl\t\t"
mptcp_lib_print_ok "\t\t [ OK ]"
mptcp_lib_result_pass "New MPTCP socket can be blocked via sysctl"
return 0
@@ -337,7 +338,8 @@ do_transfer()
local addr_port
addr_port=$(printf "%s:%d" ${connect_addr} ${port})
local result_msg
- result_msg="$(printf "%.3s %-5s -> %.3s (%-20s) %-5s" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})"
+ result_msg="$(printf "%02u %.3s %-5s -> %.3s (%-20s) %-5s" \
+ ${TEST_COUNT} ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})"
printf "%s\t" "${result_msg}"
if $capture; then
@@ -641,7 +643,8 @@ run_test_transparent()
# following function has been exported (T). Not great but better than
# checking for a specific kernel version.
if ! mptcp_lib_kallsyms_has "T __ip_sock_set_tos$"; then
- echo "INFO: ${msg} not supported by the kernel: SKIP"
+ TEST_COUNT=$((TEST_COUNT+1))
+ echo "${TEST_COUNT} INFO: ${msg} not supported by the kernel: SKIP"
mptcp_lib_result_skip "${TEST_GROUP}"
return
fi
@@ -658,7 +661,8 @@ table inet mangle {
}
EOF
if [ $? -ne 0 ]; then
- echo "SKIP: $msg, could not load nft ruleset"
+ TEST_COUNT=$((TEST_COUNT+1))
+ echo "${TEST_COUNT} SKIP: $msg, could not load nft ruleset"
mptcp_lib_fail_if_expected_feature "nft rules"
mptcp_lib_result_skip "${TEST_GROUP}"
return
@@ -675,7 +679,8 @@ EOF
ip -net "$listener_ns" $r6flag rule add fwmark 1 lookup 100
if [ $? -ne 0 ]; then
ip netns exec "$listener_ns" nft flush ruleset
- echo "SKIP: $msg, ip $r6flag rule failed"
+ TEST_COUNT=$((TEST_COUNT+1))
+ echo "${TEST_COUNT} SKIP: $msg, ip $r6flag rule failed"
mptcp_lib_fail_if_expected_feature "ip rule"
mptcp_lib_result_skip "${TEST_GROUP}"
return
@@ -685,7 +690,8 @@ EOF
if [ $? -ne 0 ]; then
ip netns exec "$listener_ns" nft flush ruleset
ip -net "$listener_ns" $r6flag rule del fwmark 1 lookup 100
- echo "SKIP: $msg, ip route add local $local_addr failed"
+ TEST_COUNT=$((TEST_COUNT+1))
+ echo "${TEST_COUNT} SKIP: $msg, ip route add local $local_addr failed"
mptcp_lib_fail_if_expected_feature "ip route"
mptcp_lib_result_skip "${TEST_GROUP}"
return
@@ -840,6 +846,9 @@ done
mptcp_lib_result_code "${ret}" "ping tests"
stop_if_error "Could not even run ping tests"
+TEST_COUNT=$((TEST_COUNT+1))
+echo -n -e "0${TEST_COUNT} ping tests\t\t"
+mptcp_lib_print_ok "\t\t\t\t\t\t [ OK ]"
[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms
echo -n "INFO: Using loss of $tc_loss "
This patch prints out TEST_COUNT for every tests in script mptcp_connect.sh. The output looks like: 01 New MPTCP socket can be blocked via sysctl [ OK ] INFO: validating network environment with pings 02 ping tests [ OK ] INFO: Using loss of 0.16% delay 25 ms reorder 97% 63% with delay 6ms on ns3eth4 03 ns1 MPTCP -> ns1 (10.0.1.1:10000 ) MPTCP (duration 116ms) [ OK ] 04 ns1 MPTCP -> ns1 (10.0.1.1:10001 ) TCP (duration 33ms) [ OK ] 05 ns1 TCP -> ns1 (10.0.1.1:10002 ) MPTCP (duration 25ms) [ OK ] 06 ns1 MPTCP -> ns1 (dead:beef:1::1:10003) MPTCP (duration 128ms) [ OK ] 07 ns1 MPTCP -> ns1 (dead:beef:1::1:10004) TCP (duration 31ms) [ 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> --- .../selftests/net/mptcp/mptcp_connect.sh | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)