Skip to content

Commit f589234

Browse files
matttbedavem330
authored andcommitted
selftests: mptcp: userspace_pm: format subtests results in TAP
The current selftests infrastructure formats the results in TAP 13. This version doesn't support subtests and only the end result of each selftest is taken into account. It means that a single issue in a subtest of a selftest containing multiple subtests forces the whole selftest to be marked as failed. It also means that subtests results are not tracked by CIs executing selftests. MPTCP selftests run hundreds of various subtests. It is then important to track each of them and not one result per selftest. It is particularly interesting to do that when validating stable kernels with the last version of the test suite: tests might fail because a feature is not supported but the test didn't skip that part. In this case, if subtests are not tracked, the whole selftest will be marked as failed making the other subtests useless because their results are ignored. This patch formats subtests results in TAP in userspace_pm.sh selftest. Link: multipath-tcp/mptcp_net-next#368 Acked-by: Paolo Abeni <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e86a29 commit f589234

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ rndh=$(printf %x "$sec")-$(mktemp -u XXXXXX)
5959
ns1="ns1-$rndh"
6060
ns2="ns2-$rndh"
6161
ret=0
62+
test_name=""
63+
6264
_printf() {
6365
stdbuf -o0 -e0 printf "${@}"
6466
}
@@ -71,7 +73,9 @@ print_title()
7173
# $1: test name
7274
print_test()
7375
{
74-
_printf "%-63s" "${1}"
76+
test_name="${1}"
77+
78+
_printf "%-63s" "${test_name}"
7579
}
7680

7781
print_results()
@@ -82,11 +86,13 @@ print_results()
8286
test_pass()
8387
{
8488
print_results " OK "
89+
mptcp_lib_result_pass "${test_name}"
8590
}
8691

8792
test_skip()
8893
{
8994
print_results "SKIP"
95+
mptcp_lib_result_skip "${test_name}"
9096
}
9197

9298
# $1: msg
@@ -98,6 +104,8 @@ test_fail()
98104
if [ -n "${1}" ]; then
99105
_printf "\t%s\n" "${1}"
100106
fi
107+
108+
mptcp_lib_result_fail "${test_name}"
101109
}
102110

103111
kill_wait()
@@ -255,6 +263,7 @@ make_connection()
255263
test_pass
256264
else
257265
test_fail "Expected tokens (c:${client_token} - s:${server_token}) and server (c:${client_serverside} - s:${server_serverside})"
266+
mptcp_lib_result_print_all_tap
258267
exit 1
259268
fi
260269

@@ -990,4 +999,5 @@ test_subflows_v4_v6_mix
990999
test_prio
9911000
test_listener
9921001

1002+
mptcp_lib_result_print_all_tap
9931003
exit ${ret}

0 commit comments

Comments
 (0)