Skip to content

Commit 8015caa

Browse files
matttbeintel-lab-lkp
authored andcommitted
selftests: mptcp: connect: remove duplicated spaces in TAP output
It is nice to have a visual alignment in the test output to present the different results, but it makes less sense in the TAP output that is there for computers. It sounds then better to remove the duplicated whitespaces in the TAP output, also because it can cause some issues with TAP parsers expecting only one space around the directive delimiter (#). While at it, change the variable name (result_msg) to something more explicit. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 4600cfe commit 8015caa

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,11 @@ do_transfer()
345345

346346
local addr_port
347347
addr_port=$(printf "%s:%d" ${connect_addr} ${port})
348-
local result_msg
349-
result_msg="$(printf "%.3s %-5s -> %.3s (%-20s) %-5s" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})"
350-
mptcp_lib_print_title "${result_msg}"
348+
local pretty_title
349+
pretty_title="$(printf "%.3s %-5s -> %.3s (%-20s) %-5s" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto})"
350+
mptcp_lib_print_title "${pretty_title}"
351+
352+
local tap_title="${connector_ns:0:3} ${cl_proto} -> ${listener_ns:0:3} (${addr_port}) ${srv_proto}"
351353

352354
if $capture; then
353355
local capuser
@@ -443,7 +445,7 @@ do_transfer()
443445

444446
echo
445447
cat "$capout"
446-
mptcp_lib_result_fail "${TEST_GROUP}: ${result_msg}"
448+
mptcp_lib_result_fail "${TEST_GROUP}: ${tap_title}"
447449
return 1
448450
fi
449451

@@ -543,12 +545,12 @@ do_transfer()
543545

544546
if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then
545547
mptcp_lib_pr_ok "${extra:1}"
546-
mptcp_lib_result_pass "${TEST_GROUP}: ${result_msg}"
548+
mptcp_lib_result_pass "${TEST_GROUP}: ${tap_title}"
547549
else
548550
if [ -n "${extra}" ]; then
549551
mptcp_lib_print_warn "${extra:1}"
550552
fi
551-
mptcp_lib_result_fail "${TEST_GROUP}: ${result_msg}"
553+
mptcp_lib_result_fail "${TEST_GROUP}: ${tap_title}"
552554
fi
553555

554556
cat "$capout"

0 commit comments

Comments
 (0)