Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests: mptcp: join: skip check if MIB counter not supported
commit 47867f0a7e831e24e5eab3330667ce9682d50fb1 upstream. Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the MPTCP MIB counters introduced in commit fc51895 ("mptcp: add and use MIB counter infrastructure") and more later. The MPTCP Join selftest heavily relies on these counters. If a counter is not supported by the kernel, it is not displayed when using 'nstat -z'. We can then detect that and skip the verification. A new helper (get_counter()) has been added to do the required checks and return an error if the counter is not available. Note that if we expect to have these features available and if SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES env var is set to 1, the tests will be marked as failed instead of skipped. This new helper also makes sure we get the exact counter we want to avoid issues we had in the past, e.g. with MPTcpExtRmAddr and MPTcpExtRmAddrDrop sharing the same prefix. While at it, we uniform the way we fetch a MIB counter. Note for the backports: we rarely change these modified blocks so if there is are conflicts, it is very l(CR) because a counter is not used in the older kernels and we don't need that chunk. Link: multipath-tcp/mptcp_net-next#368 Fixes: b08fbf2 ("selftests: add test-cases for MPTCP MP_JOIN") Cc: [email protected] Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information